Pigs (extra) - Numberphile

Поділитися
Вставка
  • Опубліковано 4 тра 2021
  • Extras from the main video with Ben Sparks at: • The Math of Being a Gr...
    More links & stuff in full description below ↓↓↓
    Ben Sparks: www.bensparks.co.uk
    More Ben Sparks on Numberphile: bit.ly/Sparks_Playlist
    Optimal Play of the Dice Game Pig: cupola.gettysburg.edu/csfac/4/
    Online Pig Player: cs.gettysburg.edu/projects/pig...
    Pass the Pigs game (Amazon affiliate link): amzn.to/2QvCAqM
    NUMBERPHILE
    Website: www.numberphile.com/
    Numberphile on Facebook: / numberphile
    Numberphile tweets: / numberphile
    Numberphile is supported by the Mathematical Sciences Research Institute (MSRI): bit.ly/MSRINumberphile
    Videos by Brady Haran
    Support us on Patreon: / numberphile
    Brady's videos subreddit: / bradyharan
    A run-down of Brady's channels: www.bradyharan.com
    Sign up for (occasional) emails: eepurl.com/YdjL9

КОМЕНТАРІ • 108

  • @Czxvkq
    @Czxvkq 3 роки тому +111

    "Mathematics is not about learning hard facts, it's about having power" that almost sounds like a quote in a movie where some bad old dude tries to corrupt someone by helping them to feel powerful and letting it consume them

    • @metallsnubben
      @metallsnubben 3 роки тому +7

      Did you ever hear the tragedy of Darth Riemann The Wise?

    • @spot1401
      @spot1401 2 роки тому +4

      @@metallsnubben more like Count Su-Doku

  • @Adam_Wagner
    @Adam_Wagner 3 роки тому +84

    One interesting feature that never got mentioned is that according to the optimal generator, player 1 has a 53.1 percent chance of winning with optimal play.

    • @matejdudjak9969
      @matejdudjak9969 3 роки тому +5

      Why? Is it because you start first?

    • @gwahli9620
      @gwahli9620 3 роки тому +17

      That's why in "Dix Mille", all other players still get one turn once the first gets over 10,000 points.

    • @pokerformuppets
      @pokerformuppets 2 роки тому +2

      @@gwahli9620 But that would actually give a slight advantage to the players going later, because they know what they have to beat. A system where all players have the same number of turns would also favour those who go last. Seems there's no way of making it perfectly fair.

  • @Marcara081
    @Marcara081 3 роки тому +36

    I like it when Russel Crowe's brother talks about math.

  • @juliankoch9921
    @juliankoch9921 3 роки тому +18

    Very interesting how the probability of winning dropped when he clicked HOLD at 7:45

  •  3 роки тому +16

    3:31 I've never been so invested in a bar graph race (?).

  • @martinepstein9826
    @martinepstein9826 3 роки тому +24

    This has probably been said already but: the reason the first few bars look the same is those are literally the same strategy. They all force you to stop on the first roll.

  • @laju
    @laju 3 роки тому +7

    The astronauts saved a spaceship with an Omega Speedmaster's chronograph. Brady uses the exactly same function of the similar watch to measure the time of throwing dice.

  • @bsharpmajorscale
    @bsharpmajorscale 3 роки тому +44

    You should always aim for 55.1. It seems a bit high, but the human element will short circuit the RNG and give you winning rolls every time.

    • @michaelhird432
      @michaelhird432 3 роки тому +20

      Ah yes, the human element. The only known way to roll a die in second gear

    • @idontwantahandlethough
      @idontwantahandlethough 3 роки тому +6

      @@michaelhird432 oh man, that's a deep cut meme. Nice.

    • @bsharpmajorscale
      @bsharpmajorscale 3 роки тому +3

      @@michaelhird432 Ah, I see you understand the truth!

    • @Steamworker_Evolair
      @Steamworker_Evolair 2 роки тому +2

      @@michaelhird432 but keep in mind you gotta do it before you roll it

  • @comradelulz7455
    @comradelulz7455 3 роки тому +7

    I haven't been getting any suggestions of your videos at all lately. About a month ago these videos were dominating my suggestions. So I'm interacting with this as much as possible so the algorithm thinks i didn't loose interest.

  • @CANnickhughes
    @CANnickhughes 3 роки тому +14

    I was really rooting for the optimised pig to make a comeback when you were at 99 at the end there

  • @josenobi3022
    @josenobi3022 3 роки тому +7

    I litterally got to 89 against the optimal computer, while it was at 40 something, I had a 90% chance of winning, but I just could not get an 11 in 4 rolls ! And the computer just pulled of a 50 something out of nowhere !

    • @danielyuan9862
      @danielyuan9862 3 роки тому +3

      the 10% of losing isn't even considered statistically significant. oof

    • @josenobi3022
      @josenobi3022 3 роки тому +3

      @@danielyuan9862 Well, I beat it in a few attempts, even while knowing the optimal number to shoot for, and adjusting it slightly. I'm just unlucky

  • @BenJPas
    @BenJPas 3 роки тому +53

    The music at the end is very relaxing. Is there a name and composer?

    • @a51mj12
      @a51mj12 3 роки тому +2

      THE SIMS soundtrack

    • @numberphile2
      @numberphile2  3 роки тому +65

      It’s by Alan Stewart composed for us!

    • @chriswebster24
      @chriswebster24 3 роки тому +5

      No, there’s no music at the end. You’re losing your mind.

    • @tactical1981
      @tactical1981 3 роки тому +6

      Darude - Sandstorm

    • @spot1401
      @spot1401 2 роки тому

      @@tactical1981 flute edition 10 hours

  • @Jamie-st6of
    @Jamie-st6of 3 роки тому +47

    for a D8, you get 16.5, and since 16 is the greatest integer less than 16.5, that's your answer.

    • @arvidbaarnhielm6095
      @arvidbaarnhielm6095 3 роки тому +8

      Hmm, that was no my understanding. Correct me if I'm wrong, but wasn't the strategy to always continue rolling as long as the score was lower than this calculated value? That would mean that 17 is the optimal strategy.

    • @nickycharles9699
      @nickycharles9699 3 роки тому +8

      @@arvidbaarnhielm6095 I believe if you roll again at 17, your expected value is 16.875. So, rolling at 17 is not worth it. Though I could be wrong in this thinking if the idea is to bank when you have at least 17. In which case, 17 is what you're aiming for, and hence, the correct answer.

    • @arvidbaarnhielm6095
      @arvidbaarnhielm6095 3 роки тому +10

      @@nickycharles9699 yeah, roll again for 16 or lower and stop at 17 or higher. So 17 for D8 correspond to 20 for the regular dice (keep rolling at 19 or lower, but stop at 20 or higher)

    • @markjreed
      @markjreed 3 роки тому +4

      I think 17 is more correct. The expected value of another roll when your current total is n works out to 3/4(n + 5.5), and you want to know when that stops being greater than n. 3(n+5.5) < 4n -> 3n + 16.5 < 4n -> 16.5 < n. So you should stop when your score is no longer less than 16.5; 16 is still less than that, so you should theoretically keep going until your score hits 17 or more. But yeah, somewhere around 16/17 is the best answer for ignoring your opponent's score.

    • @arvidbaarnhielm6095
      @arvidbaarnhielm6095 3 роки тому +3

      @@markjreed your calculations and conclusions are correct but you should switch the "lower than" sign to a "larger than" sign, so the result become 16.5 > n (or, n < 16.5)
      The interpretation of this inequality is that for all n lower than 16.5 (we only care about the integer values of n, so 16 is the first integer that fit this inequality), we should keep rolling.
      You could also use the "lower than" sign, but then you should anyway change it to "lower than or equal to", so the result become 16.5 = 16.5).
      The interpretation of this inequality is that for any n larger than or equal to 16.5 (we only care about the integers, so 17 is the first integer that fit this inequality), we should stop rolling.
      Actually, to be entirely correct, the equality could be on either side, since the interpretation of the equality is that you expect to get exactly the same value if you stop or if you roll. However, in the video, they use n < 20 to know when you should keep rolling, and therefore exclude 20, even though the expected outcome of rolling at 20 is exactly 20.

  • @aurelia8028
    @aurelia8028 3 роки тому +5

    I can't believe Brady managed to get to over 50 only on second try, after having such miserable luck in the first video

  • @pokerformuppets
    @pokerformuppets 2 роки тому

    The drama of that bar chart. And what were you doing stopping at 99?!?! I mean 90 was bad enough!

  • @wktodd
    @wktodd 3 роки тому +5

    Fascinating, where does that ladder go???

  • @mryes8184
    @mryes8184 3 роки тому +1

    This is a great vid man!
    Can u do more vids like the one with James Simons? Like about people in using mathematics in stock market. It will be wonderful

  • @randomname285
    @randomname285 3 роки тому +1

    Flexing hard at the end there Brady

  • @Edwin_Gan
    @Edwin_Gan 2 роки тому

    Mathematic is not about learning - the most dramatic zoom ever - hard facts.

  • @ThomasBomb45
    @ThomasBomb45 3 роки тому +4

    What about a game where you have a choice: roll the d6 (1 = bust) or d8 (1,2 = bust). In which situations would you roll d6 vs d8?

    • @danielyuan9862
      @danielyuan9862 3 роки тому

      Interesting... is there ever a situation where d8 is better than d6? Maybe if one of the dice has a higher expected outcome and a higher risk, it may be a more interesting game.

    • @ThomasBomb45
      @ThomasBomb45 3 роки тому +1

      @@danielyuan9862 That's what i'm wondering. Maybe in this scenario, no. I thought that if you were 8 points away from winning that a 1/8 chance was better than not going bust on two d6 rolls. But I calculated it out, and rolling 2 d6 is better than 1 d8 in that scenario.
      You can imagine a scenario though where you have one lower risk die and one higher risk die (where risk is measured in terms of spread or variance). And it could be possible that strategies involving the high risk die make sense when you are sufficiently far behind, or at other peculiar scores.
      For example, imagine a die that has an x% chance of rolling 100, but all others are a bust. I suspect that there is a value of x where it makes sense to roll the d6 most of the time, but may serve as a "hail Mary" when you are near to losing the game

  • @davidbouldin3326
    @davidbouldin3326 3 роки тому +1

    Speedmaster! Nice!

  • @johnchessant3012
    @johnchessant3012 3 роки тому +2

    Cool!

  • @samueltaylor6421
    @samueltaylor6421 3 роки тому +6

    For this new game, n < 16.5. You can accomplish this by alternating between setting a goal of n=16 and n=17. Explanation in a reply.

    • @samueltaylor6421
      @samueltaylor6421 3 роки тому +4

      Having n=16.5 would be identical to n=17 (in either case, if = 17, stop rolling). But the equation spits out n=16.5 for a reason: aiming for a goal of n=17 is risky enough that you're not seeing optimal reward for your risk. You'd need to use the tough partitions math to see whether 16 is superior to 17, if you were forced to choose one goal and stick to it.
      But you don't have to stick to one goal. You could alternate between having a goal of 16 and a goal of 17. To me, this makes intuitive sense: If you made a dice game such that the equation produced n=16.0001, setting your goal to n=16.0001 (which is identical to setting your goal to n=17) would undoubtedly have worse risk/reward than n=16.

    • @shirou9790
      @shirou9790 3 роки тому +1

      @@samueltaylor6421 in any case, roll on 16, stay on 17. so your goal should really be 17, as it's then obvious that it's a better goal than 16.
      In the D6 version the equation spits 20, which means that on 20 you could either stay or roll, the expectation stays the same. Which means your goal could be either 20 or 21 and it doesn't matter. (roll on 19, do whatever on 20, stay on 21)

    • @plop010
      @plop010 3 роки тому

      @@samueltaylor6421 actually, roll again if you are at 16, don't roll again if you are at 17. that's all there is to it. and it's kind of intuitive why. for a score of 16.5, you would be indifferent between rolling again or not, the continuation value is the same as the score, 16.5. For any score S>16.5, the continuation value is lower than S, don't roll. For any score S below 16.5, including 16, the continuation value is higher than S, so roll again.
      so yeah your intuition is wrong

  • @NicholasproclaimerofMessiah

    According to the previous video's maths, I would say they are going to get exactly 16.5 as their answer this time.

  • @HeavenlyTennyo
    @HeavenlyTennyo 3 роки тому +10

    Ah, a chance to gaze upon Brady’s lovely Omega.

  • @mienzillaz
    @mienzillaz 3 роки тому +4

    I rolled 62 w/o busting, made the game in excel:)

  • @spkymky
    @spkymky 3 роки тому +3

    I wonder if Jane Street predicted the reddit apes when shorting GME?

  • @littleboylost1o1
    @littleboylost1o1 3 роки тому

    Nice watch

  • @topilinkala1594
    @topilinkala1594 2 роки тому

    For the beginning of this I have to tell you that in Finland it is illegal to loan or lend money for gambling. But it is not illegal to do that for buying stock. My question to new MP's has always been why not as buying stock is gambling and I get never an answer.

  • @Lashb1ade
    @Lashb1ade 3 роки тому +1

    That final game: answer is 26*49=1274

  • @twincast2005
    @twincast2005 3 роки тому +14

    Well, it's n < 16.5, so... < 16 in practice.

    • @T1Squid
      @T1Squid 3 роки тому +9

      Correction: n < 17 in practice.

    • @Jamie-st6of
      @Jamie-st6of 3 роки тому +4

      @@T1Squid 17 is greater than 16.5, our theoretical limit, so you can't round up to 17 and must round down to 16

    • @lantua
      @lantua 3 роки тому +12

      @@Jamie-st6of the condition is that n < 16.5 and n is integer. it is equivalent to n < 17 and n is integer.

    • @twincast2005
      @twincast2005 3 роки тому +1

      I did originally have n < 17 up there, but then the "last low risk integer" versus "first high risk integer" twisted my brain into a pretzel. Still go back'n'forth.

    • @nickycharles9699
      @nickycharles9699 3 роки тому +5

      Just to be clear, you roll again at 16, therefore aiming for 17 right?

  • @garrick3727
    @garrick3727 3 роки тому +1

    I wonder how reliable the approximation d/2p + 1 is, where d is the number of sides of the dice and p is the probability of losing. For a 6 sided dice, losing on a 1, it gives 19, and for an 8 sided dice losing on a 1-2 it gives 17. For an 8-sided dice losing on a 1 it suggests you aim for 33, which seems a bit high.

    • @Wontervandoorn
      @Wontervandoorn 3 роки тому +1

      Let's write p = k/d. And we assume that if you roll 1, 2, 3, .., or k, then you're out. While if you roll k+1, k+2, .., or d, then you add that to the tally and (possibly) continue. Then we want to solve the following equation:
      x = 1/d ((d-k)x + d(d+1)/2 - k(k+1)/2)
      This value of x determines whether you want to continue or not. Now, multiplying this equation by d, subtracting (d-k)x and dividing by k gives
      x = d(d+1)/(2k) - (k+1)/2
      = (d+1)/2p - (dp+1)/2
      If your current value is less than this, then you want to keep playing. Otherwise, stop. Notice that if p is small (eg 1/d or 2/d as in the examples in the videos), then (dp+1)/2 is small as well, and you get close to your approximation. For example, when p = 1/d, then this simplies to
      d(d+1)/2 - 1
      So with an 8-sided die and losing on a 1, you are supposed to keep going as long as you are under 35.
      More generally, let's work with a d-sided die and let S be a subset of size k of {1, 2, .., d} such that if you roll an element of S, you are out. While if you roll something outside of S, then you add that and may continue. Let A be the sum of all elements of S and let B be the sum of all elements not in S. Note that B = d(d+1)/2 - A. Then you are supposed to keep going as long as you are under B/k.

    • @garrick3727
      @garrick3727 3 роки тому +1

      ​@@Wontervandoorn Wow, thanks. It's much easier to remember that than specific (condition, target) pairs.

  • @Headhunter_212
    @Headhunter_212 3 роки тому

    Ben Sparks, Persi Diaconis and Brady Haran walk into a bar...

  • @SunayH01
    @SunayH01 3 роки тому

    Isn't this dice cricket but 5 being out instead of 1?

  • @justingolden21
    @justingolden21 3 роки тому +1

    How is the probability of winning calculated?

    • @algc19
      @algc19 3 роки тому +1

      This is the second video in a series, it is calculated in part 1

  • @damientonkin
    @damientonkin 3 роки тому +1

    Has anyone played zombie dice? Same principle but using multiple dice each with a weighted probability.

  • @user-qd8ft4kg4c
    @user-qd8ft4kg4c 2 роки тому

    Why is the dice driffant shape

  • @ablertobchodak4813
    @ablertobchodak4813 3 роки тому

    yay my tip was 16 :)

  • @jiegillet
    @jiegillet 3 роки тому

    Stopping at 99, Brady come on!

  • @wobblysauce
    @wobblysauce 3 роки тому +1

    Ha just like the last video, 20 games, 19 games didn't even get a score higher than 15, but one game I got to 20 and for the fun of it maxed the roll and got a score of 93.

  • @Igorbujhm
    @Igorbujhm 2 роки тому

    that piggy seems way to risky for my taste) getting cocky and rolling a 6th time when your ahead is what bites you in the butt

  • @oneMeVz
    @oneMeVz 3 роки тому +1

    Funny, off the top of my head i guessed 16 :)

  • @BL3446
    @BL3446 3 роки тому +2

    I'm surprised they never mentioned Blackjack. Isn't this similar to how the dealer plays. Hit below 17?

    • @reillywalker195
      @reillywalker195 2 роки тому +2

      This is indeed similar to Blackjack, the main difference being that Blackjack has no replacement. The probability of getting a particular value of card in Blackjack changes as cards are dealt, whereas the probability of a given die roll never changes. As the player, you need to figure out how to leverage that in either game.

  • @GroovingPict
    @GroovingPict 3 роки тому

    16 was my intuitive guess... dont know why

    • @mikedoe1737
      @mikedoe1737 3 роки тому

      Same.
      I figured it was lower than 20 (easy: the risk increased) and figured the doubling of the risk while a 1/3 increase in the reward brought to target down to 16, given a 1/8 outcome.

  • @MrMartinSchou
    @MrMartinSchou 3 роки тому +1

    I feel like there should be some kind of shortcut calculation.
    D6, fail on 1. Die sum = 21. Minus 1 as it's a fail gives us 20.
    D8, fail on 1 and 2. Die sum = 36. Minus 1 + 2 as they fail gives us 33. Way above the 16.5 optimum.
    D6, fail on 1. Die sum = 21. Minus 1 as it's a fail gives us 20. Divide by number of fail rolls (1) gives us 20.
    D8, fail on 1 and 2. Die sum = 36. Minus 1 + 2 as they fail gives us 33. Divide by number of fail rolls (2) gives us 16.5.
    But I've no idea if this actually holds true for any die size and any fail roll.
    Well, I know it doesn't. D6, fail on anything but a 4. That's a total success sum of 4 to be divided by 5.

    • @Mr2Chitown
      @Mr2Chitown 3 роки тому +1

      It actually looks like it works, but only if the "losing rolls" are the smaller numbers. I have run it on python for D9 1-2 lose, D9 1-2-3 lose, D10 1-2-3-4 lose and D12 1-2-3 lose. They all follow the logic you mentioned where floor fonction of((sum of die - sum of lose)/num of lose)= the maximum to aim for.

    • @TurboD89
      @TurboD89 3 роки тому

      Yes, it works. You're basically describing the calculation he did in the previous video.

    • @danielyuan9862
      @danielyuan9862 3 роки тому

      I wouldn't call it a "shortcut calculation" unless you show that it always works (and why), but that does seem to be the case.

    • @reillywalker195
      @reillywalker195 2 роки тому

      The shortcut calculation works when there's only _one_ result that loses. That said, you can amend the shortcut calculation such that you _subtract_ the _total_ of the losing faces and then _divide_ by _how many_ losing faces there are. For example...
      D12; lose on 1-3:
      Total of all faces = 13 * 6 = 78
      Total of losing faces = 1 + 2 + 3 = 6
      (78 - 6) ÷ 3 = 72 ÷ 3 = 24
      D12; lose on 1-4:
      1 + 2 + 3 + 4 = 10
      (78 - 10) ÷ 4 = 17
      D20; lose on 1-4:
      Total of all faces = 21 * 10 = 210
      (210 - 10) ÷ 4 = 50
      D20; lose on 1-5:
      (210 - 15) ÷ 5 = 39

  • @ucngominh3354
    @ucngominh3354 3 роки тому

    hi

  • @FenrizNNN
    @FenrizNNN 3 роки тому

    Numberphile squared

  • @frankharr9466
    @frankharr9466 3 роки тому

    Randomness is hard.

  • @randomname285
    @randomname285 3 роки тому

    I guessed 16!

  • @prithwishguha309
    @prithwishguha309 Рік тому

    I Said 16🥳🤣

  • @PopeLando
    @PopeLando 3 роки тому

    At the end there's a link to the Einsteinium Periodic Video. One of the ads I watched was one of those ones with the deepfake Einstein, which really creep me out! 🤮

  • @skebess
    @skebess 3 роки тому

    Is it just me or the AI is really bad at this? (Even on optimal level)

    • @omikronweapon
      @omikronweapon 3 роки тому

      The optimal level is the optimal level. The AI just had bad luck. Which makes it kinda pointless to me. You can't 'beat' it as in being a better player. You can only have better luck, while playing with the same strategy, or less successful one.

    • @skebess
      @skebess 3 роки тому

      @@omikronweapon well, i disagree. This ''optimal'' strategy assumes a very high number of games for it to be actually optimal (thousands). Pretty sure i'm not going to play that many games 😉
      This makes the AI too predictable. Just get a few points in at the beginning and the AI will keep taking too much risk to try to catch up to you, and lose as a result.

    • @martinepstein9826
      @martinepstein9826 3 роки тому +3

      @@skebess From the paper: "If both players are playing optimally, the starting player wins 53.06% of the
      time"
      You have a slight advantage over the computer because you're going first. Playing a very high number of games has nothing to do with it. Each game is independent. You don't increase your chances of winning this game by decreasing your chances of winning future games.

    • @skebess
      @skebess 3 роки тому +1

      @@martinepstein9826 You seem to misunderstand the way probability work. An optimal strategy that will win you most games "on average" is only useful if enough games are played. (In this case, "enough" is thousands, at least.) If there aren't enough played games, then other factors of the game become so important that your optimal strategy is indeed worthless. This fact doesn't seem to be taken into account in the design of the AI.

    • @martinepstein9826
      @martinepstein9826 3 роки тому +2

      @@skebess "You seem to misunderstand the way probability work"
      Right back at you. You claim you have a strategy that does better in individual games while losing in the long run. That's not possible. The games are independent, so there are no "other factors" that let you win now at the cost of losing later. If your strategy is better in one game then it's also better in the next game, and the next, and so on, and in the long run you'll win more games.