We’re going to talk about coin flipping. Lets say you got two people. You got Person A Person B, right, they’re flipping coins. Let’s say one of them is flipping coins and waiting for Heads-Heads to turn up right, so they’re going to make a sequence of coin flips, and they’re waiting for Head-Heads. Person B, he’s doing it and he’s waiting for Head-Tails. So one of them is waiting for Head-Heads, and one of them is waiting for Head-Tails. Now, what’s the probability that you’re gonna get Heads-Heads? Now even Brady would probably know this. What’s the probability you get Heads-Heads? Brady: Is it one in four? Yeah yeah exactly. So it’s one in four, and Heads-Tails it’s the same, right? It’s one in four. Even though they have equal probability I claim your average waiting time for Heads-Heads is going to be longer than for Head-Tails. Let’s do it, let’s do the experiment. Let’s not just write out mathematical formula. Let’s do it let’s go. I’m gonna flip this coin. Now this is, we’re gonna do an average. I wanna do a long sequence and we’re gonna see what the average is. So if I flip this coin, let’s say 50 times, is a nice long number. Then we’ll be able to take an average of how long we have to wait for Heads-Heads or Heads-Tails. Right, so we do this if it… actually this is gonna take me ages, isn’t it? So instead of flipping this one coin 50 times what i can do is I can flip 50 coins all at once alright which I’ve just done there, OK? The First coin is a Tails alright. Second coin is, without looking, it’s a Heads. Alright, next coin is Tails, I’m gonna a sequence like that. Not even Looking. We’ve run out of space we better do another. Let’s make them random. Right, so I poured them out, I tried not to look at them, so it should be a sequence of random coin flips. I better write out so we can see what they are a bit better. Tail…Head…Tail…Head…Tail…and a Head and a Tail and a Tail…Tail…Head…Tail Alright, we’re gonna look at this sequence and we’re gonna play the game where tossing a sequence of coins. And we’re waiting to see how many, how long we have to wait for Head-Tail. If i start here I’m looking for a Head-Tail, Oh, there it is. Right. Alright that’s my first Head-Tail there. That was a waiting time of three and then i got Head-Tail, then I start agina OK. I do a new game I’m gonna look for Head-Tail, and I had to wait one two three four, and there it is. Now i’m gonna do it again, oh look this one is straight away look Head-Tail. Now I’m gonna start again. I’m looking for Head-Tail. Ooh this is a long wait here. And then there it is Head-Tail. And Head-Tail there…there…there it is. Oh and there’s one right at the end as well. Right, what was the average waiting time. Let’s have a look at the waiting time. So that’s about an average wait of 4.5 . Lets look at the Heads-Heads though. You would have to wait, ooh how long? Ooh this is a long waiting time here. It happens all the way over here. There Heads-Heads, which was a long wait. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. So you’ve player a game and it ends when you get Head-Heads. Great, done. So now start a new game, a completely different game form this point on. So we’ll just start again, oh, but this time notice there the Heads-Heads comes up really quickly. Look at that, it’s just straight away. And now we start a new game OK. So we had a success, we’ll start a new game and we have to wait 1, 2, 3 let’s look for our average waiting time for Heads-Heads, OK. Which is 7, right. And yes, oh look, yes.You have a longer average waiting time for Heads-Heads than you do for Heads-Tails even though they have an equal probability, they’re both one quarter. Why is this? You can kind of see what that reason is from this, this sequence. Because if you noticed when we were doing it, when you play Heads-Tails you get Heads-Tails, then you start a new game and you wait for Heads-Tails, and you start a new game. Heads-Heads was slightly different, when we did it with Heads-Heads look what happened here. when you have something like this: Heads-Heads-Heads-Heads we have this overlap. And this overlap isn’t counted, we were playing it until we got Heads-Heads and then the game stopped. And then we play a new game from that point. So here we’ve got a Heads-Heads, that didn’t get counted as a Heads-Heads. So if you look at how many Heads-Heads we’ve got it should about an equal number to Heads-Tails but the overlaps don’t get counted. Let’s just check. How many Heads-Tails did we have? Actually we know we got 11, i know for a fact we got 11. How many Heads-Heads did we have, including the overlaps? One here, we have two, we have three. So if you actually count up the Heads-Heads we had 9 of them, but only 6 were included in our waiting time average. So this sequence, we were looking at what would happen for consecutive values so Head-Heads, Heads-Tails. The same sort of thing would happen with Tails-Heads and Tails-Tails. We’re look at consecutive values, in fact the reason I mentioned this is because if you remember there was that prime news where they were looking at primes, and the ending of primes for consecutive primes. This is what they were looking for, they thought if primes were random like coin flips I’m going to find this effect. What turned out to be the case is that they didn’t find this effect because the primes weren’t being random like coins. If you did this forever, if you had a sequence that went on to infinity the average waiting time then is I’ll show what that is. It’s called expectation or expected waiting time. The expected waiting time for Head-Tails is equaled to 4 Which kind of make sense when it’s a quarter probability. That does make sence. And then the expected waiting time for Heads-Heads is longer, and it’s 6. So we were close but just a little off. And if you wanted the expected waiting time for Tails-Tails, well that’s 6 as well. That’s just the same idea. Brady: Audible’s ever growing collection of books and other spoken material has now reached in the order of 250,000 titles. So no matter what what you’re interested in Audible’s bound to have multiple options for you. Now I spend a lot of time driving, as you can see here, often in the UK’s delightful traffic and there are few better ways to pass the time than listening to audiobooks. You can have something entertaining, something educational, or maybe a bit of both The choice is yours. I particularly enjoy books about mountaineering. These titles here about Mount Everest are very good. I’ll put their details in the description, along with this one about K2 which is one of my favourites as well. And that’s just a fraction the the mountaineering books on Audible. I told you they’ve got something for everyone. If you’d like to give them a try go to audible.com/numberphile and you can sign on for their free 30 day trial. That trial includes your first book and, as I said, there are plenty to choose from. that address again audible.com/numberphile so they’ll know you came from our channel, which is handy for us. and then the free trial for 30 days. Our thanks to Audible for supporting this episode of Numberphile. Maths works, maths just works, it’s wonderful that way how maths just works out Brady: Every time. Every time just how you want it to work out. Especially with the power of editing. Brady: What happened? What happened, we did out first take and we got the opposite result from what we wanted. Brady: It’s done you 48 over 11, which is the opposite of what I said. And we have to film the whole thing again, right?

