Check out www.kiwico.com/Numberphile and get 50% off your first month of any subscription. (Sponsor) Extra footage from the making of this video (including Brady trying to roll 50 points and his game against the online Pig Player): th-cam.com/video/zD9-V9Idbug/w-d-xo.html More Ben Sparks on Numberphile: bit.ly/Sparks_Playlist
So I tried simulating this from a different perspective and the results seem odd, does anyone feel like confirming? I ran a simulation to test what was the most common total you'd get before you rolled a one. As if a player was never banking and just seeing what total they got up to before losing. The most common value I got was 6, which seems low to me, particularly when compared to the data in the video.
@@JmanNo42 While scrolling down looking for you code, I found a different comment that explained what was causing me confusion. The most common result is 6 as I thought, but the average result is much higher.
Make a Ball having a radius of 3 cm, make a circle on its surface with a radius of 1 cm How many circles fit in before the two circles intersect one another
@@ekkehard8 Except it isn't 20 all along... Didn't you see the bit where the optimal target number changes up or down depending on how far behind you are and what your total is?
I remember playing this game as a child and for some reason, my younger brother had what he thought was an invincible strategy called "captain cautious" where he would always bank his points and pass to the next player after one throw, even if that throw had only yielded him one point. Sometimes, to emphasise the point, he would declare, "I'm captain cautious". I don't think he ever won a game...
@Peter Müller That made me laugh. What makes me upset is Kiwico imposed an age limit of 104! This old man is 106 years old! Kiwico, what are ye doing concerning your age limit?
If I had been taught mathematics by someone like this rather than buy a football coach with minimal knowledge of mathematical concepts I might actually enjoy math rather than loathe it. a mathematics teacher should be engaging, animated, and able to keep a student's interest. Usually those kinds of teachers are involved in other subjects like literature or art which creates the wrong impression of what studying mathematics can actually be.a
@@Epoch11 Maths teaching is at the lower end of what a mathematician can earn, it's not the same way for other disciplines. It's also harder to make things like quadratic equations or logarithms engaging or relevant whereas an English teacher can talk about literary devices like foreshadowing or dramatic irony and show TV shows that use it. Maths just has lots of awkward little obstacles in the teaching of it, even more than things like physics which are heavily underpinned by maths. I don't disagree with your point, and I think it's something that maths teachers need to consider, I'm just trying to highlight some of the advantages that other subjects have
I will not lie: If the video was just them playing the game for half an hour I would still have watched it Also I love how Brady played extremely conservative and still lost hard
I think in terms of player psychology, many people would fail to realize that it only matters what number you're on, not how you got there. For example, if you got to 10 by rolling 2 five times, I think many people would bank it, because they feel they're "due for a 1", but they would keep going if they got to the same result with fewer rolls.
Those first two columns are the same because you can't aim for a score of 1. If you hit 1 you loose and get 0. Therefore aiming for 1 is essentially the same as aiming for 2.
Also, there are only two results for any strategy that aims for a 1 or a 2: Either they roll a 1, or they score points. Thus, the only score it is possible to make for either aiming for 1 or 2 points is the average of any single roll, which the average of 2 through 5 multiplied by the 5/6 probability of rolling any of those values. As covered in the video, it comes out to about 3.3, and that's why both 1 and 2 not just share a value, but also why that is the specific value they share.
@@israhm8621 could you consider I to be rational though? I would not say you can possibly write it as a ratio of two whole numbers, unless you say i itself is a whole number.
Or rather they are both the same stragegy of never rolling more than once per turn. Because if they get 2 or higher, they will always bank as they reached or exceeded their goal, if they get 1 their turn ends. So there is no difference between aiming for 1 and aiming for 2.
Actually, using dynamic programming, you can calculate the average result, when you aim on 20 pretty quickly. A lot of cases collapse (like 2+3 = 3+2), so running calculations on 'aim to 20' strategy would be about 6*20 operations (there are 20 different states, you can be until you get 20 and 6 ways you can go)
I used to work in schools and would play this with 5-year-olds to teach them the importance of knowing when you're ahead and calculating odds, but never thought I'd see someone calculate the ACTUAL odds!! mind is absolutely blown, my fave Numberphile video in a long while!
I had a further maths class that liked playing it until the day one lad was loosing 99-0 on his birthday and got to 100 in one turn to win. After that, no game was as exciting!
@@MrDeepbluec Using the roll estimate for such a comeback, the chance of making such a comeback on a given turn in that situation would be (5/6)^25, or about 1.048%. Given the 1/6 possibility of your opponent just rolling 1 straight off and never seeing that last point, the full chance of this comeback should be about 7/6 of that figure, or 1.223%. Neither of these are quite exact values. Breaking down the entire score tree, according to the video, is computationally too strenuous for us to figure exactly right now all the way out at 100 points.
Haven't seen Pass The Pigs since I played with my grandad like 25 years ago! Super nostalgia. Still remember I threw two leaning gowlers and we studied them for like 5 minutes cos we couldnt believe it.
I have the game because my grandpa was cleaning and giving away his old things, and I had fond memories of playing that game at their hous as a child, so I claimed it.
This is a game I've played and analysed in my job at a science centre! I did the score strat expected value calc a slightly different way, in that I phrased it as "you have a 1 in 6 chance of rolling -n", but got that same optimal score of 20 out. Fascinating to see the extended thinking around the psychology of competitive play, though.
Here's something to consider: in a winner-takes-all game with many players, it might be advantageous to play a strategy that has a lower AVERAGE score, but has a small probability of scoring spectacularly high. That's because the payoff of finishing in first place is far more than the payoff of scoring in second place. This might explain the evolutionary pressure for risky behavior in an environment with competitive mate selection.
Interesting.. an additional variable, similar to F1 Grand Prix points scoring. Your suggestion would explain the otherwise puzzling risk taking of teens..
Aiming for 20 is similar to aiming for 5 rolls, when assuming an average roll of 4, so the roll and score strategies do give a similar result. As for why 1 and 2 are equal, it's because you can't end a game on 1 point, you need at least 2 points to end a game (because 1 sets you to 0). So if you will bank after at least 1 point, you'll be banking at the same time that you would when banking when you have at least 2 points, which would be every turn that isn't 1.
I prefer thinking it as 1/6 of losing your current score (let's call it x) and 5/6 of adding 4. So you roll until (-1/6)x+(5/6)*4=0 which gives x=20. Truly a great video this one. P.S. Hi to all of those watching it in 2024
Another way of looking at it: If you're on 20 six times, and get evenly distributed results, one of those times you'll roll a 1 and lose 20 points. The other 5 times, you'll get 2+3+4+5+6 points, for a total of 20. Rolling when you're on 20 you'd expect to net 0 points.
whoa, we commented really similarly. guess we have similar instincts! "instinct tells me that banking on 20 is ideally safe for the 5/6 chance of rolling 4 on average"
@@taiyibureau9963 until now i thought instinct and intuition were similar, but now i see how different they can be. however, my idea was that a quick calculation is based off instinct without much thought
I played the original game with the die in primary school a couple of times in maths. We'd play it with the whole class, everyone would stand up at the start and then the teacher would roll the die and we'd write down numbers until we decided to sit down. We'd then keep our score. If the teacher rolled a 1 everyone standing up would be out and everyone else would add up their scores and whoever had the highest would win. It was a lot of fun.
Computing the expectation of the score based strategies isn't as hard as stated in the video: let p_n be the probability of at some point seeing a score of n in the game (with no stopping). Then p_0 = 1, p_k = 0, k
In World of Warcraft there is an item call that you can craft called Card of Omens. You can flip the card over and get a random amount of gold from 0.1 gold to 5000 gold. I did a similar expected value calculation on the expected value of any given card, and it came out to around 2.5 gold per card. This meant that it was always worth it to buy the card for less than that from another player. It was counter intuitive though because it seems like the card should be worth less if you don't flip thousands of them at a time. I probably still have a giant spreadsheet of me recording several thousand flips to manually calculate the expected value because there was no way to find the chances of getting different amounts of gold
Expected value in points isn't use in the game. Suppose a game where both players usually end with around 500 points. Now add an item that has a one in a million chance of giving you a billion points. This item is basically useless at helping you win. I wouldn't pay 1 point for it.
@@phoquenahol7245 The usefulness of a card in a game is not equal to it's "expected value" in points. (assuming your goal is to maximize the chance of winning the game) A billion points isn't worth significantly more than a thousand points if 1000 points is already enough to ensure victory.
@@donaldhobson8873 in the game in question, World of Warcraft, money isn't directly usable to win. It helps, and it also allows you to get things that you can show off to other players, but more gold is better pretty much until you have enough that the game breaks (and that's its own bragging rights... social dynamics make analysis more complicated usually but here it's the opposite.)
Did they change the "Makin' Bacon" graphic? I had this game as a kid in the 80s and I remember the graphic being a little more illustrative of porcine reproduction.
I just love the videos with Ben. He seems like a super great guy, and has my kind of humor and work ethics and curiosity and he even seems like a genuine Numberphile fan!
@@Filipnalepa “Scientists have calculated that the chances of something so patently absurd actually existing are millions to one. But magicians have calculated that million-to-one chances crop up nine times out of ten.” - Terry Pratchett, Mort
a 30 minute video featuring Ben is the perfect thing to cap off my day :) I think i've seen every single one of Ben's videos multiple times, so this'll make a fine addition to the collection
You can find exact expectation value using Markov chain methods. It yields system of linear equations over expectation values. For target 20 this leads to answer 492303203/60466176. Funny fact, for target score 21 answer is the same. You can notice that each equation depends only on next unknown, so it can be solved by derivations backwards, which doesn't require any fancy algorithms for solving general linear equations.
@@jennasmith7766 Congratulations. Then you had to add 18365 cases in total, with their corresponding probabilities which doesn't depend on score but on number of turns. On the other hand, Markov chain method gives you answer within approximately 20*5 = 100 multiplications and summations.
I dont know how nobody mentiond it, but there is a very easy way to get the result of 20. assuming your turn score is x: there is 1/6 chance you will lose your score, and 5/6 chance you will get (in average) 4 so solve -x/6 + 4 * 5/6 = 0 that's when the risk and reward cancel each other -x/6 = -20/6 -x = -20 x = 20
This game actually has me really inspired; if you have a reasonable collection of dice, there's so many interesting variations you can try -possibly a version where you roll 2d6, maybe you have the option of rolling 2d6 *or* 1d12, with whatever number of possible loss conditions
You could even divorce the loss condition from the die roll itself by making the loss condition a score of a certain multiple of something. For example, using 1d6 the loss condition could be your current turns total being a multiple of 6. It's still a 1:6 chance of failing out but it's not tied to any specific roll. Or, if rolling 2d6 you lose if you roll doubles. Still a 1:6 chance of failure
Another option would be to roll N d6s and you choose N but you only get one roll per turn, and you score 0 if any of them are 1, otherwise you score the total. This makes the game a bit simpler, because "roll N times" is the only possible strategy, although you can still choose N based on the current scores.
22:26 Well, those two bars at the beginning end to be the same because it *is* the same if you either aim for 1 or for 2 because you can't score a 1 but a _minimum_ of a 2
One thing (this comes from Farkle) that can make any game like this interesting is if you allow all the players one "catch up" round to beat the winners. This creates extra tension and decision making for two reasons. If the threshold is 100 and you're at 101, in the normal game you win. In the "catch up" variation you're incentivised to keep going to augment your lead. Also if you bank at say 115 points, then the other player now gets one intense turn of trying to catch up with you at all costs.
A simple way to think of it is 24*5/6=20 Basically, once you have 20, more rolls does not increase your expected score Because you expect to get 4 more but you also will get 0 1/6 times
You mentioned the value wouldn't be intuitive, but 20 was exactly what i was thinking based on the risk:reward ratio. When you are on 20 points, you have a 5/6 chance to get an average of 4 points and a 1/6 chance to get -20 points which balance to 0 making it the swing-number. You said n
The strategy I came up with at the start if the video (for playing against another player) is take any chance you get (aka them rolling a 1) to get to 20 more than them. At that point, they will have to make more and more risky moves to catch up to you, so will get more 1s. When that happens roll a twice. You'll slightly increase your lead, by about 6, meaning they will have to risk more, and it cycles
What fascinates me is that I probably will never ever play this game for a cumulative time of 30 minutes, yet I just watched this entire video and crave to know more about the paper
The most efficient way to compute the expected value of a score-targeting strategy is using a dynamic programming algorithm. Let E(n, m) be the expected value of targeting a score of n given that your score is currently m. Then E(n, m) = m in the case that m >= n, and (1/6)*(E(n, m+2) + E(n, m+3) + E(n, m+4) + E(n, m+5) + E(n, m+6)) in the case that m < n. If you start from E(20, 19) and work backwards to compute E(20, 18), E(20, 17), ... all the way to E(20, 0) then you exactly get the expected value of targeting a score of 20. That entire computation is equivalent to repeatedly multiplying a certain vector by a certain matrix, leading to the following one-liner in python (using numpy): f = lambda n: (np.matrix([[0,1/6,1/6,1/6,1/6,1/6],[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,1,0,0],[0,0,0,0,1,0]])**n).dot(range(n,n+6))[0,0] Some results: {16: 7.951606200464866, 17: 8.031577257341358, 18: 8.088571236917641, 19: 8.124622367387675, 20: 8.14179489372703, 21: 8.141794893727027, 22: 8.125963122479138, 23: 8.095693895781407, 24: 8.05237055222043}
If the goal is to get to 100 points on your own as quickly as possible, wouldn't it be better to aim for 19 instead? If you aim for 20, you'll get a bit on top most of the times. Aiming for 19 will probably still give you at least 20 on average if you don't bust, but it will be safer than 20. I'll write a quick code to test it. Edit: Here are the coding results. - Going for 20 each throw (or 100-current_score, whatever is lower), I got 12.626922 turns on average over a million games. - Going for 19 each throw (or 100-current_score) is 12.634359 turns, which is a little worse. Apparently, too many games don't have enough points after banking 5 games. - My third try was to go for 19, but after four banks, always go for 100-current_score to go for the home stretch (for instance, if you only got 4*19 = 75, you'd go for the full 25). This gives us 12.557203 on average. A slight improvement. -There might be some more interesting tactics. Like, once you got one 19, bank it, but then go for 20s up to that point. This gives: 12.568827
I was pondering similar strategies, like you said the goal isn't the highest average it is the first past 100. Does it make sense to go for 25? That's the first number where you are guaranteed to make it in four successful rolls. If you stop at 20 you can only succeed in four rolls by getting a six after landing on nineteen four times in a row. What's the lowest number between 20 and 25 gives you a better than average chance of making it in four successful rolls? It seems the game is weighted toward the stop at 20 strategy since that is the first number guaranteeing a five roll victory and also has the highest average return but what if we played to 125? Does shooting for something a little higher make a difference then? I also wondered about the advantage of going first, you could stop at something as low as 14 and still be likely to win shooting for 20's after that. How many points should we spot player two to make it fair? My instinct says five-ish but I can't prove it. Lastly, what if you have more players? How do you account for the extra competition? If you have an infinite number of players the only way to win would be to go for broke because somebody would inevitably do it before your second turn. Three players is a subtler problem then I can intuit. This has been the best Numberphile for me in ages, I had plenty of new questions after the ones in the video were solved. I was preoccupied for my whole dog walk after watching this.
I really enjoyed the journey in the episode from simple to complex analyses of the same problem. Its a great structure for feeling like you've learned something.
Coded this in python at the start of the video, just for the fun of it, and can confirm that aiming for 20 points is the most optimal. although, just doing 5 rolls I found an average of around 8 points per turn, and aiming for 20 points you get around 8.15 points per turn. So its interesting that even though it seems like the points strategy should be much better than the roll strategy they aren't actually that far off from each other.
Interesting episode. I wonder if that 3D chart would become less jagged if we were to increase both the number of die sides and the total score. Or if its jaggedness is not an artefact of the discrete nature of the data, but something intrinsic to this type of problem.
A third way to land on 20 as the magic number is to look at the average turn for a "psychic" player - if you roll a very large number of times, and "magically" bank just before rolling a 1 every time, half your turns will score 0, and the other half will, on average, score 20. The two ways of arriving at 20 given in the video being that the optimal number of rolls is 5 rolls, with an expected score of 4 per roll; and that 20 is the break-even point where the loss from rolling a 1 is 5 times the gain from rolling anything else.
@@lucromel It's easy to see from a purely theoretical perspective too. If you roll say six million times, then on average you'd get each number one million times. Rolling a million 1s means having a million scoring turns (strictly speaking, a million and one scoring turns most of the time, and occasionally one less than a million scoring turns, depending on whether the first and last rolls are 1s or not, but that's an error of less than one in a million, and gets even smaller if you increase the number of rolls). Across those million scoring turns, you have the points from a million 2s, a million 3s, a million 4s, a million 5s and a million 6s, which comes to twenty million points in total, so, for this impossibly perfect player, the average score per scoring turn is twenty points, and average score per turn is ten points. Which also makes strategies scoring an average seven-eight points per turn without knowing when the 1s will come pretty impressive.
My strategy was always "Keep rolling until I hit a 6" - that way there's two "outs" - rolling a 1, or rolling a 6. One gets you bank, one gets you bust. But I haven't played it since I was, like, 12.
Interesting! It seems like an appealing idea, but I think it runs into the same argument that proves the "roll N rolls" strategy isn't optimal. If you've rolled and gotten to a total of some number, why would the expected value of rolling again depend on whether you rolled a 6 or a non-6 to get to that total? And if the expected value doesn't depend on that, why should the strategy depend on it? The thing that makes this particularly interesting is that there are games where the ideal strategy is not to make some fixed decision, but to make a random weighted choice between two decisions -- and, since the "did I get here by rolling a 6?" question is effectively a way of making a random weighted choice, maybe this is a game where a random weighted choice is better? I expect there is an obvious game-theory reason why a fixed choice is better, but I don't immediately know what it is, so ... maybe?
I used an actual spreadsheet. The important insight is that the strategy "stop at N+1" resembles the strategy "stop at N," except the probability of scoring N is reduced to zero and split six ways between scoring 0 and scoring from N+2 to N+6. (Also, in "stop at N," the maximum number of rolls to reach N is the same as to reach N+5: one more than to reach N-1, the largest score where you keep rolling. But I didn't need the number of sequences.) Stop on 20 or 21: 8.141794894 22: 8.125963122 23: 8.095693896 24: 8.052370552 25: 7.997181681 26: 7.931182634 27: 7.855359085 28: 7.770887138 29: 7.67860712 30: 7.579392889
It'd be neat to see this graphed for a wheel instead of a dice. Your points scored is the number of degrees * 6 / 360, with 1/6th of the wheel being the failure outcome wherein you lose all your unbanked points. It might be nice to see more detail in that 3-D graph - is it smooth or some kind of weird fractal? Does that 45 degree flap stretch out and become extremely thin?
Oh my gosh I never considered actually trying to calculate the probabilities of this game I've had for over a decade! Really brings back childhood memories
@Numberphile there's another way to reach the number 20 which might be easier to grasp: If you currently have N points, the expected points of the next roll is -N/6 + 2/6+3/6+4/6+5/6+6/6 = -N/6 + 20/6 = (20-N)/6, which means that for N < 20 you'll win points on the next roll, on N = 20 you will stay the same if you roll one more time, and on N > 20 you will lose points if you roll (on average, of course).
Is this just another way of showing how evolution works and that our intuition is linked to perceiving probability well? When you talked through the 3D graph and mentioned the « human » strategy explaining it, it really jumped at me! A very pleasant 30min! Thanks guys 😊
Couldnt you also compare strategies by calculating the probability of winning with optimal play vs someone who always stops at 20 or after 3 rolls? That would be interesting :)
In university I took an artificial intelligence course, and one of the projects was to write a robot to play in a rock paper scissors competition. You can play randomly of course, but if you assume that some of the other players are playing with a non-random strategy then the best strategy is to come up with a non-random strategy that counters theirs. Suffice to say this gets a lot more complicated a lot faster. 😂
@@crazy4hitman755Maybe one could have a strategy competition. All contestants submitted a function that took three arguments (the two scores and the turn sum) and returned HOLD or GO
I worked out 20 as the optimal score for the dice rolling game through a different method. First I created a general expected score calculation, with n being the number we are on. (5÷6*(2+3+4+5+6)÷5) + (1÷6×n) The first half calculates what we will get if we win. The 5/6 is the chance of winning, and the (2+3+4+5+6)÷5 is the average value of winning, which solves to four. The second half is the expected value of losing. Upon losing, we will lose all the points we had, hence the n (and why we are subtracting rather than adding) All we have to do is find out where the expected value is 0, which we can do by plugging it into the calculation. 5÷6×4 - n÷6 = 0 Add n÷6 to both sides 5÷6+4 = n÷6 Multiply both sides by 6 5×4 = n n = 20.
Great video on a great game! But what if you change the rules of the game so that the losing condition is rolling the same number twice in a row, instead of rolling a 1? It would guarantee a score greater than 0 at one roll, but would the optimal strategy change otherwise?
For anyone who wants to play can run this small python code on their IDE's :)) . input('Press enter to roll the dice ') import random a = [1, 2, 3, 4, 5, 6] output = random.choice(a) print("You rolled a " + str(output)) total = 0 while output != 1: total += output selection = input('Do you want to bank (press 2) or roll again (press enter key)? ') if selection == str(): output = random.choice(a) print("You rolled a " + str(output)) elif selection == str(2): print('You have banked out') break if output == 1: print("Your turn has ended") total = 0 print('Your total score is = ' + str(total))
Blackjack, a seemingly more complex game, has an optimal strategy that fits on a playing card. This game has a complex 3D graph with multiple colors and overhangs!
I've seen these types of games called "push your luck" type games. Most recently with (yes, its real title) The Quacks of Quedlinberg, which is more complex because of its drawing system.
When he first mentioned that calculating the expectation for score strategies was hard, I tried my hand at it. Instead of bothering with the "how many ways to roll up to n" issue, my first thought was to estimate with the single-roll expectation. One roll has an expected score of 4, so a score of n is obtained, on average, by n/4 rolls. The probability of actually reaching that number of rolls without hitting a 1 is (5/6)^(n/4). The expectation is therefore n*(5/6)^(n/4), which gives us a curve with a peak at just short of 22, at an approximate score of 8.1, which is remarkably close to the result shown later on. For a score of 40 it gives an expectation of between 6.4 and 6.5, while for 10 it gives a result of just over 6.3.
Check out www.kiwico.com/Numberphile and get 50% off your first month of any subscription. (Sponsor)
Extra footage from the making of this video (including Brady trying to roll 50 points and his game against the online Pig Player): th-cam.com/video/zD9-V9Idbug/w-d-xo.html
More Ben Sparks on Numberphile: bit.ly/Sparks_Playlist
you should check out "Cosmic Wimpout"
So I tried simulating this from a different perspective and the results seem odd, does anyone feel like confirming? I ran a simulation to test what was the most common total you'd get before you rolled a one. As if a player was never banking and just seeing what total they got up to before losing. The most common value I got was 6, which seems low to me, particularly when compared to the data in the video.
@@JmanNo42 That's not at all what I was testing.
@@JmanNo42 While scrolling down looking for you code, I found a different comment that explained what was causing me confusion. The most common result is 6 as I thought, but the average result is much higher.
Make a Ball having a radius of 3 cm, make a circle on its surface with a radius of 1 cm
How many circles fit in before the two circles intersect one another
0:40 thank you for clarifying that these are not real pigs
the chance of them being real is incredibly low, but the implications if they are, far outweigh the effort of mentioning it pointlessly.
@@omikronweapon comment gold
@@omikronweapon "inceredibly low, but never zero."
*VSauce theme intensifies*
@@omikronweapon amazing observation ! What would this concept be called in philosophy or perhaps in another field of study ?
@@heh2393 "probablity 0 but not impossible"
*3blue1brown theme intensifies*
I like how the most trivial game of dice ever yields a whole 33-minutes video about maths and probabilities
This seems rather trivial, I mostly watched because he was hyping the complexity up, but it turned out to be 20 all along
right. it doesn't take a ton more complexity before you have a game like chess which has been studied for centuries and is still unsolved lol
@@ekkehard8 Except it isn't 20 all along... Didn't you see the bit where the optimal target number changes up or down depending on how far behind you are and what your total is?
The simple problems are often the most expressive ones to solve.
@@Narokkurai Like what is time?
I remember playing this game as a child and for some reason, my younger brother had what he thought was an invincible strategy called "captain cautious" where he would always bank his points and pass to the next player after one throw, even if that throw had only yielded him one point. Sometimes, to emphasise the point, he would declare, "I'm captain cautious".
I don't think he ever won a game...
somehow, I DIDNT expect that reveal. Yet it's very obvious.
at least he never lost a single point
I don’t remember playing this game as a child. Where I grew up, games were for adults. Children’s had too much work to do to be playing silly games.
@@chriswebster24 That sounds like a miserable childhood.
@@chriswebster24 who asked
This was a really engaging episode. Ben Sparks is a solid teacher!
At least photogenic, if nothing else. But, I do agree it helps that he knows what he is talking about.
@Peter Müller That made me laugh.
What makes me upset is Kiwico imposed an age limit of 104! This old man is 106 years old! Kiwico, what are ye doing concerning your age limit?
If I had been taught mathematics by someone like this rather than buy a football coach with minimal knowledge of mathematical concepts I might actually enjoy math rather than loathe it. a mathematics teacher should be engaging, animated, and able to keep a student's interest. Usually those kinds of teachers are involved in other subjects like literature or art which creates the wrong impression of what studying mathematics can actually be.a
Well said
@@Epoch11 Maths teaching is at the lower end of what a mathematician can earn, it's not the same way for other disciplines. It's also harder to make things like quadratic equations or logarithms engaging or relevant whereas an English teacher can talk about literary devices like foreshadowing or dramatic irony and show TV shows that use it. Maths just has lots of awkward little obstacles in the teaching of it, even more than things like physics which are heavily underpinned by maths. I don't disagree with your point, and I think it's something that maths teachers need to consider, I'm just trying to highlight some of the advantages that other subjects have
I will not lie: If the video was just them playing the game for half an hour I would still have watched it
Also I love how Brady played extremely conservative and still lost hard
I will not lie: If the video was just them playing the game for half an hour I definitely wouldn't watch it.
I will not lie: If the video was just them playing the game for half an hour I would watch half of it.
@Johan Hansén I'd have a 50% chance if watching it all or not at all
@@mihailmilev9909 I would roll a D6, and watch it that many times, unless I roll a 1, in which case I would uninstall TH-cam.
@Johan Hansén I'd watch it on the toilet.
I love that Matt Parker is Numberphile's patron saint of writing code.
Parker Square? Nah!
Parker Array? Yea!
@@krissp8712 how about vector squared equal to tensor?
@@Adhjie Ah, but is it a mathematician Vector or a C Vector?
??
He loves to dust off his Python
I think in terms of player psychology, many people would fail to realize that it only matters what number you're on, not how you got there. For example, if you got to 10 by rolling 2 five times, I think many people would bank it, because they feel they're "due for a 1", but they would keep going if they got to the same result with fewer rolls.
Yup, Gambler's fallacy.
If I rolled a 10 in 1 roll of a d6 I wouldn't want to push my luck
@@ironpro7217 Me neither 😅.
Those first two columns are the same because you can't aim for a score of 1. If you hit 1 you loose and get 0. Therefore aiming for 1 is essentially the same as aiming for 2.
Also, there are only two results for any strategy that aims for a 1 or a 2: Either they roll a 1, or they score points. Thus, the only score it is possible to make for either aiming for 1 or 2 points is the average of any single roll, which the average of 2 through 5 multiplied by the 5/6 probability of rolling any of those values.
As covered in the video, it comes out to about 3.3, and that's why both 1 and 2 not just share a value, but also why that is the specific value they share.
@@vonriel1822 the average of 2 through 6, that is
Both are just banking on the first roll, in other words.
I was going to comment what y'all did because I paused the video and thought about it and now I have nothing to contribute
It took me embarrassingly long to figure this out...
Lawyers in lockdown: I'm a person, I'm not a cat
Mathmaticians in lockdown: these are plastic pigs, they aren't real pigs
Is the lawyer part of this a reference to legal Eagle?
@@cneer17 it was a great meme clip beefore legaleagle did the meme review of it.
@@cneer17 no, though he did talk about it. A lawyer accidentally activated a cat filter, the court posted the clip separately as a cautionary tale.
Police officers in lockdown..
Was going to say this. You beat me to it
I love how the mathmatician took a second to calculate 8+6. Makes me feel better about myself
As a mathematician, I can tell you this - the more mathematics you know, the worse you get at basic math.
I can't tell you how many times while doing Calculus II homework I had to stop and think about how to add fractions.
Needs a Love emote
@@Superbajt What did pi say to I? Pi Said Get Real then I Replied And Said Be Rational
@@israhm8621 could you consider I to be rational though? I would not say you can possibly write it as a ratio of two whole numbers, unless you say i itself is a whole number.
22:43 are the two bars at the front level because you cant score one, meaning that aiming for 1 = aiming for 2 ?
Exactly!
Yep. 👍
The way I would phrase it is that if you get at least 1, you also get at least 2, but it's the exact same point.
Or rather they are both the same stragegy of never rolling more than once per turn. Because if they get 2 or higher, they will always bank as they reached or exceeded their goal, if they get 1 their turn ends. So there is no difference between aiming for 1 and aiming for 2.
Indeed, isomorphically.
Actually, using dynamic programming, you can calculate the average result, when you aim on 20 pretty quickly. A lot of cases collapse (like 2+3 = 3+2), so running calculations on 'aim to 20' strategy would be about 6*20 operations (there are 20 different states, you can be until you get 20 and 6 ways you can go)
Ben Sparks: I'm not gonna reveal too much, you can just go read the paper; it's a nice bit of digging
Brady: crops and highlights the optimal strategy
I used to work in schools and would play this with 5-year-olds to teach them the importance of knowing when you're ahead and calculating odds, but never thought I'd see someone calculate the ACTUAL odds!! mind is absolutely blown, my fave Numberphile video in a long while!
I had a further maths class that liked playing it until the day one lad was loosing 99-0 on his birthday and got to 100 in one turn to win. After that, no game was as exciting!
@@MrDeepbluec how
@@MrDeepbluec Using the roll estimate for such a comeback, the chance of making such a comeback on a given turn in that situation would be (5/6)^25, or about 1.048%. Given the 1/6 possibility of your opponent just rolling 1 straight off and never seeing that last point, the full chance of this comeback should be about 7/6 of that figure, or 1.223%.
Neither of these are quite exact values. Breaking down the entire score tree, according to the video, is computationally too strenuous for us to figure exactly right now all the way out at 100 points.
Haven't seen Pass The Pigs since I played with my grandad like 25 years ago! Super nostalgia. Still remember I threw two leaning gowlers and we studied them for like 5 minutes cos we couldnt believe it.
I have the game because my grandpa was cleaning and giving away his old things, and I had fond memories of playing that game at their hous as a child, so I claimed it.
"Leaning jowler" is a phrase that's etched into my memory from childhood. Loved this game!
Along with Makin' Bacon
"I dusted off my inner Matt Parker"
Nah if you had been channeling Matt you would have done it in a spreadsheet
Every time I read the word spreadsheet I read it in Matt's voice
Matt has leveled up from spreadsheets. He now codes in Python.
And he should have made a mistake or have it only partly resolved.
This is a game I've played and analysed in my job at a science centre! I did the score strat expected value calc a slightly different way, in that I phrased it as "you have a 1 in 6 chance of rolling -n", but got that same optimal score of 20 out. Fascinating to see the extended thinking around the psychology of competitive play, though.
Don’t mind me, I’m just putting a marker at 5:02 for future me so that I can always jump to the best bit
Exactly xD
Here's something to consider: in a winner-takes-all game with many players, it might be advantageous to play a strategy that has a lower AVERAGE score, but has a small probability of scoring spectacularly high. That's because the payoff of finishing in first place is far more than the payoff of scoring in second place. This might explain the evolutionary pressure for risky behavior in an environment with competitive mate selection.
Interesting.. an additional variable, similar to F1 Grand Prix points scoring. Your suggestion would explain the otherwise puzzling risk taking of teens..
Aiming for 20 is similar to aiming for 5 rolls, when assuming an average roll of 4, so the roll and score strategies do give a similar result.
As for why 1 and 2 are equal, it's because you can't end a game on 1 point, you need at least 2 points to end a game (because 1 sets you to 0). So if you will bank after at least 1 point, you'll be banking at the same time that you would when banking when you have at least 2 points, which would be every turn that isn't 1.
I prefer thinking it as 1/6 of losing your current score (let's call it x) and 5/6 of adding 4. So you roll until (-1/6)x+(5/6)*4=0 which gives x=20. Truly a great video this one.
P.S. Hi to all of those watching it in 2024
The most surprising thing is that the full 3-D graph exactly matches the interior of the Sydney Opera House.
My family used to have the cow version of this (Tip the Cows)
Maybe Numberphie could produce a "Bowl the Bottles" version with Klein Bottles...
They would have to be plastic... they can't be the glass ones lol
Or "Toss the Toruses" with tiny plastic coffee cups.
If Russell crow was a sweet friendly guy.
Great game! I grew up playing this with the family. Also... this guy's got a bit of a Russel Crowe thing going on.
My intuition is that the cost of a roll is 1/6 of what you have accumulated, and the value of a roll is 5/6 * 4.. So you roll until you reach 20
Another way of looking at it:
If you're on 20 six times, and get evenly distributed results, one of those times you'll roll a 1 and lose 20 points. The other 5 times, you'll get 2+3+4+5+6 points, for a total of 20.
Rolling when you're on 20 you'd expect to net 0 points.
whoa, we commented really similarly. guess we have similar instincts!
"instinct tells me that banking on 20 is ideally safe for the 5/6 chance of rolling 4 on average"
Can you still call it instinct, when you underpin it by a calculation?
@@taiyibureau9963 until now i thought instinct and intuition were similar, but now i see how different they can be. however, my idea was that a quick calculation is based off instinct without much thought
If you do that without much thought you may call it instinct I guess ;)
I love how Ben Sparks always uses GeoGebra, even when it's not practical 😂
GeoGebra is never not practical my friend
It was pretty. Also I had no clue it could do more than circles and lines :O
His refusal to learn python is admirable
I played the original game with the die in primary school a couple of times in maths. We'd play it with the whole class, everyone would stand up at the start and then the teacher would roll the die and we'd write down numbers until we decided to sit down. We'd then keep our score. If the teacher rolled a 1 everyone standing up would be out and everyone else would add up their scores and whoever had the highest would win. It was a lot of fun.
Computing the expectation of the score based strategies isn't as hard as stated in the video: let p_n be the probability of at some point seeing a score of n in the game (with no stopping). Then p_0 = 1, p_k = 0, k
In World of Warcraft there is an item call that you can craft called Card of Omens. You can flip the card over and get a random amount of gold from 0.1 gold to 5000 gold. I did a similar expected value calculation on the expected value of any given card, and it came out to around 2.5 gold per card. This meant that it was always worth it to buy the card for less than that from another player. It was counter intuitive though because it seems like the card should be worth less if you don't flip thousands of them at a time. I probably still have a giant spreadsheet of me recording several thousand flips to manually calculate the expected value because there was no way to find the chances of getting different amounts of gold
Expected value in points isn't use in the game. Suppose a game where both players usually end with around 500 points. Now add an item that has a one in a million chance of giving you a billion points. This item is basically useless at helping you win. I wouldn't pay 1 point for it.
@@donaldhobson8873 seems his card ALWAYS made a payout (just not always a large one)
In that case, the expected value of that card is 1000, so...@@donaldhobson8873
@@phoquenahol7245 The usefulness of a card in a game is not equal to it's "expected value" in points.
(assuming your goal is to maximize the chance of winning the game) A billion points isn't worth significantly more than a thousand points if 1000 points is already enough to ensure victory.
@@donaldhobson8873 in the game in question, World of Warcraft, money isn't directly usable to win. It helps, and it also allows you to get things that you can show off to other players, but more gold is better pretty much until you have enough that the game breaks (and that's its own bragging rights... social dynamics make analysis more complicated usually but here it's the opposite.)
I think you can solve the hard problem of adding up to 20 using a Markov chain.
Did they change the "Makin' Bacon" graphic?
I had this game as a kid in the 80s and I remember the graphic being a little more illustrative of porcine reproduction.
u should see the astragali (dice) used for the original version thats been around since roman times
I love that every numberphile video has a rubik's cube close by!
I just love the videos with Ben. He seems like a super great guy, and has my kind of humor and work ethics and curiosity and he even seems like a genuine Numberphile fan!
Chances of rolling 4 ones in 10 rolls: 5.4%
Brady's odds: *40%*
*This is why I hated probability*
In Pratchett was something along lines that if you try something with chances one i thousands it will work half of times.
@@Filipnalepa
“Scientists have calculated that the chances of something so patently absurd actually existing are millions to one.
But magicians have calculated that million-to-one chances crop up nine times out of ten.” - Terry Pratchett, Mort
@@Slye_Fox Thanks, that's what I was thinking about.
and statistics, do not forget to hate statistics too. I do, ever since a friend of mine got drowned in a river that had an average depth of 2 feet...
I haven’t watched a numberphile in some time and I’m really glad I did. Nice balance or math and practical explanations.
I'm too young for this...
😂
a 30 minute video featuring Ben is the perfect thing to cap off my day :) I think i've seen every single one of Ben's videos multiple times, so this'll make a fine addition to the collection
You can find exact expectation value using Markov chain methods. It yields system of linear equations over expectation values. For target 20 this leads to answer 492303203/60466176. Funny fact, for target score 21 answer is the same. You can notice that each equation depends only on next unknown, so it can be solved by derivations backwards, which doesn't require any fancy algorithms for solving general linear equations.
i came to the same result. but i have no idea what markov chains are. just added all possible outcomes multiplied by their probability.
@@jennasmith7766 Congratulations. Then you had to add 18365 cases in total, with their corresponding probabilities which doesn't depend on score but on number of turns. On the other hand, Markov chain method gives you answer within approximately 20*5 = 100 multiplications and summations.
I dont know how nobody mentiond it, but there is a very easy way to get the result of 20.
assuming your turn score is x:
there is 1/6 chance you will lose your score, and 5/6 chance you will get (in average) 4
so solve -x/6 + 4 * 5/6 = 0
that's when the risk and reward cancel each other
-x/6 = -20/6
-x = -20
x = 20
Thats true got the same result
this has to be my favourite video on the numberphile channel
The two first bars are identical because you can't score 1, so a target of 1 or higher is equivalent to a target of 2 or higher.
This game actually has me really inspired; if you have a reasonable collection of dice, there's so many interesting variations you can try -possibly a version where you roll 2d6, maybe you have the option of rolling 2d6 *or* 1d12, with whatever number of possible loss conditions
You could even divorce the loss condition from the die roll itself by making the loss condition a score of a certain multiple of something. For example, using 1d6 the loss condition could be your current turns total being a multiple of 6. It's still a 1:6 chance of failing out but it's not tied to any specific roll. Or, if rolling 2d6 you lose if you roll doubles. Still a 1:6 chance of failure
Just play "Can't stop" then. It's a 4d6 version. Very entertaining.
@@remivannier9931 You could also buy the game Zombie Dice where your odds are based on which dice you draw.
Check out the game Farkle. It's this with 5 dice and poker style scoring.
Another option would be to roll N d6s and you choose N but you only get one roll per turn, and you score 0 if any of them are 1, otherwise you score the total. This makes the game a bit simpler, because "roll N times" is the only possible strategy, although you can still choose N based on the current scores.
Wow, those final 3D visualizations are incredible
22:26 Well, those two bars at the beginning end to be the same because it *is* the same if you either aim for 1 or for 2 because you can't score a 1 but a _minimum_ of a 2
One thing (this comes from Farkle) that can make any game like this interesting is if you allow all the players one "catch up" round to beat the winners. This creates extra tension and decision making for two reasons. If the threshold is 100 and you're at 101, in the normal game you win. In the "catch up" variation you're incentivised to keep going to augment your lead. Also if you bank at say 115 points, then the other player now gets one intense turn of trying to catch up with you at all costs.
First time since university that I come across value iteration. Finally that reinforcement learning class pays off ;)
I was excited to see that too!
A simple way to think of it is 24*5/6=20
Basically, once you have 20, more rolls does not increase your expected score
Because you expect to get 4 more but you also will get 0 1/6 times
Exactly my thought. Why do a simulation when it can be easily calculated?
You mentioned the value wouldn't be intuitive, but 20 was exactly what i was thinking based on the risk:reward ratio. When you are on 20 points, you have a 5/6 chance to get an average of 4 points and a 1/6 chance to get -20 points which balance to 0 making it the swing-number. You said n
The strategy I came up with at the start if the video (for playing against another player) is take any chance you get (aka them rolling a 1) to get to 20 more than them. At that point, they will have to make more and more risky moves to catch up to you, so will get more 1s. When that happens roll a twice. You'll slightly increase your lead, by about 6, meaning they will have to risk more, and it cycles
I've watched endless hours of grand illusion videos, and this one i remember seeing in one of those
"if there's some vagary that's advantaging you" 24:38
What a beautiful way of speaking
This is one of the best numberphile videos ever! Really interesting topic!
What fascinates me is that I probably will never ever play this game for a cumulative time of 30 minutes, yet I just watched this entire video and crave to know more about the paper
Great video, I think it's my favorite numberphile vid so far!
The most efficient way to compute the expected value of a score-targeting strategy is using a dynamic programming algorithm. Let E(n, m) be the expected value of targeting a score of n given that your score is currently m. Then E(n, m) = m in the case that m >= n, and (1/6)*(E(n, m+2) + E(n, m+3) + E(n, m+4) + E(n, m+5) + E(n, m+6)) in the case that m < n. If you start from E(20, 19) and work backwards to compute E(20, 18), E(20, 17), ... all the way to E(20, 0) then you exactly get the expected value of targeting a score of 20.
That entire computation is equivalent to repeatedly multiplying a certain vector by a certain matrix, leading to the following one-liner in python (using numpy):
f = lambda n: (np.matrix([[0,1/6,1/6,1/6,1/6,1/6],[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,1,0,0],[0,0,0,0,1,0]])**n).dot(range(n,n+6))[0,0]
Some results:
{16: 7.951606200464866,
17: 8.031577257341358,
18: 8.088571236917641,
19: 8.124622367387675,
20: 8.14179489372703,
21: 8.141794893727027,
22: 8.125963122479138,
23: 8.095693895781407,
24: 8.05237055222043}
"A regular D6" someone was playing some very particular tabletop games!
Yes, as opposed to those irregular d6s.
@@rosiefay7283 Skew D6s are available for what it's worth. Easily found online.
Thanks, this will be very useful when I gonna play this game with someone for roughly 1 million times.
If the goal is to get to 100 points on your own as quickly as possible, wouldn't it be better to aim for 19 instead? If you aim for 20, you'll get a bit on top most of the times. Aiming for 19 will probably still give you at least 20 on average if you don't bust, but it will be safer than 20. I'll write a quick code to test it.
Edit: Here are the coding results.
- Going for 20 each throw (or 100-current_score, whatever is lower), I got 12.626922 turns on average over a million games.
- Going for 19 each throw (or 100-current_score) is 12.634359 turns, which is a little worse. Apparently, too many games don't have enough points after banking 5 games.
- My third try was to go for 19, but after four banks, always go for 100-current_score to go for the home stretch (for instance, if you only got 4*19 = 75, you'd go for the full 25). This gives us 12.557203 on average. A slight improvement.
-There might be some more interesting tactics. Like, once you got one 19, bank it, but then go for 20s up to that point. This gives: 12.568827
Thank you nice work. This was the factor I was missing from the video.
I was pondering similar strategies, like you said the goal isn't the highest average it is the first past 100. Does it make sense to go for 25? That's the first number where you are guaranteed to make it in four successful rolls. If you stop at 20 you can only succeed in four rolls by getting a six after landing on nineteen four times in a row. What's the lowest number between 20 and 25 gives you a better than average chance of making it in four successful rolls?
It seems the game is weighted toward the stop at 20 strategy since that is the first number guaranteeing a five roll victory and also has the highest average return but what if we played to 125? Does shooting for something a little higher make a difference then?
I also wondered about the advantage of going first, you could stop at something as low as 14 and still be likely to win shooting for 20's after that. How many points should we spot player two to make it fair? My instinct says five-ish but I can't prove it.
Lastly, what if you have more players? How do you account for the extra competition? If you have an infinite number of players the only way to win would be to go for broke because somebody would inevitably do it before your second turn. Three players is a subtler problem then I can intuit.
This has been the best Numberphile for me in ages, I had plenty of new questions after the ones in the video were solved. I was preoccupied for my whole dog walk after watching this.
I really enjoyed the journey in the episode from simple to complex analyses of the same problem. Its a great structure for feeling like you've learned something.
Pass the cats would be boring because cats always land on their feet.
Coded this in python at the start of the video, just for the fun of it, and can confirm that aiming for 20 points is the most optimal. although, just doing 5 rolls I found an average of around 8 points per turn, and aiming for 20 points you get around 8.15 points per turn. So its interesting that even though it seems like the points strategy should be much better than the roll strategy they aren't actually that far off from each other.
Wait, they’re NOT real pigs?
This one is so simple but is one of the best videos I've ever seen. Great job.
Interesting episode. I wonder if that 3D chart would become less jagged if we were to increase both the number of die sides and the total score. Or if its jaggedness is not an artefact of the discrete nature of the data, but something intrinsic to this type of problem.
A third way to land on 20 as the magic number is to look at the average turn for a "psychic" player - if you roll a very large number of times, and "magically" bank just before rolling a 1 every time, half your turns will score 0, and the other half will, on average, score 20.
The two ways of arriving at 20 given in the video being that the optimal number of rolls is 5 rolls, with an expected score of 4 per roll; and that 20 is the break-even point where the loss from rolling a 1 is 5 times the gain from rolling anything else.
This was my first thought too, and testing it with a computer simulation confirms it.
@@lucromel It's easy to see from a purely theoretical perspective too. If you roll say six million times, then on average you'd get each number one million times. Rolling a million 1s means having a million scoring turns (strictly speaking, a million and one scoring turns most of the time, and occasionally one less than a million scoring turns, depending on whether the first and last rolls are 1s or not, but that's an error of less than one in a million, and gets even smaller if you increase the number of rolls).
Across those million scoring turns, you have the points from a million 2s, a million 3s, a million 4s, a million 5s and a million 6s, which comes to twenty million points in total, so, for this impossibly perfect player, the average score per scoring turn is twenty points, and average score per turn is ten points. Which also makes strategies scoring an average seven-eight points per turn without knowing when the 1s will come pretty impressive.
Ben Sparks is too cool. You can really feel the math energy he radiates :)
This is one of the best videos you've ever done mate
My strategy was always "Keep rolling until I hit a 6" - that way there's two "outs" - rolling a 1, or rolling a 6. One gets you bank, one gets you bust. But I haven't played it since I was, like, 12.
Interesting! It seems like an appealing idea, but I think it runs into the same argument that proves the "roll N rolls" strategy isn't optimal. If you've rolled and gotten to a total of some number, why would the expected value of rolling again depend on whether you rolled a 6 or a non-6 to get to that total? And if the expected value doesn't depend on that, why should the strategy depend on it?
The thing that makes this particularly interesting is that there are games where the ideal strategy is not to make some fixed decision, but to make a random weighted choice between two decisions -- and, since the "did I get here by rolling a 6?" question is effectively a way of making a random weighted choice, maybe this is a game where a random weighted choice is better? I expect there is an obvious game-theory reason why a fixed choice is better, but I don't immediately know what it is, so ... maybe?
@@BrooksMoses I think you're overthinking the stratagems of a pre-teen.
@@tzisorey : Hah! That might be true. :)
I love this game and have collected several versions. Played it since I was a kid - funny directions. Amazing to see it online here.
Interesting for the simple game my intuition told me that 2 or 3 was the best number of rolls. 5 was surprising
I used an actual spreadsheet. The important insight is that the strategy "stop at N+1" resembles the strategy "stop at N," except the probability of scoring N is reduced to zero and split six ways between scoring 0 and scoring from N+2 to N+6. (Also, in "stop at N," the maximum number of rolls to reach N is the same as to reach N+5: one more than to reach N-1, the largest score where you keep rolling. But I didn't need the number of sequences.)
Stop on 20 or 21: 8.141794894
22: 8.125963122
23: 8.095693896
24: 8.052370552
25: 7.997181681
26: 7.931182634
27: 7.855359085
28: 7.770887138
29: 7.67860712
30: 7.579392889
btw we need that score-card on a tshirt
I just taught my statistics class about expected value and I’m so excited to show them this video
I was about to suggest that we should set up a competition where people submit their programs, then at the end of the video there comes the "winner".
It'd be neat to see this graphed for a wheel instead of a dice. Your points scored is the number of degrees * 6 / 360, with 1/6th of the wheel being the failure outcome wherein you lose all your unbanked points. It might be nice to see more detail in that 3-D graph - is it smooth or some kind of weird fractal? Does that 45 degree flap stretch out and become extremely thin?
I bought the "pass the pug" version of this and it rules because there are pugs
Oh my gosh I never considered actually trying to calculate the probabilities of this game I've had for over a decade! Really brings back childhood memories
You can really see Brady's competitive side coming out here!
@Numberphile there's another way to reach the number 20 which might be easier to grasp: If you currently have N points, the expected points of the next roll is -N/6 + 2/6+3/6+4/6+5/6+6/6 = -N/6 + 20/6 = (20-N)/6, which means that for N < 20 you'll win points on the next roll, on N = 20 you will stay the same if you roll one more time, and on N > 20 you will lose points if you roll (on average, of course).
Well statistically speaking....
*You’ll survive 50% longer if no one wants bacon.*
I want bacon.
Is this just another way of showing how evolution works and that our intuition is linked to perceiving probability well? When you talked through the 3D graph and mentioned the « human » strategy explaining it, it really jumped at me!
A very pleasant 30min! Thanks guys 😊
Couldnt you also compare strategies by calculating the probability of winning with optimal play vs someone who always stops at 20 or after 3 rolls? That would be interesting :)
I programmed it for 10 million rolls and the guy who stops at 20 won 89708 times (~65%), while the guy who stop after 3 rolls won 48071 times (~35%)
In university I took an artificial intelligence course, and one of the projects was to write a robot to play in a rock paper scissors competition.
You can play randomly of course, but if you assume that some of the other players are playing with a non-random strategy then the best strategy is to come up with a non-random strategy that counters theirs.
Suffice to say this gets a lot more complicated a lot faster. 😂
@@crazy4hitman755Maybe one could have a strategy competition. All contestants submitted a function that took three arguments (the two scores and the turn sum) and returned HOLD or GO
Thank you for this video. Probability theory in games is a very interesting topic for me, and I was very glad to see this one come up
Omg i have this game =O for a long time too. Its in french and i never knew anyone who knew it or had it.
I worked out 20 as the optimal score for the dice rolling game through a different method.
First I created a general expected score calculation, with n being the number we are on.
(5÷6*(2+3+4+5+6)÷5) + (1÷6×n)
The first half calculates what we will get if we win. The 5/6 is the chance of winning, and the (2+3+4+5+6)÷5 is the average value of winning, which solves to four.
The second half is the expected value of losing. Upon losing, we will lose all the points we had, hence the n (and why we are subtracting rather than adding)
All we have to do is find out where the expected value is 0, which we can do by plugging it into the calculation.
5÷6×4 - n÷6 = 0
Add n÷6 to both sides
5÷6+4 = n÷6
Multiply both sides by 6
5×4 = n
n = 20.
Great video on a great game! But what if you change the rules of the game so that the losing condition is rolling the same number twice in a row, instead of rolling a 1? It would guarantee a score greater than 0 at one roll, but would the optimal strategy change otherwise?
lol brady's reaction
he was playing right, just on a wrong day
As a competitive person I'm vicariously titled through Brady's rolls. Cmon one more roll you can't quit with zero points!
For anyone who wants to play can run this small python code on their IDE's :)) .
input('Press enter to roll the dice ')
import random
a = [1, 2, 3, 4, 5, 6]
output = random.choice(a)
print("You rolled a " + str(output))
total = 0
while output != 1:
total += output
selection = input('Do you want to bank (press 2) or roll again (press enter key)? ')
if selection == str():
output = random.choice(a)
print("You rolled a " + str(output))
elif selection == str(2):
print('You have banked out')
break
if output == 1:
print("Your turn has ended")
total = 0
print('Your total score is = ' + str(total))
This episode is not kosher
Blackjack, a seemingly more complex game, has an optimal strategy that fits on a playing card. This game has a complex 3D graph with multiple colors and overhangs!
I've seen these types of games called "push your luck" type games. Most recently with (yes, its real title) The Quacks of Quedlinberg, which is more complex because of its drawing system.
I feel bad for Brady. What are the odds...
When he first mentioned that calculating the expectation for score strategies was hard, I tried my hand at it. Instead of bothering with the "how many ways to roll up to n" issue, my first thought was to estimate with the single-roll expectation. One roll has an expected score of 4, so a score of n is obtained, on average, by n/4 rolls. The probability of actually reaching that number of rolls without hitting a 1 is (5/6)^(n/4). The expectation is therefore n*(5/6)^(n/4), which gives us a curve with a peak at just short of 22, at an approximate score of 8.1, which is remarkably close to the result shown later on. For a score of 40 it gives an expectation of between 6.4 and 6.5, while for 10 it gives a result of just over 6.3.
i love this
i need a 3d model of this graph!!
you found any? Cant find it anywhere
Awesome! I thought most comments would be about Brady's astoundingly bad luck but the math was so interesting!
OOOOH. Swine Farkle!!! I'm sold
Swine Farkle sounds like a top-rated crossword solution
29:24 - "I love that all that psychology which we have an intuitive feel, we have the math to back it up." Such a perfect summation of the findings.