Marko_Oktabyr

- friends
310 link karma
332 comment karma
send messageredditor for
what's this?

TROPHY CASE


  • One-Year Club

The best thing about AskReddit are the stories. So reddit, tell me an interesting story from your life. The subject doesn't matter. by SlumberingParrotin AskReddit

[–]Marko_Oktabyr 49 points50 points ago

This story is always fun to tell people, so I'll tell you Reddit.

So for a little bit of back story, I went to high school on the other side of the county. This required catching a bus at 5:40 in the morning. My poor father (who drove me to the bus stop) had to wake up even earlier than I did.

So dark and early one morning, I come staggering down the stairs to start the morning routine. I unload the dishwasher and my dad starts making his coffee. The night before we had ordered Dominos which included some cinnasticks. Cinnamon bread and frosting being the breakfast of champions, I decide to have some for breakfast.

So I pull out the bread and open up the frosting packet to stick in the microwave. Only for some reason that made sense at 5 am, I left the top of the packet on the frosting. For those of you who have never looked, the top is lined with foil. So I stick the frosting in the microwave and start it and go about my business. I come back to the microwave and (as you may have guessed) the icing packet was now on fire. I stare at it for a couple of seconds and then go

"Dad?" "Yes <my name>?" "The microwave's on fire."

So my dad walks over to the microwave, looks at the flaming icing packet inside, back to me, then back to the microwave.

"So it is."

So we stop the microwave and get everything cleaned up and I head off to school.

TL;DR: Cinnasticks don't taste very good without icing.

I blame my roommate for my bad decisions. by jimmyoncin funny

[–]Marko_Oktabyr 0 points1 point ago

TIL

[intermediate] challenge #2 by nottoobadguyin dailyprogrammer

[–]Marko_Oktabyr 0 points1 point ago

Looks like I left off the = on the comparison. Think of it as your dying breath.

[intermediate] challenge #2 by nottoobadguyin dailyprogrammer

[–]Marko_Oktabyr 1 point2 points ago

http://pastebin.com/EEC4MVh7

C version with pseudo-random fights, input checking and safety from buffer overflows.

This happens far too often by gimlobadyin fffffffuuuuuuuuuuuu

[–]Marko_Oktabyr 4 points5 points ago

They just want to talk about it and then discuss it.

This happens far too often by gimlobadyin fffffffuuuuuuuuuuuu

[–]Marko_Oktabyr 14 points15 points ago

Surely you can't be serious

This happens far too often by gimlobadyin fffffffuuuuuuuuuuuu

[–]Marko_Oktabyr 208 points209 points ago

I guess it was at that moment that I first realized Elaine had doubts about our relationship. And that as much as anything else led to my drinking problem.

Good probability / math party tricks? by sheppa28in math

[–]Marko_Oktabyr 0 points1 point ago

Wrong. It's a reference to a move named Wargames.

http://www.youtube.com/watch?v=NHWjlCaIrQo

Great movie. *Edit: Relevant scene is around 3:50.

IAMA Range Officer at a Boy Scout Camp AMA by shadowsoflifein IAmA

[–]Marko_Oktabyr 1 point2 points ago

Eagle scout from VA here. As mentioned, Powhatan is a great camp and is one of my favorites. Another great camp to check out (esp. the Ranger Challenge program) is Brady Saunders.

Logically Forever Alone by felix098in fffffffuuuuuuuuuuuu

[–]Marko_Oktabyr 0 points1 point ago

sorry, this has been archived and can no longer be voted on

What tba_apps had:

Ex(Ay ~L(y,x))

Logically Forever Alone by felix098in fffffffuuuuuuuuuuuu

[–]Marko_Oktabyr 1 point2 points ago

sorry, this has been archived and can no longer be voted on

You have "for all x there exists a y such that x does not love y"

tba_apps is correct. You have written that everyone has someone they don't love.

Edit: Re your other comment:

Therefore, it means that no-one in the world loves y.

False. There is nothing saying the y is the same for every x.

Emoticon War by strongscience62in funny

[–]Marko_Oktabyr 0 points1 point ago

sorry, this has been archived and can no longer be voted on

It's dangerous to go alone. Here, take this upboat.

r/math, 'This subreddit is for DISCUSSION on mathematical topics.' Please take your imgur posts elsewhere. Mods, please start removing that crap. by [deleted]in math

[–]Marko_Oktabyr 3 points4 points ago

sorry, this has been archived and can no longer be voted on

this author weighing in:

I would like to draw your attention to the top links of all time in this subreddit. Almost all of them are image posts. Some of them are interesting GIFs of mathy things or links to the awesome doodling in math class series, but a lot of them are jokes or non-pure discussion posts. People can whine all they want, but clearly r/math seems to appreciate this sort of thing.

I would like to see more discussion on here as well, but that doesn't mean that people won't also appreciate a quick joke. People wanting to discuss math will take whatever opportunity they can to do so. If the post is a math joke or pun, discussion of said topic will ensue. If it's a link to an interesting article or a self post about a problem, discussion will ensue. r/math is whatever we make out of it. If you want a discussion, start one. If you want to share a joke with people who share common interests, you should do so.

The Christopher Reeves aka. I'm going to hell drop shot by Rilithin funny

[–]Marko_Oktabyr 1 point2 points ago

sorry, this has been archived and can no longer be voted on

No, this is the going to hell drop shot:

9/11: Drop a B-52 into a Manhattan.

How do programs (like openssl) find those huge primes so quickly? by althepalin math

[–]Marko_Oktabyr 1 point2 points ago

sorry, this has been archived and can no longer be voted on

While it is true that only Mersenne numbers Mp, where p = 2, 3, 5, … could be prime, often Mp is not prime even for a prime exponent p.

The smallest counterexample is the Mersenne number M_11 = 211 − 1 = 2047 = 23 × 89.

http://en.wikipedia.org/wiki/Mersenne_prime

Hey r/math, I'm using this summer to learn a programming language. What should I learn and why? by KingOfTheMountainsin math

[–]Marko_Oktabyr 0 points1 point ago

sorry, this has been archived and can no longer be voted on

C (and by extension C++) gives you the power to do just about anything you can think of with code. The language is more susceptible to shitty code for two primary reasons:

  1. Speed. The whole premise behind C code is that correct code should execute as quickly as possible. Therefore, C does not have some features of 'safer' languages (e.g. Java) that will provide some run-time checking. For example, say you have an array (contiguous block of memory) of size 10. Accessing the array at indices 0-9 will work fine in any language, but accessing block 11 (i.e. index 10) will cause errors to be raised in languages that have array-bound checking. C, on the other hand, is more than willing to let you access data you shouldn't be for our second reason.

  2. Power. C gives you the power and flexibility (as mentioned before) to do anything you can think of with code. Given our previous example of array-bounds, you might have some incredibly clever trick that involves accessing that 11th element which you would be unable to do in languages such as Java or Python.

It is very easy to shoot yourself in the foot with C and the language is more than willing to do so.

Hey r/math, I'm using this summer to learn a programming language. What should I learn and why? by KingOfTheMountainsin math

[–]Marko_Oktabyr 2 points3 points ago

sorry, this has been archived and can no longer be voted on

Upboated for being able to disagree while providing good reasoning and ability to see both sides. My recommendation of python was primarily based on his complete lack of programming, otherwise I'd have gone with C.

Hey r/math, I'm using this summer to learn a programming language. What should I learn and why? by KingOfTheMountainsin math

[–]Marko_Oktabyr 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Wiki to the rescue: http://en.wikipedia.org/wiki/Comparison_of_programming_paradigms

Here's a quick breakdown:

Object-Oriented: You have objects which have properties and functions that can be inherited by sub-classes. For example, you might have a class for a Graph that stores a collection of Node objects. A node object might have a method for adding a neighbor. A sub-class of Graph could be a DirectedGraph which could inherit (copy from the parent class) graph methods but allow you to write code specific to that type of graph while still using code general to all graphs.

Unfortunately, I'm out of time and will edit my solution to explain other types better once I get back.

Hey r/math, I'm using this summer to learn a programming language. What should I learn and why? by KingOfTheMountainsin math

[–]Marko_Oktabyr 48 points49 points ago

sorry, this has been archived and can no longer be voted on

I'd personally recommend learning Python. It's a lot more noobie friendly than C will be and gets you in the habit of writing 'pretty' code. Using the NumPy and SciPy libraries will give you the tools you need to solve harder math problems.