It was easy to see because whenever you miss your tails after flipping heads in a heads-tails game, you just flipped heads again and you dont have to start over, so whenever you flip a tails you are done, but when you miss your second heads in a heads-heads game, you flipped tails so you have to flip heads again before you could flip your second heads.

Videos featuring Dr. Grime are always so fascinating. Another great video 🙂

If you are Rosencrantz or Guildenstern E(HH)=2

This reminds me of something I was talking about last night with a friend. We spoke of how birth control works %99.9 of the time. Which means 1 out of 1000 times it won't work. So I'm wondering what the average wait time for that 1 time out of 1000 occurrence is.

… so primes are not random?

i'm just at the start and i did some calculations … exp wait for HT = 4, exp wait for HH = 6. Am I right?

Seems related to the computerfile about floppy disks for apple 2.;

Coins travel in parabolic arcs.

At least you came clean about it, but doing experiments until the 'correct' result is reached seems a bit dodgy — sounds like pharmeceutical trials or something …

Interesting that if you divide the 42 turns by the 9 actual occurrences of HH you get 4.667, so very close to the HT's 4.5

Tails Tails wins with 11 occurrences and an average wait of 4.3.

(:

Would Numberphile like to do something about maths in film or music. I was thinking of the song Affirmative action which has abyssmal maths in it. There must be other examples.

It's a little bit wrong way to do this, becouse you are counting not just {1,2},{3,4},{5,6}…{49,50}, but also like {2,3},{4,5} ant cetera…

4:57 blah blah 9/11 joke blah blah

that makes sense because you can't have a HT where a HH is

The problem I have is even before he started looking, they had counted 20 heads and 30 tails. I dont think it guarantees more HT (because of the whole "pattern found, new game" rule), but I suspect it skews the probability. Needs a population that matches 50% of each more closely.

Hillary Clinton begs to differ.

Nice to see you driving through my hometown Bristol at the end!!

I think another reason that this effect may take place is because as soon as you get a head you've basically got it. Should you get heads and then not 'win' per say, you've got another head, until you win and get a tail, so in a way you're only waiting for that 50% flip after you get heads.

H – need tails

HH – a tails next still works

HHH – so on

HHHT – got it

Whereas with double heads the chance resets in a way when you get tails.

H – need heads

HT – resets, now need another two heads

HTH – need heads

HTHH – got it

Correct me if i'm wrong.

Very interesting, I hope you could also show the way you calculated the average waiting times.

while I watch him drive at the end of the video I keep thinking "CHANGE LANES! YOU'RE ABOUT TO CRASH HEAD ON"

Wait wait wait wait wait…. So for example… If I were to play a game, say for money, points, score, or whatever, and I had to guess the next outcome of something that is basically 50:50, and let's say I put my money on heads. It there a greater chance of heads showing up if I wait until tails were to be played 10 times in a row rather than, say 2?

Which should I bet on for heads? (picture below)

TT_?

or:

TTTTTTTTTT_?

or maybe even:

TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT_?

lol, I understand your proof but it still does not make sense.

hey, James. Great vidz. You changed the way I look at infinitesimals and limits over the course of a month in a very positive way. Thanks. please check out my math discovery on Facebook using the hash tag

perfectcompression

(not a video)

Cheers.

I want the

proofs!4:58

11/9?

9/11?

ILLUMINATI CONFIRMED.

There is NOTHING random about flipping coins. It is a controlled action. Your level of control dictates the results. Given this, his experiment is not valid and should not be considered a reliable source of information Sorry but he's still entertaining.

Ok.. the important concept here is "idealized".. We can replace coin fliping by a idealized 50/50 event.. for this situation we obtain that expect times (sorry for my english)..

+singingbanana: That's how maths works, right? If you don't get the result you want, you start over…? 😉

Nice technique to avoid flipping. Well done! I think an even better and easier way would have been to take big handfuls out at once and "interleave" them in your hands into a stack — from which you could then spread them out. There would be no possibility that way of "unintended" arranging because you wouldn't even be able to see the order.

head – tail is the same as tail – head. Therefore, there are two outcomes that meet the requirement. 2 possiblilities for each flip so the probability for 1 tail and 1 head is 2 / 4 = 50%

Is it me or is there something very intriguing about this guys facial structure

If the temperature today is zero degrees Celsius and tomorrow will be twice as cold as today. What will be the temperature tomorrow?

Tried to do this… so i am either very lucky or not lucky at all.. but… got a lot of HH… lots…

Wow The final solution is very unintuitive, much like the Monty Hall problem. Fantastic!

it is a somewhat ill-defined problem. The search should restart after the first coin-flip, not the last – then all the overlaps get counted and it works for sequences of any length.

Awesome video!! I laughed a lot at the end! hyhyhyhyhyhyhyhy

Isn't heads tails more likely than heads heads in part because you started out with more tails than heads in this particular set? You had 30 tails and 20 heads. That is 1.5 tails for every head.

you can tell me something that can blow my mind in a million pieces but can solve a rubix cube like I can?

@00:25 "Even brody would probably know this" How condescending.

Dr Grime Can you do one on the Multiple-Base Number System?

Could you guys explain why if I had a bag of counters(9 red 1blue) and I pulled one out and put it back then obviously I'm more likely to get red, however if I were to do this lets say 1,000,000 times and I happen to get red every time then technically that is more likely (because there's a 9/10 chance each turn) to happen but at the same time not likely to happen because eventually you'd expect to pull out a blue one (I'm confused because the probability every turn never changes but over the course of 1,000,000 turns does it get more and more likely that I would pull out a blue counter?)

i'll have that paper and hang it on my wall – with the 50 coins glued to it, please.

Has anyone offered this dude a mainstream TV show yet? He'd be awesome!

I just saw your video "Fibonacci Mystery" talking about the reminders and such.

I would love to see the Math guy talk about Fibonacci if we were using "Base 12 " (dozenal) instead of our normal decimal one.

Dou dou dou dou

I know a similar problem to this:

If one person bets for HH to come first and the other person for TH, then TH will win in 75% of the games.

But with HH vs HT, both are 50% to appear first!

So I was playing with primes earlier, specifically prime factors of 2 consecutive numbers. I was looking for two consecutive numbers who had all the previous prime numbers in their factors. ergo 2×3, 5×6, 14,15 etc

naturally the numbers got exponentially larger. while I was calculating for 2x3x5x7x11x13 I came across 714×715 which has only the singular factors up to 13 AND 17. did I miss a set? is there a formula to calculate two consecutive numbers and their primes without doing it trial by error?

so u faked the whole video?

His Thesis: https://arxiv.org/pdf/0708.1109.pdf

What utter rot. Heads will follow tails as often as tails will follow heads.If there is an equal chance of the same or different outcome, the subsequent outcome is 1/2. You can't say that the chance of winning is 1/3 and the chance of losing is 2/3 so the chance of neither is 2/3 – 1/3 = 1/3.

The weight of the coins is not symmetrical. The coins are heavier on one side.

I watch numberphile to go to sleep. I don't know If that's a compliment because I watch them all the time, or more of an insult because they put me to sleep.

Is it always 1.5 x 2^(number of coins) for consecutive coins? So E(HHH) would be 12, E(HHHH) would be 24, etc.?

I feel like there's a simpler way to understand this. If you are going for HT, then as soon as you flip a heads, you've basically won. You have a 50% chance of winning, but if you lose, you still have another heads. You're back to a 50% chance of winning. With HT, once you get a heads, EVERY flip is a possible winning flip. With HH, this isn't the case. If you flip a heads, then you have a 50% chance of winning. If you lose, there's a ZERO percent chance of winning the next flip. With HH, only SOME of the flips are winning flips. And if you look at the Expected waits, you can see that "some" is about 2/3.

Why would you mention the prime sequence? The coin toss effect happens because the described outcomes are not independent of prior tosses. Primes are independent of prior primes, are they not? Without knowing the distribution of primes how would this approach help?

How did you calculate the expectations at the end? I'm guessing the wait times are modeled after an exponential distribution, but I"m curious how you got lambda = 6 for HH.

Are players playing entirely independent games? Because if you say that either condition wins, stops the game for both players, then a new game starts for both players, you get a different result with this example.

So we're betting, I take HH and you take HT, and if EITHER comes up, the game is over and resets with the next sequence being a new game for both players and sequences. In that condition, you get the following:

HT – win in 7, HT – 2, HH – 6, HH – 2, HH – 3, HH – 2, HT – 6, HH – 3, HT – 4, HT -2 , HH – 5, HT – 2, and HT – 6.

HT wins 7 times, HH wins 6.

The average waiting time for HT is 7+2+6+4+2+2+6 = 29. And 29/7 = 4.14

The average waiting time for HH is 6+2+3+2+3+5 = 21. And 21/6 = 3.5

Just like you couldn't count the overlapping HH's in the way you played it, here you can't count the HTs where the H is the second in an HH series (which knocks out 4 of the HTs). In this example, as a unified game, HH comes up slightly less often, but faster when it does.

So every time you flip a heads you have a 50% chance to get the head-tails combo on the next flip but it's less than 50% chance to get heads-heads on on the next flip from any particular heads since the previous coin might have just been a heads and you reset the the game.

But… if I and a pal sit down and the game is to see whose pattern appears first, either heads-heads or heads-tails, it's an equal shot for each of us as to which one comes out first.

S1 : last one is tail or first time toss

S2: last one is head

first start with S1 S1 has 1/2 chance to go S2 and 1/2 chance to go S1

Expected toss form S1 is

S1 = 0.5 S1 + 0.5 S2 + 1 <- 1 toss to change state

for HT S2 = 0.5 S2 + 1

S2 = 2

S1 = 4

for HH S2 = 0.5 S1 + 1

S2 = 4

S1 = 6

If anyone wants a clue as to how to solve E( waiting time for HH) using the definition. Here it is: Fibonacci sequence!

60% tails? #RiggedCoinFlip

Nonsense

I mean, in a way, the primes do act in this way. Coins don't "like" to repeat themselves in a sense that you don't count all of the HH or TT's and primes don't like to repeat themselves on average.

feeling the ballbag for the first time 1:24

The fact the coins didn't fall for your little game the first time is an example of probablility. Just because something is more likely doesn't mean it will happen. But you guys are waaay too smart and already know that.

someone in the past rolled only heads, now it's balancing

someone in the past rolled only heads, now it's balancing

James Grime is awesome. I always look forward to his videos.

LOL at the end …. Props in this guy on doing maths both entertaining and funny

And Rosencrantz and Guildenstern begin their debate…..

how many times did he say heads

Since he is talking about the probability being one quarter I cant help but think that this entire video would have been a lot funnier had he used quarters for this.

1/4 is assuming both sides have the exact same properties… which they dont

i live in germany and the driving part at the end made me confused bc we overtake on the left lol

mischievous!!

Love this math ninja!!!

I think you are missing something here. If you flip the coin 10 times, you can get a max of 5 HT. You can, however, get a max of 9 HH when counting the overlaps. Without overlaps, the chance of getting HH and HT are the same.

Like #6,666

BUT WHYYYYYY ??????

Pause the video at exactly 1:25 and laugh.

watch till the end

this is occult

Ignored here is the possibility of a coin landing to rest on the edge, which is a real possibility on a truly flat floor.

So it's a Laplace experiment.

There are 4 ways to flip 2 coins.

Leaving you with a 8 digit sequence of like

TTTHHTHH…. And there are a set number of permutations for this 8 digit sequence with 4of each.

And to get to the 6 wait time you need to take the probability of HH (0.25) and multiply it by the joint probability of THHH and HHHH and also subtract HH again.

Depends on the coin

Coins are unbalanced

Please, Make video on "Negative Probability".

He mentioned prime numbers and 4 and 6 but didn't mention that prime numbers conform to 4x + or – 1 and 6x + or – 1.

I have made programm which does the same. It calculates medium values. I can declare that this video – true.

After 1000 elements programm shows only 4 and 6. If you input big numbers (9999), you can see that Probability seeks for 4 and 6:

Enter Size of Array: 99999

Enter Size of Array: 99999

HT: 24947 //HT counter

HH: 16624 //HH counter

HT_RESULT: 4.00838 //Medium values

HH_RESULT: 6.00522

(Sorry if my English is bad – I am from Russia)

why didnt you count the 2nd heads heads?

Dude I just made Siri flip a coin and got heads 11 times in a row and it made me think of this video and mat Parker's video on the same topic. I screenshotted all of it

Its a stochastic process !

ahhh, but you had 30 tails.

Thanks to all who explained the 4 and 6, got it. But, this same series of flips yield a much different result if you had chosen TT instead of HH, so….? Just would've needed more flips to get to the proper average?

How did he calculate those expected values?

If E(HT) = 4 "because the probability is 1/4" then why is E(HH)=6? Is the probability of HH not 1/4 also?

You always have that Rubik’s cube in the back. I love Rubik’s cubes.

I would love to know the answer to this question.

Are the odds of getting the combination you have there the same as the odds as getting all heads or all tails?

I once had a dime (10 cents) that alternated hththththththt for around 30 times. What are the odds of that James?

This is flipping bad