Frequency stability property short film | Computer Science | Khan Academy

Frequency stability property short film | Computer Science | Khan Academy

[TYPING] Consider the following. Imagine two rooms. [DOOR CLOSING] [DOOR CLOSING] Inside each room is a switch. [CLICK] [CLICK] In one room, there is a man
who flips his switch according to a coin flip. If he lands heads,
the switch is on. If he lands tails,
the switch is off. In the other room, a
woman switches her light based on a blind guess. She tries to simulate
randomness without a coin. Then we start a clock, and they
make their switches in unison. [CLICK] [CLICK] [CLICK] [CLICK] Can you determine
which light bulb is being switched
by a coin flip? [CLICK] [CLICK] [CLICK] [CLICK] The answer is yes, but how? [CLICK] [CLICK] [CLICK] And the trick is to think about
properties of each sequence rather than looking for
any specific patterns. For example, first,
we may try to count the number of 1’s and 0’s
which occur in each sequence. This is close, but
not enough since they will both seem fairly even. The answer is to count sequences
of numbers, such as runs of three consecutive switches. A true random sequence
will be equally likely to contain every
sequence of any length. This is called the
frequency stability property and is demonstrated
by this uniform graph. The forgery is now obvious. Humans favor certain sequences
when they make guesses, resulting in uneven patterns
such as we see here. One reason this
happens is because we make the mistake of
thinking certain outcomes are less random than others. But realize, there is no
such thing as a lucky number. There is no such thing
as a lucky sequence. If we flip a coin
10 times, it is equally likely to come
up all heads, all tails, or any other sequence
you can think of. [CLICK] [CRICKETS CHIRPING]

