Help, our train home is making 9 quintillion stops.

Поделиться
HTML-код
  • Опубликовано: 21 сен 2024
  • Thanks as always to Jane Street! Here is that blog post about 63-bit numbers.
    blog.janestree...
    My book is out in North America on the 21 January 2020. Pre-order now!
    bit.ly/humblepi
    Here are the numbers:
    9,223,372,036,854,775,798 stops
    2^63 = 9,223,372,036,854,775,808
    7FFFFFFFFFFFFFF6
    111111111111111111111111111111111111111111111111111111111110110
    Here are the tweets:
    Neil Codling @neilcodling
    👀 Help, our train home is making 9 quintillion stops.
    EIZrPtbW4AA3UL2.jpeg
    / 1190757074164170758
    Daniel @drawRect
    Replying to @neilcodling
    Thanks for the tweet. What version of the app are you using? I thought we fixed this bug AGES ago.
    / 1191033767760158720
    Lia Buddle @LiaBuddle
    Replying to @neilcodling
    Had the same thing in 2017...
    EIc4CNJXsAATexO.jpeg
    / 1190982241914101760
    Matt Parker @standupmaths
    Thanks everyone who sent me this amazing tweet! So, as always it’s probably a binary overflow problem and sure enough 2^63 = 9,223,372,036,854,775,808 which is close!
    / 1190940255974760448
    We have a free Think Maths magic trick activity that teachers can use to introduce their students to binary.
    think-maths.co....
    CORRECTIONS
    - None yet, let me know if you spot any mistakes!
    Thanks again, as always, for Jane Street being my principal sponsor.
    www.janestreet...
    Thanks to my Patreon supporters who help make these videos possible. Here is a random subset:
    Icaro Fonseca
    Timothy Lombard
    Andy B
    Nokui
    Peter
    Tracy Parry
    Brandon
    Lindsay Miller
    Support my channel and I can make more maths videos:
    / standupmaths
    Filming and editing by Alex Genn-Bash
    Music by Howard Carter
    Design by Simon Wright
    MATT PARKER: Stand-up Mathematician
    Website: standupmaths.com/
    Maths book: wwwh.umble-pi.com
    Nerdy maths toys: mathsgear.co.uk/

Комментарии • 2,3 тыс.

  • @No-uc6fg
    @No-uc6fg 3 года назад +5009

    9 quintillion stops in 2 hours and 26 minutes? That's incredible.

    • @The_Bird_Bird_Harder
      @The_Bird_Bird_Harder 3 года назад +190

      The definition of a speed considered "stopped", and the size of a "stop" are quite variable don't you know?

    • @No-uc6fg
      @No-uc6fg 3 года назад +55

      @@The_Bird_Bird_Harder I was making a pun man... It sais 9 quintillion stops until destination and it reaches said destination in 2 hours. Was making a pun.

    • @altokia2724
      @altokia2724 3 года назад +229

      @@No-uc6fg i dont think that's a pun lmao

    • @jakubrossa7794
      @jakubrossa7794 3 года назад +63

      basically means you can jump of the train at any point in the journey

    • @corinnepowers9646
      @corinnepowers9646 3 года назад +8

      Guys I'm losing my mind in my comment thread somewhere else in the comments exploring this idea... just... might be hilarious to watch me descend into madness, if you're interested xD
      I'm just an amateur so it's all over the place you know, but hey, maybe someone will do whatever it is I'm trying to do real quick and save me from doom hahaha

  • @ChromeBirb
    @ChromeBirb 3 года назад +3937

    My favourite 32 bit error appears in paper mario where baking a cake for 4.5 years gives you a perfectly baked cake

    • @wolfrig2000
      @wolfrig2000 3 года назад +224

      It's always nice to see a Stryder fan

    • @knickohr01
      @knickohr01 3 года назад +312

      And hitting a block for 416 years crashes the game

    • @realbignoob1886
      @realbignoob1886 3 года назад +8

      @@knickohr01 ikr

    • @FandangoJepZ
      @FandangoJepZ 3 года назад +21

      And bonking for a few minutes wins the game

    • @squibble311
      @squibble311 3 года назад +10

      stryder7x gang

  • @kylecobb9982
    @kylecobb9982 4 года назад +3194

    A stop every 10 femtometres or something like that

    • @InTheBeginningTheUniverseWas
      @InTheBeginningTheUniverseWas 4 года назад +272

      over a quadrillion stops per second

    • @Lovuschka
      @Lovuschka 4 года назад +155

      Which means it's over 9000.

    • @pyral514
      @pyral514 4 года назад +36

      @@Lovuschka Which mean it's over 1.

    • @Symphony_
      @Symphony_ 4 года назад +5

      @@Lovuschka actually that was 8000 not 9 , XD

    • @Lovuschka
      @Lovuschka 4 года назад +45

      @@Symphony_ The fan translation which became the meme was over 9000, however.

  • @Gasmanic
    @Gasmanic 4 года назад +10635

    Train passenger: That's strange, my phone says that my train is making 9 quintillion stops.
    Computer programmers: You're right, that *is* strange. I'd expect it to say 18 quintillion.

    • @bbaovanc
      @bbaovanc 4 года назад +428

      shingebis it’s probably because 9 quintillion are negative and 9 quintillion positive.

    • @SuperFranzs
      @SuperFranzs 4 года назад +399

      @@bbaovanc Why would the amount of stops be a signed integer?

    • @meowthecat422
      @meowthecat422 4 года назад +681

      @@SuperFranzs because most programmers are lazy and just use int, but what i suspect is that whatever language they were using handles integers this way

    • @nblack2867
      @nblack2867 4 года назад +317

      @@SuperFranzs Because it's easier to use a signed integer a lot of times. If you're not thinking about it, the programmers easily could have used a signed one by habit, especially if they weren't expecting someone to make so many stops that they would need all 63 bits. They would think it doesn't really matter, so just use a signed one instead, because it is often easier.

    • @calebkirschbaum8158
      @calebkirschbaum8158 4 года назад +119

      Honestly, I can't think of all the times I have seen an error, and was like, that shouldn't happen, the error should be doing this, or even be expecting an error and get really confused when I don't see one.

  • @NFSHeld
    @NFSHeld 3 года назад +1255

    1) Have a 64 bit signed integer using 2 complement (i. e. value range is from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807).
    2) Initialize a frontend record with the minimum value = -9,223,372,036,854,775,808 as "sentinel value" to indicate "has not been loaded yet"
    3) Asynchronously query the total number of stops from the /generalLineInfo microservice
    4) Asynchronously query the number of completed stops from the /currentTrain microservice
    5) Have an improper error handling when the /generalLineInfo query fails.
    6) Calculate that you have " - 10" stops left.
    7) Have an integer underflow and land on 9,223,372,036,854,775,798 remaining stops.

    • @willphillips2522
      @willphillips2522 2 года назад +47

      Dang you got it all figured out

    • @throwaway-og7qs
      @throwaway-og7qs 2 года назад +65

      this makes a whole lot more sense, when he was talking about it being a signed integer underflowing I was just like "so... how did it get to -2⁶³ + 1 exactly?"

    • @ifroad33
      @ifroad33 Год назад +22

      @@throwaway-og7qs I'm not sure, but I think it might be possible to reach "-2^63" and not just "-2^63 + 1". The negative numbers start counting from -1, while the positives start at 0. I could be wrong, but it was a thought that popped up in my head when I read your comment! :)

    • @dfp_01
      @dfp_01 Год назад +9

      This is why things like sleep timers and waitUntilLoaded functions tend to be built into modern query handlers (or multiprocessing tools, because either could be responsible for this error).

    • @marcasrealaccount
      @marcasrealaccount Год назад +6

      ​@@ifroad33More like it starts at 0 and goes up to 2^(n-1)-1 then it rolls over to -2^(n-1) and goes up to -1, so for a 4 bit signed integer it would start at 0 (0000) go up to 7 (0111) roll over to -8 (1000) and go up to -1 (1111).

  • @leefisher6366
    @leefisher6366 4 года назад +5159

    Occam's razor, Matt. Perhaps the train really is making that many stops.

    • @davidmurray3542
      @davidmurray3542 4 года назад +444

      I would argue that the existence of 9 quintillion stops is not the simplest explanation...

    • @jamespolland958
      @jamespolland958 4 года назад +353

      @@davidmurray3542 and I would argue that it is

    • @herbert164
      @herbert164 4 года назад +27

      @@jamespolland958 so where would they fit?

    • @jamespolland958
      @jamespolland958 4 года назад +419

      @@herbert164 you'd have to ask a train expert about that one man. Sory

    • @herbert164
      @herbert164 4 года назад +36

      @@jamespolland958 So your argument is fundamentally flawed? You are not an expert. Therefore, your argument that it is the simplest explanation cannot be taken seriously. Also, if it was simple shouldn't it be simple enough for a non expert to understand?

  • @hadz8671
    @hadz8671 4 года назад +1738

    "Humble Pi" appear at 3:14 - nice touch!

    • @Lattamonsteri
      @Lattamonsteri 4 года назад +27

      Duuuuuude :D awesome!

    • @anasorabi123
      @anasorabi123 4 года назад +30

      Wonder if it was on purpose

    • @sebastianjost
      @sebastianjost 4 года назад +122

      @@anasorabi123 I think it is... Matt is the kind of guy who would insist on such details

    • @RFC3514
      @RFC3514 4 года назад +96

      Technically should appear at 3:08.4 (i.e., 3.14 minutes). I guess seconds should be renamed "Parker decimals"...?

    • @GFmanaic
      @GFmanaic 4 года назад +25

      Should be named Humble half Tau

  • @Green0Photon
    @Green0Photon 4 года назад +1844

    Note: when you write out hexadecimal, don't write out commas every three digits. Instead, put a space every 2 or 4 digits. That way, each block is either a byte or word (2 bytes aka 16 bits). That's much more standard in writing out hex.
    Also, I love how enthusiastic this video is. It just makes me feel a bit happier. :)

    • @thedocta_certified
      @thedocta_certified 4 года назад +15

      A word is 4 bytes no?

    • @Squossifrage
      @Squossifrage 4 года назад +70

      @@thedocta_certified In the Intel world, a word is 16 bits, a dword is 32, a qword is 64.

    • @Idran
      @Idran 4 года назад +42

      @@thedocta_certified How many bytes in a word varies by system; it's however much your processor can manipulate in a single op, there's no one definition for it

    • @Qbe_Root
      @Qbe_Root 4 года назад +27

      @@thedocta_certified Whether you call it a word of a halfword, 2 bytes is more intuitive than 1.5

    • @f_f_f_8142
      @f_f_f_8142 4 года назад +7

      @@thedocta_certified the length of a word depends on the architecture, in a 32-Bit processor a word has 32 bits and in a 64 bit architecture a word has 64 bits.

  • @tinybabybread
    @tinybabybread 3 года назад +853

    I'm not sure if someone's already mentioned this, but I love how Matt looks up at the number 0:39 (repeatedly throughout the entire number, actually) as if he were actually reading the text added in post lol
    He does it so naturally it's easy to forget the number isn't actually there

    • @jdubya7139
      @jdubya7139 2 года назад +113

      My head canon is that Matt walks around with literal numbers floating over his head all day.

    • @Imrooniel
      @Imrooniel Год назад +39

      I wonder if he wrote the number on paper taped to ceiling and looked up at it both as clever gag with visual graphics and as a way to reduce the amount of takes by fumbling remembering the huge number

    • @TheAkashicTraveller
      @TheAkashicTraveller Год назад

      @@jdubya7139 No doubt many people visualise numbers when thinking about them.

  • @Interesting_Failure
    @Interesting_Failure 2 года назад +345

    Attempting to resolve Zeno's paradox by quantizing space, West Midlands Trains successfully redefines motion as a series of stationary states linked together by the smallest physically possible distance. Unfortunately, this leads to the train "stopping" at every single state which produces some interesting scheduling results.

    • @cara-seyun
      @cara-seyun 2 года назад +16

      You deserve all the likes

    • @handuo6301
      @handuo6301 Год назад +6

      A train quantum wave packet!

    • @denelson83
      @denelson83 11 месяцев назад +1

      As in sub-Planck length?

    • @Alolyn
      @Alolyn 10 месяцев назад +2

      This is why you dont use trains in quantum problems
      Leave those for special relatively

  • @asi.izzygizmic
    @asi.izzygizmic 4 года назад +1377

    Just yesterday we had breaking news in finland about a person whose bank account was in debt for 2^63 euros

    • @Awkwerp
      @Awkwerp 4 года назад +308

      I would definitely assume overflow since its negative. Who knew being too rich could happen lol

    • @kilvesx7924
      @kilvesx7924 4 года назад +12

      Haven't heard of this, can you link it?

    • @asi.izzygizmic
      @asi.izzygizmic 4 года назад +41

      www.iltalehti.fi/kotimaa/a/e514a9e9-2080-4ce8-8e69-2171be52d024

    • @davidmurray3542
      @davidmurray3542 4 года назад +170

      I would have to guess that there was some bad type conversion involved, because if it *was* signed integer overflow, that would imply they've got over 9 quintillion in the bank.

    • @miriamkorver1443
      @miriamkorver1443 4 года назад +13

      Wasn't that a Belgian person: www.metronieuws.nl/in-het-nieuws/2019/11/belg-heeft-schaamrood-op-de-kaken-na-banksaldo-van-100-miljard

  • @AalbertTorsius
    @AalbertTorsius 4 года назад +3914

    I feel we're missing a piece of the puzzle. How many stops _are_ there between those stations?

    • @Henrix1998
      @Henrix1998 4 года назад +510

      Probably 10 or 11

    • @JesperDramsch
      @JesperDramsch 4 года назад +393

      Birmingham New Street to London Euston in the West Midlands Trains is calling at 22 stops.
      Waterloo to Keynsham in South Western Railway calls at 12 stops.
      10110 and 1100 respectively.

    • @martinda7446
      @martinda7446 4 года назад +126

      @@Henrix1998 Is that 2 or 3?

    • @m1lkweed
      @m1lkweed 4 года назад +440

      ~9 quintillion

    • @OlafDoschke
      @OlafDoschke 4 года назад +62

      It's either 12 or 20, depending on what route you take from Rugby:
      www.londonnorthwesternrailway.co.uk/sites/default/files/assets/download_ct/20190226/9bE805nbW3CCoJJzY6oDU37oKbc3f2dJE2Bp6nVG2rg/lnr_map.pdf

  • @hikaruyoroi
    @hikaruyoroi 4 года назад +1101

    That's just a bit shorter than a CVS receipt

    • @YingwuUsagiri
      @YingwuUsagiri 4 года назад +16

      I really see this ripping on CVS a lot and let me start with yes it looks ridiculous but it's actually a much better alternative for the planet than what the other companies do. Option 1 is what CVS does, thermal paper and a thermal printer which uses paper and power and that's it, option 2 is being part of those coupon packages which uses paper, ink, plastic, a lot of transport infrastructure with vehicles running on gas, etc etc.

    • @CalculatedRiskAK
      @CalculatedRiskAK 4 года назад +32

      @@YingwuUsagiri Option 3: Coupons delivered via email and scannable from a phone screen. The scanners they use at checkouts can scan a bar code on a screen. The scanners don't look for where light is, they look for where light isn't so they're able to immediately grab the bar code or QR code.

    • @YingwuUsagiri
      @YingwuUsagiri 4 года назад +5

      @@CalculatedRiskAK When the time comes that such a thing gets implemented en masse yes, but for now the VAST majority of coupons in both the Americas and Europe are physical either on paper or in distribution packages.

    • @R3lay0
      @R3lay0 4 года назад +6

      @@YingwuUsagiri Thermal paper isn't just "paper" tho.

    • @nurmr
      @nurmr 4 года назад +1

      @@CalculatedRiskAK Then they would need to collect email addresses and they're PII (personally identifying information) and so a whole bunch more nonsense kicks in. Ignoring the fact they that they've probably just scanned your CVS extracare membership card and charged your credit card for your purchase.

  • @Bananasforthesoul
    @Bananasforthesoul 4 года назад +499

    I can’t even imagine the notifications on a 255 person WhatsApp group.

    • @tlh1337
      @tlh1337 4 года назад +64

      I'm in a group with 215 participants and... 0 messages in the last 4 days

    • @Bananasforthesoul
      @Bananasforthesoul 4 года назад +30

      ok lmao well must not be a bunch of friends. Any WhatsApp group I’ve been in with just 5-6 people I get 100+ notifs a day.

    • @tlh1337
      @tlh1337 4 года назад +1

      @@Bananasforthesoul that's true.

    • @qtulhoo
      @qtulhoo 4 года назад +3

      Nicholas Stormbreath
      Oh god that's scary.

    • @Oberon4278
      @Oberon4278 3 года назад +5

      The very first notification I'd see would be from me leaving the group.

  • @thenoone
    @thenoone 3 года назад +1169

    2:26 "You can't build a wall up to 256 blocks high"
    **laughs in 21w06a**

  • @IceMetalPunk
    @IceMetalPunk 4 года назад +706

    My guess: A signed int was incorrectly cast to an unsigned int during a calculation somewhere. Signed ints will sometimes use two's complement for the integer portion of their encoding, depending on the system. If someone tried to do a quick cast to unsigned by chopping off the first bit (which is a common trick) and didn't realize the system was using the complement, that could cause exactly what we see.

    • @nibs_fpv
      @nibs_fpv 4 года назад +45

      I agree with this. Which is why it was 2 to the power of 63 -> First bit of 64 missing

    • @kaitlyn__L
      @kaitlyn__L 4 года назад +25

      Also in support of your theory, the direct train journey which displayed the same bug did have the maximum value. So it would seem the viral tweet really had 10 stops. (Or maybe 9?)

    • @alexcat3121
      @alexcat3121 4 года назад +28

      A quick guess-- the stop number calculation is done using a formula like this-- Math.abs(stop1_id - stop2_id) and somehow the sign bit of the subtraction was zeroed before the call to the absolute value function.

    • @PhilBagels
      @PhilBagels 4 года назад +4

      Maybe there was a parity bit - used to catch errors, but obviously not this particular kind of error.

    • @Eugenethemooer1Wolffe
      @Eugenethemooer1Wolffe 4 года назад +3

      I thought this might be the case, but why would they have been storing a negative number of stops in the first place?

  • @Real28
    @Real28 4 года назад +481

    "thought we fixed it ages ago"
    LOL oh, how many times have you thought you squashed a bug and it comes back.

    • @dwavenminer
      @dwavenminer 4 года назад +12

      Real actually in this case it might be a bit flip caused by a cosmic ray...if so, there's little a programmer could do...even if you have a sanity check, the cosmic ray could hit after the sanity check...
      About the only realist thing you can do is not run the severs so hot, as increasing the temperature of the computing hardware decreases the required energy of a cosmic ray in order to flip a bit...

    • @rogerkearns8094
      @rogerkearns8094 4 года назад +9

      @@dwavenminer
      I wondered about that, too, but I think it's too rare an event to apply here. After all, there's an implication given in the video that the anomaly was a known bug. Moreover, I was employed maintaining, writing and testing computer programs for thirty years and I never had need to suspect it.
      Still, perhaps.
      Cheers

    • @eaglegosuperskarmor
      @eaglegosuperskarmor 4 года назад +3

      @@dwavenminer depends on where the error is occurring, and if the system has ECC memory, since that can correct for bit flips

    • @eaglegosuperskarmor
      @eaglegosuperskarmor 4 года назад +4

      @@rogerkearns8094 I remember hearing about someone tweeting about a supercomputer, and they detected something like 200 bit flips per second? That's partially just due to the scale that they're dealing with. On the other hand, they also had Error Correcting Memory that protects them from the effects of bit flips. ECC memory is becoming even more common now but has been in use since before the 90s, more so in scientific or financial situations. As programmers we normally don't have to worry about them, and even in the situation where it's happened, a reboot is enough to fix it. Good old turn it off and on again...

    • @pauldavis2108
      @pauldavis2108 4 года назад +13

      @@rogerkearns8094 Bit flips really aren't as uncommon as you think the vast majority of times you won't even notice them though. The flip might be in unused memory, might be part of a masked off number, might be part of a comparison which still ends up as the same result. Even if it actually produces a functional change it might just manifest as something missaligned, a button that doesn't release, etc. I'm sure the average PC experiences 1-2 per year. I design hardware/software that operates in radiation enviroments so bitflips are far more common. I had one system that'd get a bitflip every few seconds before we hardened it. Even then it'd often run for over 20 minutes before we'd actually get a functional failure.

  • @swaree
    @swaree 4 года назад +423

    "I'm not an hex-pert"
    Why Matt, why

    • @martinrocket1436
      @martinrocket1436 4 года назад +15

      Sware, because he doesn't have 16 fingers.

    • @KuraIthys
      @KuraIthys 4 года назад +7

      Yes. 16 is a tricky one.
      If you count the segments on 4 fingers you get 12.
      Include the thumb in that you get 14
      Both hands together is thus 24 or 28
      However, a while ago I was introduced to a counting method from... Korea I think it was?
      You put your hands just above a table, then put your fingers on the table as if counting in binary.
      Using this method you can count to 32 on one hand. (and 1024 on two hands)
      Alternatively, you count how many fingers are touching the table, and then use the second hand as the '5's creating a base 5 system, letting you count to 5 on one and hand 25 using both...
      ... The fact that it's possible to use your fingers to count in binary is interesting though, isn't it?

    • @DerplingKing
      @DerplingKing 4 года назад

      @@KuraIthys personally I was always fond of the base 12 system with the second hand counting twelves which gets you up to 144 which is usually sufficient for counting without paper or a calculator.

    • @alexandermcclure6185
      @alexandermcclure6185 4 месяца назад

      @@DerplingKing Currently making an entire number system in base 12. You can count up to 20735 in one symbol because I doubled it up (count to 11 on right hand, one more rolls it over to 1 on left hand, 0 on right hand, if you had 11 on left hand before that it would roll over to the right hand of the person in front of you, etc.)

  • @shearnotspear
    @shearnotspear 4 года назад +636

    My favourite appearance of 256:
    In Civilisation 1 when Gandhi’s aggression score of 1 reduces by two and the game can’t handle it so it goes to 255.

    • @tommasomorandini1982
      @tommasomorandini1982 4 года назад +141

      And then he starts to nuke you. Hilarious bug I think 😂

    • @elietheprof5678
      @elietheprof5678 4 года назад +112

      That's what happens when people keep their emotions bottled up inside 😂

    • @its_w4yne
      @its_w4yne 3 года назад +141

      Best part: The developers didn't fix the bug but made it a feature. Now 'Nuking Gandhi' is a thing in all the sequels.

    • @TheAkashicTraveller
      @TheAkashicTraveller 3 года назад +51

      Turns out that's actually a myth. It's not true. Because Gandhi's aggression was so low he focused on other things like increasing his tech level and so he would develop nukes before everyone else.

    • @its_w4yne
      @its_w4yne 3 года назад +58

      I can tell you from experience that Gandhi is a nuking maniac even if he has the worst tech level of all players.

  • @jack_corvinus
    @jack_corvinus 3 года назад +41

    Man, times have changed.
    I think this is the first time I've seen something discussing why 256 is a common limit without mentioning Pac-Man.

    • @ferociousfeind8538
      @ferociousfeind8538 3 года назад +3

      Even better, you could mention the Legend of Zelda, your rupees are stored as an 8-bit integer, ranging from 0 to 255.
      Pretty much every game on, like, the NES, worked with numbers no larger than 8 bits, and often worked with smaller numbers, occasionally even just single bits for simply turning states on and off, and only coded eight of those states together as an 8-bit number to store it next to other 8 bit numbers in memory nice and neatly

    • @SkigBiggler
      @SkigBiggler 3 года назад +8

      @@ferociousfeind8538 NES was an 8bit machine, if they wanted to do larger integers they’d have to have done some wizardry storing larger numbers across multiple registers and doing slower non-native numerical operations on them.

  • @tncorgi92
    @tncorgi92 4 года назад +631

    Challenge: All the Stations, Geoff and Vicki.

    • @adigyran
      @adigyran 4 года назад +37

      I see, you are man of trains as well

    • @casperes0912
      @casperes0912 4 года назад +36

      That's be quite awesome ;). And Jay Foreman should do a song about 'em all

    • @snowfloofcathug
      @snowfloofcathug 4 года назад +16

      Casper S� Sung one syllable off of course

    • @KevFrost
      @KevFrost 4 года назад +4

      Drinking game?

    • @petermikhaylov
      @petermikhaylov 4 года назад

      YES OMG YES

  • @Xatzimi
    @Xatzimi 4 года назад +453

    You missed the other obvious solution: Zeno was driving the train and was trying to make infinite stops

    • @nurmr
      @nurmr 4 года назад +3

      but then why the -10?

    • @jsbrads1
      @jsbrads1 Год назад +1

      Well… Zeno wasn’t even close! 😡😂

  • @Bobstew68
    @Bobstew68 4 года назад +410

    Usually when you use 64 bits for storage (for example, a "long" in java), the minimum value is -2^63 and the maximum is 2^63-1 (encoded with two's complement). For almost all purposes, this is more desirable than having it range from 0 to 2^64. So it'd be stranger if the value was just below 2^64.
    The number that ends in 798 is what you get if you subtract 10 from Long.MIN_VALUE (or equivalent in another language), because many languages don't check for under- or overflows, they leave that to the programmer. So the algorithm might've set a variable to Long.MIN_VALUE at some point, perhaps to ensure that the instance doesn't get picked in a max comparison. And then the variable is modified by subtracting 10 (oops), and we end up with a huge number which does win the max comparison.
    OR, they set a variable to Long.MAX_VALUE to ensure it doesn't get picked in a min comparison, but a small number is added to this variable before the min comparison, the value overflows to become near Long.MIN_VALUE, wins the min comparison, and then a slightly bigger value is subtracted from the variable, and it underflows back near Long.MAX_VALUE.

    • @johnm2012
      @johnm2012 3 года назад +25

      "For almost all purposes" ... except for this one. An unsigned integer type is perfect for representing the number of stops on a journey, since it is totally impossible to have a negative number of them.

    • @galgirion3036
      @galgirion3036 3 года назад +14

      It's depressing to hear that those bugs still exist. They could be super easily eliminated by using proper types like std::optional/Option instead of initializing to a max value. Moreover, those algorithms shouldn't be implemented from scratch every time. We have zero cost iterators that implement ::max_by_key, ::find, etc. while being generic, expressive, verified and optimized.
      Sad to see that decades of research in programming languages is simply ignored. Static verification of those errors is easily achieved with Rust and cheap, not to say that it has an overwhelmingly positive ROI.

    • @deanmoncaster
      @deanmoncaster 3 года назад +2

      I was going to post this

    • @Jiffy_Park
      @Jiffy_Park 3 года назад +4

      @@chyza2012 where can I read about these laws?

    • @sgbench
      @sgbench 3 года назад +15

      @@johnm2012 Yes, the number of stops in a journey is semantically a positive integer, and the devs are probably well aware of that, but there are still valid reasons why they might have used a signed data type. Most likely, it was due to convention or habit. Or perhaps the implementation language doesn't provide unsigned numbers.

  • @burk3
    @burk3 3 года назад +47

    Two's complement is how all modern CPUs represent negative integers. I suspect you would find it super interesting. While it's slightly more complicated in representation than using one bit for a sign, it makes all of the actual calculation the CPU does much simpler by removing the need for any special casing for negatives.

    • @bettercalldelta
      @bettercalldelta 2 года назад +4

      I think that the reason we use two's complement and not a sign bit, is because 10000000 would be -0 which is a number that simply doesn't exist, so we wasted a potential combination. This does happen in IEEE 754 though, where the first bit is the sign. Apart from that if you used a sign bit you couldn't just easily add or subtract these numbers

  • @biancatherescuemouse3305
    @biancatherescuemouse3305 2 года назад +13

    Fun fact:
    Many systems use signed integers
    For example: Bejeweled 2's Score is stored in a 32 bit system, but because it's signed(the lead bit determines of the value is positive or negative), it only goes up to just over 2.147 Billion. If it tries to go over that value, the addition will flip the leading bit, causing the value to roll over to just under -2.147 Billion. You can then get back to 0 by scoring enough points (or hitting the hint button since it tries to make sure your score is at least 0), at which point it will count up with positive integers like normal.
    This happens in Bejeweled Twist as well, but Bejeweled 3 has some extra code that caps the score at 2^31-1, displaying "MAX SCORE" in its place.

  • @rikwisselink-bijker
    @rikwisselink-bijker 4 года назад +110

    RE: the joke at 5:15:
    there are 16 kinds of people, those who can count in hexadecimal and F the rest

    • @tomasstana5423
      @tomasstana5423 3 года назад +5

      So, you're saying there's 7 kinds of people who can count in hexadecimal, aye??

    • @rikwisselink-bijker
      @rikwisselink-bijker 3 года назад +2

      @@tomasstana5423 Determining the difference between those 7 kinds of people is left as an exercise to the reader.

    • @tomasstana5423
      @tomasstana5423 3 года назад +2

      @@rikwisselink-bijker Yeah, yeah, no problem, just wanted to be sure its not a typo ;)

    • @rikwisselink-bijker
      @rikwisselink-bijker 3 года назад +3

      @@tomasstana5423 To write a more serious reply: the joke gets a bit. Odd. If you write 10 kinds of people instead. It requires a higher level of familiarity with hexadecimal. So if you're in a group of people that regularly come in contact with hexadecimal notation you could say 10, but for a lay audience I would go for 16, as that further primes people to think of hexadecimal and contains an implied hint

    • @tomasstana5423
      @tomasstana5423 3 года назад +5

      @@rikwisselink-bijker I though we had a thing and you ruined it :(.
      But on also a more serious note - I am fully aware of your point, but I think that joke is anyway meant for those who can understand it (same as "10 types of people, those who can count in binary ..." joke).
      Because I think vast majority of people either understand it and would get the 10 instead of 16, or they would not understand it and the number 16 wont save that.
      Not a statistician, it is just my opinion, but you're the author and I must say, it is a nice one nonetheless :)

  • @custard131
    @custard131 4 года назад +29

    thats the version of the app that shows how many times the train will randomly stop for no obvious reason rather than the number of stations

  • @gferrol118
    @gferrol118 3 года назад +71

    "In minecraft you can't build a wall more than 256 blocks high"
    1.17: I'm about to end this man's whole career

    • @vibaj16
      @vibaj16 3 года назад +1

      gferrol118 I was looking for this comment

    • @gferrol118
      @gferrol118 3 года назад +4

      @El Xabi de Siempre no its from -64, to +320. So 384 blocks total

    • @gferrol118
      @gferrol118 3 года назад +3

      @El Xabi de Siempre the bottom of the world is now -64 instead of 0

    • @gferrol118
      @gferrol118 3 года назад +3

      @El Xabi de Siempre no, the bedrock has been lowered to -64. The layer at 0 is completely gone. I suggest just looking up a video from the most recent snapshot :P

    • @darealpoopster
      @darealpoopster 3 года назад

      @El Xabi de Siempre yes

  • @thenickstrikebetter
    @thenickstrikebetter 3 года назад +58

    I immediately had my theory when he showed that 9.2 quintillion was the compliment of 10 because i thought of how the number of stops was 10 off 2^63. I guessed that there were 10 stops, and then the app somehow showed the compliment of thag instead (which would be the 9.2 quintillion number).

  • @ed-vi
    @ed-vi 3 года назад +87

    Note: the Minecraft thing is a) about to be false (worlds are getting taller in 1.17) and b) chosen for performance reasons - Minecraft positions are Java "int"s of 32 bits, but the game processes entire "infinitely tall" "chunks", so capping block height limits how much stuff you can cram in a "chunk" to (theoretically) mitigate slowdowns.

    • @holysecret2
      @holysecret2 3 года назад +4

      Does that mean you can build 64 blocks below bedrock into the void?

    • @mooosje
      @mooosje 3 года назад +11

      @@holysecret2 as of 1.16 and below, the world went from 0 - 256. Below is void, and upwards is sky. Unable to build outside those numbers. In 1.17 however, this will be changed to -64 - 328.

    • @banggugyangu
      @banggugyangu 3 года назад +4

      @@mooosje this is a server setting specified in a file written to a 32 bit integer. You can theoretically extend the build height to 2.14 trillion blocks, though that will throw an exception when you launch the server. I've played on servers with 1024 build height, however, which runs fine.

    • @holysecret2
      @holysecret2 3 года назад +2

      @@mooosje that sounds epic, so now you can build structures below the world

    • @jamesmichael7528
      @jamesmichael7528 3 года назад +10

      @@holysecret2 -64 won't be below the world but instead be the new bedrock layer. They changed it so that they had more space for the new cave generation

  • @telotawa
    @telotawa 4 года назад +51

    you typically use a thing called two's complement (this is one's complement), where you flip it and add one BEFORE even doing any adding. it gives you the same result, because you add the one before addition instead of after it, but it's nicer because once it's stored, you don't have to keep track of if it's a negative number or not, you add it the same way
    oh and also it doesn't have a negative zero lol

    • @johnopalko5223
      @johnopalko5223 4 года назад +1

      As opposed to one's complement, which *does* have a negative zero. That one always left me scratching my head.

    • @howardbaxter2514
      @howardbaxter2514 4 года назад

      Or, the way I think of it, flip until you reach the last value of 1.

    • @Logarithm906
      @Logarithm906 4 года назад +1

      @@johnopalko5223 well i imagine a negative 0 in one's comp would look like 11111111 while a positive 0 would look lik 00000000

    • @johnopalko5223
      @johnopalko5223 4 года назад +1

      @@Logarithm906 Yep, that's it exactly. Still leaves you wondering why we need two flavors of zero.

    • @Logarithm906
      @Logarithm906 4 года назад +1

      @@johnopalko5223 Well that's why you use two's comp instead :). That way you only get one zero, plus it makes some binary calculations easier if i remember correctly (tbf the video may go into it, i can't remember).
      Edit: turns out the comment above goes into it, i love responding to comments in this little window...

  • @ultlifeform
    @ultlifeform 3 года назад +56

    In Pokémon, the maximum amount of Effort Values your critter can gain in a single stat used to be 255. However, this value was then divided by 4 and then floored, meaning anything beyond 252 was a waste of points that could be applied elsewhere. So in later games, the max was simply changed to 252. Also, the highest base stat in the series is Blissey's HP, at 255.

    • @EllipticalReasoning
      @EllipticalReasoning Год назад +8

      Tagging onto this two years later, the fact that that is hp is important. Eternatus-eternamax, a boss battle pokemon intended to be impossible for the player to obtain, has base 250 defense and special defense. With carefully allocated ev's and the relevant stat-boosting nature, it was possible to reach a defense or special defense stat that underflowed the attack damage computation, making eternatus functionally immune to either physical or special attacks. This absolutely destroyed the pure hackmons tier on showdown for a generation.

    • @ultlifeform
      @ultlifeform Год назад +2

      @@EllipticalReasoning That's interesting, because that's not much higher than Shuckle's Defense and Special Defense, at 230 each. I guess that extra 20 base points makes quite a difference.

    • @EllipticalReasoning
      @EllipticalReasoning Год назад

      @@ultlifeform yeah it's funny, I think the magic number was like 244 or 246.

  • @MTG_Music
    @MTG_Music 3 года назад +26

    2:27 minecraft 1.17: *laughs in 384 total blocks*

    • @paulstelian97
      @paulstelian97 3 года назад

      I wonder what the updated chunk format is like and how the conversion from old worlds will go...

    • @Zethneralith
      @Zethneralith 3 года назад +3

      ​@@paulstelian97 World height used to be 128 before they introduced the Anvil format. So hopefully it'll be at least as smooth as that transition. If I recall correctly, worlds didn't need to be rebuilt because of the height change, but more world generation changes came shortly thereafter.

  • @Hazearil
    @Hazearil 3 года назад +38

    "In Minecraft you cannot built a block over 256 blocks high."
    Minecraft 1.17 begs to differ.

    • @Fyngys
      @Fyngys 3 года назад +5

      This videos over a year old mate

    • @nagitokomaeda3237
      @nagitokomaeda3237 3 года назад

      Dude, nobody plays 1.9+

    • @Livestreamlurker
      @Livestreamlurker 3 года назад +1

      @@xX1infinityedge1Xx How dare they.

    • @22tfortnitevevo
      @22tfortnitevevo 3 года назад +2

      @@nagitokomaeda3237 i'd say that 1.16 is better than 1.8

  • @memofromessex
    @memofromessex 3 года назад +3

    Thanks for cheering me up, I've just come back from another disappointing date 😢

  • @VAXHeadroom
    @VAXHeadroom 4 года назад +10

    The discrepancy is between the internal representation coming from the system creating the numbers and the display software on the phone. Internally it's probably using a 63/64 bit signed integer but the display system is using a 64 bit unsigned integer. The internal system generates a count-down to your stop (-10) and generates the very large hexadecimal/binary number, and then the phone just displays that with out sign correcting it. Seen this before :)

    • @klafbang
      @klafbang 4 года назад

      That's not the whole explanation. Negative numbers in two's complement are > 2^63. -10 in two's complement would be 2^64-10 = 18.447 trillion. Something is also stripping the leading 1.

    • @VAXHeadroom
      @VAXHeadroom 4 года назад

      @@klafbang Probably. It's dang close to that :) Doing 63 bit hex math in my head on the weekend will never turn out well though :D

    • @Ethrel1024
      @Ethrel1024 4 года назад +1

      @@klafbang Probably something in the networking protocol, some clever programmer stripping off bits here and there to cut down on data usage and make every bit count.
      "Oh, there's a signed int here that, because of the nature of the real-world problem, is going to ALWAYS be positive? We don't need to send that sign bit, we can assume it on the client side!"

  • @Cr42yguy
    @Cr42yguy 4 года назад +28

    I was genuinely expecting a calculation of the required speed in multiples of c (not accounting for relativistic effects) to travel that many stops in 2.5 hours...so I did it myself:
    With a train station length of (just) 100 m and stations stacked end to end you would either need 3*10^12 seconds while traveling at c or 3.5*10^8 c to finish your journey in those 2.5 h. Impressive for a train!

    • @EwanMarshall
      @EwanMarshall 4 года назад +1

      An CS student immediately saw the number and said, signed integer underflow of 64bit somehow. Possibly bad conversion from unsigned with 2's complement.

    • @zockertwins
      @zockertwins 4 года назад +1

      That speed would approximately be c^2. Not bad for a train!

  • @robertzmirich9550
    @robertzmirich9550 4 года назад +193

    "This is the Sorcerer's Stone to the Philosophers Stone" lolol

    • @stephenbenner4353
      @stephenbenner4353 4 года назад +8

      Robert Zmirich Not quite as bad as that. That was quite an annoying alteration. On the other hand I find maths to math a much more pleasing alteration.

    • @jimporter
      @jimporter 4 года назад +16

      Stephen Benner oh yes the good old study of mathematic.

    • @CrystaTiBoha
      @CrystaTiBoha 4 года назад +4

      Or, you could say, a Parker Title. lolol

    • @Tfin
      @Tfin 4 года назад +8

      @@jimporter You can only say "math" is short for "mathematic" if you claim "mathematics" is plural. If it is, you need a singular, and "mathematic" becomes correct.

    • @macronencer
      @macronencer 4 года назад +8

      @@Tfin Do Americans shorten "statistics" to "stat"? I'm just curious...

  • @cloverberry721
    @cloverberry721 3 года назад +53

    Matt: You can’t build a wall more than 256 blocks tall in Minecraft
    Snapshot 21w06a: *Are you sure about that?*

    • @HNaledi123
      @HNaledi123 3 года назад +8

      Did not expect this comment to pop up here this quickly... wow

    • @theblinkingbrownie4654
      @theblinkingbrownie4654 3 года назад +2

      @@HNaledi123 yep crazy how fast stuff spreads over the internet

    • @cloverberry721
      @cloverberry721 3 года назад +3

      @@HNaledi123 Minecrafters be like: We...are...speed

    • @bene5431
      @bene5431 3 года назад

      Cubic chunks: boooring

    • @jordan-sh927
      @jordan-sh927 3 года назад

      This video is over a year old, do you think you are clever or something

  • @ibramgaunt885
    @ibramgaunt885 3 года назад +106

    About hitting 0 unexpectedly, that’s the reason on how the nuke happy gandhi in sid meiers civilisation started, in the first game he had an aggression level of 1, and he always goes for democracy which detracts 2 of the ai’s aggression level. Which would put him at -1 but it jumped him up to 255...
    Edit: I have been informed, it was intentional from the developer, not a bug.

    • @niccy266
      @niccy266 3 года назад +10

      myth

    • @ibramgaunt885
      @ibramgaunt885 3 года назад +1

      @@niccy266 you can look it up, it's how a hilarious running gag started.

    • @ultlifeform
      @ultlifeform 3 года назад +39

      @@ibramgaunt885 Actually, if you look it up, it really is just a myth. The code of the games doesn't support it, and it's been deconfirmed by multiple creators. It started with a baseless claim on TV Tropes 21 years after the game released, and spread like wildfire on the net. On the bright side, while it's not actually a good example of binary underflow, it IS a good example of the Mandela Effect. It was eventually included in Civilization 5 and 6 as a nod to the meme though.

    • @ibramgaunt885
      @ibramgaunt885 3 года назад +7

      May Mabie oh, looked it up again. Thanks for correcting the false information I had, i will edit the comment for people just scrolling through.

    • @ultlifeform
      @ultlifeform 3 года назад +2

      @@ibramgaunt885 No problem. I actually didn't know either, until just now. Saw a couple claims of it being myth in these comments, and figured it was time to investigate again. lol

  • @Raykkie
    @Raykkie 4 года назад +117

    Everybody's gangsta until the long scale says that there's only 9 trillions stops

    • @benjaminnewlon7865
      @benjaminnewlon7865 4 года назад +3

      _only_

    • @nadadada3938
      @nadadada3938 4 года назад

      is... is this a pun... this... is... I love it

    • @Tobberz
      @Tobberz 4 года назад +1

      @@epsi Old boi Britons used long scale too :D

    • @WaterShowsProd
      @WaterShowsProd 3 года назад +2

      Long live long scale!

    • @RH-ro3sg
      @RH-ro3sg 3 года назад +1

      @@epsi not just francophones. Most European countries and their former colonies still do, and even the British only moved over to the short scale in 1974.

  • @HickoryJ
    @HickoryJ 4 года назад +12

    I’m a software engineer, and this was immediately my suspicion hahahah

  • @JxH
    @JxH 4 года назад +21

    Re book: Although Canada is within North America, most Canadians would want the English version of the book.

    • @michaelsommers2356
      @michaelsommers2356 4 года назад +4

      @Memento Mori You mean the "English spelled correctly" version.

    • @lunasophia9002
      @lunasophia9002 4 года назад +7

      I think some of your countrymen would prefer the French version.

    • @Brooklyn-Manhattan
      @Brooklyn-Manhattan 4 года назад

      @SuperShadowChaos7
      Wait, what dafuk. I'm American and I spell Defence as Defence.

    • @Brooklyn-Manhattan
      @Brooklyn-Manhattan 4 года назад

      @SuperShadowChaos7
      * thinking noises *

  • @dtkedtyjrtyj
    @dtkedtyjrtyj 3 года назад +1

    My guess is a typo.
    Many languages use "||" to mean or; and it in high level languages has some interesting properties that make it useful for fallback.
    So you'd write "number_of_stops || 10 " to show number of stops normally, and 10 if we don't know number of stops for some reason.
    "|" on the other hand is the bitwise or operator; and does something entierly different.
    So, a simple typo, a code path that isn't very common and, BOOM, nine quintillion.
    PS For anyone wondering why you would use a 64-bit signed integer to store the number of train stops: well why wouldn't you?
    The actual number of train stops, and most other things you want to store will certainly fit into that space. Using 64-bit integers for _everything_ prevents overflow bugs, save the time it would take to decide what "kind of integer" it should be and is just generally the thing you do. Integers are just so pitifully small that there just is no reason to think about anything else today, except in very specific applications.

  • @michaelphelps2350
    @michaelphelps2350 3 года назад +2

    Paused at 4:03. Theory: It's a 64 bit SIGNED integer so the leftmost bit is used for the sign. There was underflow that made it wrap around to negative 9 trillion, but something in the program is ensuring the number remains positive.

  • @bunnygirl8
    @bunnygirl8 4 года назад +194

    When the F pun happened, I wasn't surprised, just disappointed.
    Disappointed at myself more than you, since I laughed for a solid 10 seconds.

    • @BobStein
      @BobStein 4 года назад +1

      Where is the F pun? I missed it.

    • @the_furf_of_july4652
      @the_furf_of_july4652 4 года назад +2

      Bob Stein The great thing about seeing this number in decimal is that it shows that this number is thoroughly effed.

    • @BobStein
      @BobStein 4 года назад

      @@the_furf_of_july4652 Got it! Like the Parker Square, in hexadecimal the number is **almost** thoroughly effed.

    • @subnormality5854
      @subnormality5854 4 года назад +6

      @@BobStein 5:13, can we get an f in the chat

    • @BobStein
      @BobStein 4 года назад +2

      @@subnormality5854 thank you. Classic Matt Parker understated humor.

  • @moopidoo
    @moopidoo 4 года назад +169

    When you float an idea and double down.

    • @danielb270
      @danielb270 4 года назад +27

      and then it takes too long
      seriously though, it is (Long.MAX_VALUE - 10)

    • @marklonergan3898
      @marklonergan3898 4 года назад +5

      Taking it a bit too far!

    • @aditya95sriram
      @aditya95sriram 4 года назад +9

      But whose idea was it to use a long to store the number of stops, wouldn't a short int have done the job ?

    • @BertGrink
      @BertGrink 4 года назад +5

      nice pun there mate. :)

    • @ZuppaD.Cipolle
      @ZuppaD.Cipolle 4 года назад +2

      @@aditya95sriram short and standard int nowadays are almost always equal ( it is up to the compiler but usually that's how it goes) the real question is why they decided to use a signed number lol

  • @hugovangalen
    @hugovangalen 4 года назад +4

    Gotta love powers of two. HP recently warned users to upgrade their SSDs before these crash after using them for 32.768 hours...

  • @LiamE69
    @LiamE69 4 года назад +49

    64 bit signed integer. To a computer nerd that stood straight out.

    • @rosuav
      @rosuav 4 года назад

      Except that that would give a value roughly twice as high. Misinterpreting a signed integer as unsigned gives a value near the unsigned maximum, not the signed maximum. Unless you have some other explanation for why the stop count was somewhere near the signed max?

    • @LiamE69
      @LiamE69 4 года назад +1

      @@rosuav No, the size of an unsigned 64 bit integer is c. twice that. That number is 9 off the maximum for s signed 64bit integer.

    • @rosuav
      @rosuav 4 года назад +1

      @@LiamE69 Yes. And if you were using a signed 64-bit integer, -10 would be represented as 0xfffffffffffffff6, identical to an unsigned integer very close to the top of the range. That's how signed integers work. So why would you be working with numbers close to the maximum for a signed integer? What's the justification for that?

  • @XanTheDragon
    @XanTheDragon 3 года назад

    I saw the thumbnail and I IMMEDIATELY knew what went wrong. That number is one I will pick out any day.

  • @coryman125
    @coryman125 4 года назад +19

    I'm now regretting not picking up the British copy of the book when I was at one of your shows. I didn't realise it would be a rare collector's item out here in Canada :P
    Also, I must say, the line "What are the chances of that? Quite high" really got me. It's the perfect blend of your subtle humour and your mathematical geekiness, all in a short throwaway line

  • @MrCheeze
    @MrCheeze 4 года назад +62

    My baseless theory: the software has some "sentinel values" that it uses to encode special situations and errors. To avoid being confused with legitimate quantities, they're defined as MAX_INT - 1, MAX_INT - 2, etc. That's why the value is slightly less than a power of 63, instead of the far more common slightly less than a power of 64.

    • @YourMJK
      @YourMJK 4 года назад +8

      MrCheeze I remember now when I once implemented Dijkstra's algorithm, I used MAX_INT to initialize the current shortest distance between two nodes.
      Maybe this error stems from their shortest-path-algorithm. But then again it wouldn't make sense that it's MAX_INT - 10…

    • @ChrisHarringtonMinneapolis
      @ChrisHarringtonMinneapolis 4 года назад +1

      What's the maximum native integer size on a 6502 anyway?

    • @gormster
      @gormster 4 года назад +3

      Alternate theory: there is a negative number that at some point is being “bounds checked” in the simplest possible way `num & INT_MAX`.

    • @IconOfCyn
      @IconOfCyn 4 года назад +1

      @@ChrisHarringtonMinneapolis 6502s have an 8 bit data bus with a 16 bit memory bus. The processor can natively compute with a number up to 255 with hardware, but there are ways to use software to implement larger values using multiple addresses.

    • @SimonClarkstone
      @SimonClarkstone 4 года назад +1

      @@YourMJK How about MIN_INT - 11?

  • @sethbushnell5051
    @sethbushnell5051 4 года назад +5

    Ten is the difference between 2^63 and the number we are looking at. The compliment of this number is ten, and the compliment of ten is the number we are taking if ten was encoded using zeroes to fill the "space" before it, obviously maxing out at 63/64 bits. If the system had to subtract ten stops because it had already made those stops to find the remaining stops, it is possible that the code didn't say to subtract from the total, so instead this was subtracted from the max available number. The other option is something that Matt mentioned with the rollover.

    • @chessthecat
      @chessthecat 8 месяцев назад

      Except it's not the compliment. It's the complement. 10 isn't paying compliments to 2^63 because she's a pretty number.

  • @thorndust5329
    @thorndust5329 3 года назад +6

    Minecraft now has a building limit over 256. Extended by 64 both directions in the y axis

  • @PixelBytesPixelArtist
    @PixelBytesPixelArtist 3 года назад +2

    Just an fyi, the minecraft build limit is not caused by binary. Powers of 2 appear a lot in Minecraft but its only thematic, to make it feel like its run on an older system. Minecraft Can handle numbers up to 65536 most of the time cause java usually (or used to) default their integers to under two bytes

  • @grshorwich
    @grshorwich 3 года назад +24

    "We changed a few words to make it easier for Americans to read" - You have no idea how hilarious that sounds to us Brits!

    • @wkehrman
      @wkehrman 3 года назад +4

      As an American....no, that tracks. Thanks, Matt.

    • @anyonewanttoplay7922
      @anyonewanttoplay7922 3 года назад

      perhaps its because we have separate slang

    • @EvanPederson
      @EvanPederson 3 года назад

      I know what he meant, but it did sound a bit condescending. 😂

  • @mlies37
    @mlies37 4 года назад +11

    When you described Neil Codling as “Twitter user” rather than “amazing musician” or something, my heart broke a little.

  • @MrTyler918273
    @MrTyler918273 4 года назад +4

    Other possibility:
    If this is calculating the best route (least stops or something) they could be calculating all of the routes into a list and then taking the minimum value of that list. Doing that can cause errors if the list is unexpectedly empty, so its common to throw the maximum possible value into the list (or use it as the initial accumulator in a fold/reduce).
    In Python that could look like:
    routes = getAllPossibleRoutes()
    routes.append(sys.maxsize)
    stopsLeft = min(routes) - stopsAlreadyPassed()
    or in Haskell:
    stopsLeft = foldl min maxBound getAllPossibleRoutes - stopsAlreadyPassed
    Which, if getAllPossibleRoutes fails for some reason and returns an empty list and stopsAlreadyPassed returns 9, gives you the number we see here.

  • @bigiron9393
    @bigiron9393 4 года назад +1

    So, 9,223,372,036,854,775,798 is super close to 2^63 (9,223,372,036,854,775,808)
    Their difference is 10, so my guess is, during their travel, the app may have seen 0 stops between initially, but the train made 11 stops, causing the roll over. The reason it would be 11 extra stops would be counting for the roll over.

  • @aeugh4200
    @aeugh4200 8 месяцев назад +1

    what i think (the first second without having watched the video)
    - number = 2^63 -10
    - number saved in a 64 byte package (binary)
    - 1 byte for identification
    => 1 byte off that is 2^63 combinations (incl. 0)
    => max = 2^63 -1
    - -1 is computed as that
    - 9 Stops have been passed, each subtracting one
    => results in number

  • @mebamme
    @mebamme 4 года назад +161

    This comment contains a "Parker train" joke to save you the hassle of making your own.

    • @GvinahGui
      @GvinahGui 4 года назад +18

      Thanks, I wanted to make a Parker Train joke but I was too lazy for it. You saved me the hassle, thank you again.

    • @IceMetalPunk
      @IceMetalPunk 4 года назад +9

      @@GvinahGui Is that a Parker Train Parker Joke?

    • @donkosaurus
      @donkosaurus 4 года назад +6

      @@IceMetalPunk more of a parker parker train joke joke

    • @jaspermay5813
      @jaspermay5813 4 года назад +5

      @@donkosaurus It's a Parker 'Parker train' joke.

    • @BobStein
      @BobStein 4 года назад +1

      @@jaspermay5813 So, a Parker Train Joke ... *squared?*

  • @DancingRain
    @DancingRain 4 года назад +5

    The subroutine that formats the number might be ignoring sign, because they never expected a negative value.

  • @deanmoncaster
    @deanmoncaster 3 года назад +4

    On southern rail this is quite feasible due to the sheer number of breakdowns you need to expect.

  • @cobaltbluesky2276
    @cobaltbluesky2276 10 месяцев назад +1

    as a massive minecraft nerd i can't help but comment when he mentions minecraft. since the height limit has increased and is now able to be changed, it's not an example of an 8 bit binary number being used anymore. a good one though, would be that you can't set an enchantment level higher than 255. It used to be that if you did, lots of things related to the enchantment would break, but now it's just not allowed, and attempting to set it higher than 255 just makes it level 255.

  • @Nik-dz1yc
    @Nik-dz1yc Год назад

    signed numbers in computing is actually a quite simple system that I ended up accidentally rediscovering myself and what's so nice about them is that you don't actually need to treat them any differently than unsigned numbers. Basically it relies on the fact that since numbers take up a limited space (for example 32 bits / digits) and because of that, once you add two numbers, you get an overflow. For example, if we only stored one digit for numbers, adding 5 + 5 would be 10 which would overflow and end up as 0. The key observation is that adding 9 to anything effectively subtracts 1 so 9 is in a state where it's both 9 and also -1. If we called 5 the start of the negative values, we could have -5 up to 4 but for computers, it's very simple to just use the leftmost digit since it's only either 0 or 1

  • @MsNosis
    @MsNosis 4 года назад +70

    very short stops though, since the trip still only takes a couple of hours.

    • @pixymisa8087
      @pixymisa8087 4 года назад +9

      Welcome to Zeno Railways!

    • @MsNosis
      @MsNosis 4 года назад +3

      ps. if I estimated correctly, even if every stop only lasts for a single millisecond, it will still take about 4 billion years to reach the end station...

    • @RevCode
      @RevCode 4 года назад +2

      @@Peter_1986 Could you calculate the acceleration forces you would feel, since the train would have to essentially stop and speed up immediately? I Imagine quite a lot of headbanging and concussions going on there

    • @RevCode
      @RevCode 4 года назад

      @@Peter_1986 Thank you very much. I wish I could remember my physics lessions from school better, but since i only create some boring office software i practically had to never look back into it and now i dont even know how to start :/

    • @jeremydavis3631
      @jeremydavis3631 4 года назад +3

      @@Peter_1986 I don't think there would be any headbanging, since the train would be speeding up and slowing down so quickly. Kind of like (although this probably isn't the best analogy) if a light flickers quickly enough, it seems not to flicker at all. The train may undergo 8 quadrillion G, but the squishy humans inside, who aren't even attached to their seats, will continue to travel at the train's average velocity, perhaps feeling a slight vibration but nothing more.
      All that said, I would like to know what material this train is made of and how much fuel it needs. :)

  • @Aviertje
    @Aviertje 4 года назад +32

    You made the 7/F thing sound a lot more complicated than it needs to be. Hexadecimal notation represents every 'nibble' (which is four bits) with a character. 7=0111, F=1111. In order words, the sign bit was not set, and that is why you got a 7 in that position.

    • @SreenikethanI
      @SreenikethanI Год назад +2

      same thought, but he did mention he's probably not quite immersed into bits and hex digits and all those (even considering how he grouped hex digits every 3 places instead of every 2 or 4 places) etc

    • @dubl33_27
      @dubl33_27 10 месяцев назад

      I mean i kinda had an idea of what he was saying there but this comment made it much clearer, thanks

  • @yashrawat9409
    @yashrawat9409 2 года назад +5

    0:17
    A valid cause for concern
    *Of course*

  • @LimitedWard
    @LimitedWard 3 года назад +2

    I suspect what happened was a combination of two things:
    1. They subtracted in the wrong order. If the stops are numbered (e.g. stop A = 10 and stop B = 14) then they accidentally did A - B instead of B - A.
    2. The calculation for the number of stops uses a 64-bit *signed* integer while the code used to display the number of stops in the UI expected a 64-bit *unsigned* integer.
    The first mistake produces a small negative number representing the number of stops away. The second mistake displays that small negative number as it's 64-bit 2s complement.

    • @paulstelian97
      @paulstelian97 3 года назад

      A new comment that doesn't argue about Minecraft? *HOW*

    • @paulstelian97
      @paulstelian97 3 года назад

      Also small negative presented as positive would be around 2^64, not 2^63 as in this case.

  • @GUIHTD
    @GUIHTD 4 года назад +26

    So when is "Humble Parker - When Matt Goes Wrong in the Real World" coming out?

  • @jtn2002
    @jtn2002 4 года назад +25

    The american book it probably missing a few "u"'s as well....

    • @ElectroDFW
      @ElectroDFW 3 года назад +1

      They do it to hmor s. 😁

  • @sethberry9185
    @sethberry9185 3 года назад +6

    “I’m gonna be a little late to work. How late? Well my train has to make a few stops before mine...”

  • @StefanVeenstra
    @StefanVeenstra 3 года назад +2

    For the long system:
    9 Trillion
    223 Billiard
    372 Billion
    36 Milliard
    854 Million
    775 Thousand
    798 stops.

  • @andreasjoannai6441
    @andreasjoannai6441 11 месяцев назад

    4:05 You missed a very important detail. 2^63-1 is the maximum limit for a SIGNED 64-bit integer. That means that the number includes both positive and negative values. In this case, it spans from -2^63, or -9,223,372,036,854,775,808 to 2^63-1, or 9,223,372,036,854,775,807. If it were a 63-bit integer, that means it would be an unsigned integer. So the number of stops had to already be negative in the first place for this to even have the possibility of rolling over to 2^63-1.

  • @mallorystrom7511
    @mallorystrom7511 3 года назад +16

    i learned “check if the weird big number is a power of two” from humble pi

  • @_jb_3441
    @_jb_3441 3 года назад +3

    "we can see that this number is really F-ed"
    That broke me :D

  • @gaellafond6367
    @gaellafond6367 4 года назад +7

    8:45 The way you say it, it really sounds like the book needed to be "dummyfied" for Americans...

    • @inkyscrolls5193
      @inkyscrolls5193 4 года назад +2

      It does.

    • @vibaj16
      @vibaj16 3 года назад

      Inky Scrolls No, more of a dialect change

    • @CTGReviews
      @CTGReviews 10 месяцев назад +2

      @@inkyscrolls5193it didn’t dude wth

  • @steptimusheap8860
    @steptimusheap8860 4 года назад +1

    9 quintillion ia the 64 bit java integer limit. Aka, highest raw numbers that java can use usually.
    This is because it's 2^(64-1)-1. 9 quintillion for positive numbers, 9 quintillion for negative numbers, 1 for 0. You gotta be able to use negative numbers usually. So there really are 2^64 numbers possible

  • @classymuffin4589
    @classymuffin4589 3 года назад +1

    It's a 64 bit system. The reason why it only goes up to the 63 bit integer limit is because the last bit is used to identify whether the number is positive or negative. This is two's complement. It's also the same reason why you actually see the value of the 31 bit integer limit when a 32 bit value messes up, like in Hearthstone when you stack buffs too high or in Skyrim when you loop alchemy and enchanting.

  • @sethsims7414
    @sethsims7414 4 года назад +4

    computers use two's compliment rather than one's complement for subtraction. So the number is inverted then one added to it. Most likely they are mixing signed and unsigned integers. They probably are using a signed integer to keep the number of stops but overshot zero and went negative. Then they used sprintf or something similar to format the number as an unsigned integer. I'm guessing this program was written in C or C++. There aren't many languages that would do this without screaming bloody murder at the type mismatch.

    • @YourMJK
      @YourMJK 4 года назад

      Seth Sims Still doesn't make sense.
      If they accidentally went negative, the number would have a 1 at the highest bit (which 2^63-10 doesn't). Interpreted as a signed integer it would just be a small negative value and if interpreted as an unsigned integer it would rather be close to 2^64 (like Matt said).

  • @Nejvyn
    @Nejvyn 4 года назад +7

    "So there you are! What are the chances? ... Quite high." ¯\_(ツ)_/¯
    I lol'd

  • @freezingfusion
    @freezingfusion Год назад +3

    256 bricks high 💀

  • @mo2cubing
    @mo2cubing 11 месяцев назад +1

    Oh the days...
    2:33 now the build height for a wall is 384 blocks, BUT it's important to note that it's not altogether different since it's 3 * 2^7. The only difference now is 64 blocks upwards and 64 blocks downwards via negative y values.

  • @ferretyluv
    @ferretyluv 3 года назад +1

    Every time you talk about powers of 2, I think of your praise of the game 2068.

  • @poisonpotato1
    @poisonpotato1 4 года назад +4

    3:25 it’s a Parker Theory

  • @Wordsnwood
    @Wordsnwood 4 года назад +5

    Well I'm sure glad I ordered the British edition then, as we don't want none of them Zee's up here in Canada!

  • @TheOfficialCzex
    @TheOfficialCzex 4 года назад +7

    1:54 Matt briefly channels his inner Chewbacca.

    • @ebanavorio
      @ebanavorio 4 года назад

      And I just was thinking about Star Wars, given the colour of the onscreen text. Star Wars light blue.

  • @BBall0027
    @BBall0027 9 месяцев назад

    4:33 That explains the negative bolts glitch in the second Ratchet & Clank game (Going Commando in the US, Locked and Loaded in Europe). The game's bolt counter is a 31-bit number so when you surpassed 2,147,483,647 bolts, it would loop down to -2,147,483,647, something that happened to a lot of people, because due to the game's two crystal collecting side missions and the addition to a bolt multiplier if you don't take damage in Challenge Mode, it became a lot easier to earn billions of bolts, where the original took multiple Challenge Mode playthroughs just to earn 1 million.

  • @devlinw4735
    @devlinw4735 Год назад +1

    6:12 that makes so much sense because the original number of stops was 10 off the 2 to power 63 number

  • @samtherat6
    @samtherat6 3 года назад +5

    0:41
    Man, Matt is amazing. I was halfway through him reading the number above his head, before realizing he wasn’t actually reading the number above his head.

  • @jacobtinkle9686
    @jacobtinkle9686 2 года назад +3

    Correction: you now can build higher that 255 blocks in minecraft

  • @YuvrajHanspal
    @YuvrajHanspal 4 года назад +7

    That shade at the end about the crappy American English 🤣🤣🤣

  • @Lorenzo-tm2cr
    @Lorenzo-tm2cr 4 года назад

    Fun fact: in italian a quintillion is waaaay much bigger than in english. This is because we use milione (translated to million) for 10^6, but we have another unit, miliardo, for 10^9. So we have milione (10^6), miliardo (10^9), bilione (10^12), biliardo (10^15), trilione (10^18), triliardo (10^21) and so on... a quintilion (quintilione in italian) happens to be 10^30 while in english it's just 10^18

  • @Tenajeh
    @Tenajeh 2 месяца назад +1

    As a millenial unable to buy a house, I want a train home. Doesn't even need to move. Just be home. 🥺

  • @davros_adl8155
    @davros_adl8155 3 года назад +3

    If on average the time between stops was 10min then the ride would take 18 quintillion years.

  • @sorio99
    @sorio99 4 года назад +36

    So, I’m thinking they were actually 10 stops away. Right?

    • @JNCressey
      @JNCressey 4 года назад +10

      Or maybe 10 steps into their journey but it started keeping track counting from 0 instead of the real number.

  • @JohanniklasLp
    @JohanniklasLp 3 года назад +6

    "In Minecraft, you can't build a wall more than 256 Blocks high."
    Not anymore. We have more Blocks now.

  • @plumber1337
    @plumber1337 4 года назад +2

    14 Fs in the same number, so much respect.

  • @kingacrisius
    @kingacrisius 3 года назад +2

    2:30 Outdated info, height limit is now 320. Total height is 384 (coordinates go down to -64)

  • @M104-q9y
    @M104-q9y 4 года назад +34

    But if it was a signed 64 bit number, surely it wouldn't underflow after zero, it would just go into negative values?

    • @tinldw
      @tinldw 4 года назад +33

      Yeah, but then you interpret and print it as if it was an unsigned number and get quintillions

    • @tinldw
      @tinldw 4 года назад +17

      But in this case, it is not that simple. -10 would look like 18 quintillions, not 9.
      There's actually no difference for the arithmetic unit whether you add/subtract signed or unsigned integers.

    • @ZipplyZane
      @ZipplyZane 4 года назад +16

      It would. But then what if that negative number is used by something that expects a positive number, and thus only looks at the other 63 bits, ignoring the sign bit?
      Or, in other words, what happens with a negative 64-bit signed integer if you simply flip the sign bit to 0? You get a large positive 63-bit number.

    • @cold1ava
      @cold1ava 4 года назад +3

      @@ZipplyZane but that's not how computers work. When you interpret the negative number as unsigned it interprets the signed bit as a value of 1 and sees positive 18 quintilion

    • @ZipplyZane
      @ZipplyZane 4 года назад +4

      @@cold1ava Don't know what to tell ya. It is indeed how they work sometimes. From oddities when coaxing values to a bad abs() function to working with numbers at the bit level. Plenty of ways to cause that sign but to get flipped or ignored.