C is a favorite of mine due to its speed and flexibility but it's not very friendly to beginners (pointers in particular). Fortran is also very good to use for math, but I personally don't care much for it.

Also, if you haven't heard of it yet, you should check out Project Euler. It's a collection of mathy problems that either require programming to solve or are greatly facilitated by it. I'd check out some tutorials in python and try to solve some of the problems on that site.

The Gottchas of RSA Key Generation in Python (My second post.. not wonderful but interesting none the less I think) by bodom658in programming

[–]Marko_Oktabyr 0 points1 point ago

sorry, this has been archived and can no longer be voted on

I recently finished up an undergrad course in cryptography so if you ever need a hand lemme know.

The Gottchas of RSA Key Generation in Python (My second post.. not wonderful but interesting none the less I think) by bodom658in programming

[–]Marko_Oktabyr 0 points1 point ago*

sorry, this has been archived and can no longer be voted on

While it is very good at handling absurdly large numbers, some of the numbers I was using were a little too large.

If your power function is just being used for RSA, then there is no reason to be dealing with absurdly large numbers. You can have your function take the modulus (i.e. m = pq) and reduce mod m at each step. It's faster and limits the size of numbers you are working with.

Also, using trial division for primality testing? Ouch. I'd check that it's not even (if x & 1) [and possible other small primes] and use Miller-Rabin or Solovey-Strassen to test for primality. These are probabilistic tests, but a couple rounds of these will be much faster than trial division.

Edit: modular exponentiation:

def modular_exponent(base,exponent, mod):
    n = exponent
    x = 1
    power = base % mod
    while n:
        if n & 1:
            x *= power
            x %= mod
            n -= 1
        power = (power ** 2) % mod
        n >>= 1
    return x

and Miller-Rabin:

def MillerRabin(n,k=5):
'''
Performs the Miller-Rabin primality test on n to an error bound of 4^-k 
(i.e. performs the test k times). True indicates a probable prime while a 
false result indicates a definite composite number.
Inputs:
n - Number to be tested for primality
k - Error bounding parameter
Outputs:
True if n passes k rounds of the Miller-Rabin test, False otherwise
'''
import random
def innerTest(x):
    for r in xrange(2,n-1):
        x = modular_exponent(x,2,n)
        if x == 1:
            return False
        if x == n - 1:
            return True
    return False
ks = []
d = 0
s = n-1
# Write n-1 as 2^d * s
while not s & 1:
    d += 1
    s >>= 1
while len(ks) < k:
    a = random.randint(2,n-2)
    if a in ks:
        continue
    ks.append(a)
    x = modular_exponent(a,s,n)
    if x == 1 or x == n - 1:
        continue
    if innerTest(x):
        continue
    return False
return True

Firebreak Optimization Help by Surprise_Smurfin math

[–]Marko_Oktabyr 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Upboats for continuing the puns.

As for the math, not quite. The length term you've described would be the sum of all the lengths of tree segments (i.e. the total amount of trees). However, we're only interested in what is lost in any 1 particular section of trees. Losing trees in any particular strand of trees will lose a total area of length [;\left(\frac{50}{n}-.01\right);] and width 50. However, there is also the area "lost" due to the areas of all the firebreaks which will be of total length [;0.01*n;] and also width 50. Thus, the total areas of trees lost will be the sum of these two or [;\left\(\left(\frac{50}{n}-.01\right) + 0.01*n\right\)*50;].

Firebreak Optimization Help by Surprise_Smurfin math

[–]Marko_Oktabyr 2 points3 points ago

sorry, this has been archived and can no longer be voted on

If you're stumped, we should try to examine the root of the problem. We might even have to branch out. (Sorry, couldn't help it).

Anyways, to start we should come up with a formula to describe the area of trees lost in a fire. Let us examine a 1D slice of the area because the areas involved will just be 50 times the length of any particular segment. It follows that if there are [;n;] firebreaks, then the length of any particular segment (strand + firebreak) will be [;\frac{50}{n};]. The length of the tree section contained by this segment will then be [;\frac{50}{n}-.01;]. The total length of firebreaks will obviously be .01n. So how can we combine these to obtain our answer?

view more: next