95 thoughts on “Frequency stability property short film | Computer Science | Khan Academy”

  1. This is really well done! If I had seen this on paper, I wouldn't have understood at all. But in two minutes, I feel like you've explained in fairly simple terms a very complicated idea!

  2. "if we flip a coin 10x it is equally likely to come up all heads, all tails or any other sequence you can think off". I had to think about that a little bit, given that the only thing I remember about statistics is the coin toss homework, 50% heads, 50% tails. So the probability of getting any one pattern in a 10x sequence of coin tosses is 1:1024, right? or is it 1:1023?

  3. @sachinabey Good question, you can use any length of sequence – 3 is just convenient. The graph gets very large with longer sequences since the number of combinations explodes.

  4. really cool—the soviets used to generate code sheets by typing random letters on a typewriter—but their typists were not really typing randomly, they often just alternated hands—if plain text is coded using a random, non-repeating key, it is impossible to break—but if the key is not random (or cycles), then longer texts are vulnerable to crypt-analysis—i would love to know how non-randomness and/or cycles can compromise a cypher-text—please ♥

  5. So it shows human nature is to favor certain patterns. Would a person who has seen this video be able to have a better chance at pretending to be random and thus not get caught ?

    Example, in terms of trying to be random as a competition, you can play Rock, Paper, Scissors against an advanced Computer Algorithm. I have done very well against the computer by not thinking about what i'm gonna throw.

  6. Well, a sequence of all 1s is just as likely as any other sequence. Still when you are just looking at it as outcomes of 1s and 0s instead of the sequence, it seems it would be unlikely for the sequence to contain only 1s or 0s compared to the odds of having half of them being 1s and half being 0s. Which seems to contradict the statement about the sequence.

    All of which makes the video much more interesting since it does not contradict the statement . The difference is just the perspective.

  7. @kbponline If you think you understand this from a two minute video, think twice. This is actually much more complicated than that.

  8. I've heard there's a Zen practice that involves placing ink dots on a paper in truly random positions–and practitioners claim it's virtually impossible for the "unenlightened" to accomplish.

  9. i love that it's an actual video of something. I understand something in 2 minutes way better. Thanks. awesome presentation

  10. hello the $ ? is. All man are not created equal, so can they crate similar sequences or each individual will differ in their randomness

  11. Wrong, not every sequence is equally likely to occur. Or to be more precise, in 3 flips of a coin, every combination of heads and tails is equally likely, but in a large amount of flips, the odds of getting a specific sequence of length 3 depends on the sequence.

  12. I really liked this presentation. It's visually stimulating and thought provoking…it draws me in and I want to see more!!!!!

  13. So if you were able to have an empty mind and told it to perform such a
    task at random.

    Would it stick to the mathematical randomness, or would it still have a bias on some patterns despite the fact that there are no thoughts in it's mind about patterns and what is, or isn't random?

  14. A similar presentation was made in a probability class at Berkeley, with a different twist on the numerical trends. If interested, see the Radiolab archives & search for their episode on stochasiticity…

  15. Ricardo C. {authmaax}

    the physical act (of using the body to flip a coin) is also programmed but is stable because it is a physical expression without any conscious mind envolved

    the conscious mind is not stable and does not produce stability
    not even by impersonating randomness

  16. @Kevill Random is a hypothetical concept. A construct of human imagination. I find it illogical. You're making a good point. A computer is like an unbiased mind and it can't be told to do something at random. It needs data. Just like every other event in the universe. Cause and effect.

  17. @Theomacho so what's your point? If you can't predict it, it might as well be random. By the way, random variables can have a distribution that is non-uniform and there are ways to get very close to "perfectly" random.

  18. @calbear2006
    Thanks dude, i am learning electronics and telecommunications so i really need to understand these concepts, can you maybe give some other usefull links like radiolab?

  19. @kbponline It's because videos and graphics convey much more information than the text do, and you use both ur eyes and ears to process these information.That's why videos seem more "meaningful" thatn text.

  20. @viorel22cr Yes this property is taken into account when measuring the 'quality' of pseudorandomness (machine generated).

  21. Okay. Back to the video instead of praising khan academy, I'm sure it just wants to know how people feel of the video. Phrases such as "omg this video portrays things soooooo much cooler!" are so cliche. Get to the point.

    I completely agree with this video. I don't think truly random numbers are possible.

  22. thanks for your answer, but here is something extra, how is this true in relationship with time? I mean if you count sequences from time zero to time finish this property can apply , because you can count all possible combinations, but what about if you only count sequences in one hour? or two hours, and the light switches are spaced 5 minutes apart. I am working on such a problem and I'm searching for a solution. Thanks

  23. Fascinating. I wanted to test this so I wrote a quick c++ program to run the simulation. I seeded srand with the system time and used modulus 2 to get a fairly random 0 or 1. A set of if statements checked to see which octal sequence showed up and counted them. I set it all up in a for loop to repeat 80,000,000 times.

    I ran the program several times and the highest standard deviation I got was 4142. The lowest was 41. Those are really low deviations for 80mil random octal groupings.

  24. My teacher did this where he asked some people in the class to truly flip a coin and write what they got and others to make up random sequences. He guessed who did what correctly each time by seeing if there were sequences of 6 heads or 6 tails in a row and determined this to be actual coin flipping. Really fascinating stuff.

  25. Khan Academy Labs

    Very good (and deep) question… I'll have an interactive exercise soon where you can experiment with this a bit more.

  26. At first I thought I just clicked on this video randomly. Now I realize I favored certain sequences in youtube videos.
    *switch off light*

  27. Most coins have indentations, by feeling the top of the indentation you can feel which coin you got. For example, heads will have a smooth center with a penny, whilst it shall be bumpy with tails.

  28. what about logic? if the woman flips the switch, she would have to go the opposite way because you can't flip a switch twice in a row, while still turning the light on or off?

  29. Anyone else think this is a bad example? The switch moves up and down and only has 2 options ON and OFF if you turn the switch ON how are you supposed to turn it ON again? The only other option after turning it ON is to turn it OFF… therefore the pattern has to be ON-OFF-ON-OFF-ON-OFF…etc.

  30. If you get heads twice, you simply leave the light on for two steps(1, 1), if you get tails twice you leave it off (0,0). Notice it's being sampled according to a clock tick.

  31. We can't even try to be random, nor computers! Actually the ability to build a random number with a computer is a very complex algorithm which is widely used in security protocols and encryptions. :O

  32. I always wondered if humans could generate something truly random. I wonder if you could train someone to be random.

  33. you can make a truly random number generator if you had a dice with n side and each side has equal weight and equal chance of landing on a given face and land on a flat surface then you have a machine that reads the face facing up however it is impossible to make a dice that has equal sides and equal weight distribution because some sort of gravity is pushing the dice in unequal forces and perfectly flat surface is impossible because of gravity, nuclear forces, electromagnetism

  34. Two questions: 1. should the window sequence overlap or not? 2. why window size of 3 was choosen? Complete question is here

  35. As mentioned, the forged one is the one with uneven frequency of different sequences (the top one) and a truly random is supposedly contains an equal number of different sequences, though it is difficult to believe..

  36. Author asks, can you determine which light bulb switched by flipping coin and then says answer is YES, but I followed both light bulbs and cannot figure it out, can somebody answer this question thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *