Help, our train home is making 9 quintillion stops.

Поділитися
Вставка
  • Опубліковано 5 січ 2025

КОМЕНТАРІ • 2,3 тис.

  • @No-uc6fg
    @No-uc6fg 3 роки тому +5190

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

    • @The_Bird_Bird_Harder
      @The_Bird_Bird_Harder 3 роки тому +204

      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 роки тому +56

      @@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 роки тому +244

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

    • @jakubrossa7794
      @jakubrossa7794 3 роки тому +68

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

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

      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 4 роки тому +4173

    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 роки тому +235

      It's always nice to see a Stryder fan

    • @knickohr01
      @knickohr01 3 роки тому +330

      And hitting a block for 416 years crashes the game

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

      @@knickohr01 ikr

    • @FandangoJepZ
      @FandangoJepZ 3 роки тому +25

      And bonking for a few minutes wins the game

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

      stryder7x gang

  • @Gasmanic
    @Gasmanic 5 років тому +10848

    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 5 років тому +441

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

    • @SuperFranzs
      @SuperFranzs 5 років тому +407

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

    • @meowthecat422
      @meowthecat422 5 років тому +698

      @@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 5 років тому +324

      @@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 5 років тому +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 роки тому +1348

    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 роки тому +67

      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 2 роки тому +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).

  • @Interesting_Failure
    @Interesting_Failure 3 роки тому +367

    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 3 роки тому +20

      You deserve all the likes

    • @handuo6301
      @handuo6301 Рік тому +8

      A train quantum wave packet!

    • @denelson83
      @denelson83 Рік тому +4

      As in sub-Planck length?

    • @Alolyn
      @Alolyn Рік тому +4

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

  • @leefisher6366
    @leefisher6366 5 років тому +5250

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

    • @davidmurray3542
      @davidmurray3542 5 років тому +448

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

    • @jamespolland958
      @jamespolland958 5 років тому +356

      @@davidmurray3542 and I would argue that it is

    • @herbert164
      @herbert164 5 років тому +27

      @@jamespolland958 so where would they fit?

    • @jamespolland958
      @jamespolland958 5 років тому +423

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

    • @herbert164
      @herbert164 5 років тому +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?

  • @kylecobb9982
    @kylecobb9982 5 років тому +3286

    A stop every 10 femtometres or something like that

    • @InTheBeginningTheUniverseWas
      @InTheBeginningTheUniverseWas 5 років тому +281

      over a quadrillion stops per second

    • @Lovuschka
      @Lovuschka 5 років тому +157

      Which means it's over 9000.

    • @pyral514
      @pyral514 5 років тому +36

      @@Lovuschka Which mean it's over 1.

    • @Symphony_
      @Symphony_ 5 років тому +5

      @@Lovuschka actually that was 8000 not 9 , XD

    • @Lovuschka
      @Lovuschka 5 років тому +44

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

  • @AalbertTorsius
    @AalbertTorsius 5 років тому +3941

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

    • @Henrix1998
      @Henrix1998 5 років тому +511

      Probably 10 or 11

    • @JesperDramsch
      @JesperDramsch 5 років тому +394

      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 5 років тому +126

      @@Henrix1998 Is that 2 or 3?

    • @m1lkweed
      @m1lkweed 5 років тому +439

      ~9 quintillion

    • @OlafDoschke
      @OlafDoschke 5 років тому +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

  • @tinybabybread
    @tinybabybread 3 роки тому +891

    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 роки тому +122

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

    • @Imrooniel
      @Imrooniel Рік тому +44

      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.

  • @thenoone
    @thenoone 3 роки тому +1178

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

    • @lestaironblack1259
      @lestaironblack1259 3 роки тому +99

      The universe is expanding.

    • @bene5431
      @bene5431 3 роки тому +69

      *evil-laughs in cubic chunks*

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

      21

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

      Wait, they are letting you build higher now?

    • @thenoone
      @thenoone 3 роки тому +45

      @@rhysbaker2595 Yes. You can build up to 320 blocks, and down to negative 64 blocks

  • @hadz8671
    @hadz8671 5 років тому +1767

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

    • @Lattamonsteri
      @Lattamonsteri 5 років тому +30

      Duuuuuude :D awesome!

    • @anasorabi123
      @anasorabi123 5 років тому +32

      Wonder if it was on purpose

    • @sebastianjost
      @sebastianjost 5 років тому +126

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

    • @RFC3514
      @RFC3514 5 років тому +99

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

    • @GFmanaic
      @GFmanaic 5 років тому +27

      Should be named Humble half Tau

  • @asi.izzygizmic
    @asi.izzygizmic 5 років тому +1404

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

    • @Awkwerp
      @Awkwerp 5 років тому +312

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

    • @kilvesx7924
      @kilvesx7924 5 років тому +13

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

    • @asi.izzygizmic
      @asi.izzygizmic 5 років тому +41

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

    • @davidmurray3542
      @davidmurray3542 5 років тому +173

      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 5 років тому +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

  • @hikaruyoroi
    @hikaruyoroi 5 років тому +1105

    That's just a bit shorter than a CVS receipt

    • @YingwuUsagiri
      @YingwuUsagiri 5 років тому +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 5 років тому +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 5 років тому +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 5 років тому +6

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

    • @nurmr
      @nurmr 5 років тому +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.

  • @swaree
    @swaree 5 років тому +431

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

    • @martinrocket1436
      @martinrocket1436 5 років тому +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 8 місяців тому

      @@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.)

  • @Bananasforthesoul
    @Bananasforthesoul 5 років тому +518

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

    • @tlh1337
      @tlh1337 5 років тому +67

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

    • @Bananasforthesoul
      @Bananasforthesoul 5 років тому +31

      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 5 років тому +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.

  • @Green0Photon
    @Green0Photon 5 років тому +1854

    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 5 років тому +15

      A word is 4 bytes no?

    • @Squossifrage
      @Squossifrage 5 років тому +70

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

    • @Idran
      @Idran 5 років тому +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 5 років тому +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 5 років тому +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.

  • @IceMetalPunk
    @IceMetalPunk 5 років тому +713

    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 5 років тому +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 5 років тому +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 5 років тому +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 5 років тому +4

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

    • @Eugenethemooer1Wolffe
      @Eugenethemooer1Wolffe 5 років тому +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 5 років тому +485

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

    • @dwavenminer
      @dwavenminer 5 років тому +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 5 років тому +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 5 років тому +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 5 років тому +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 5 років тому +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.

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

    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.

  • @shearnotspear
    @shearnotspear 5 років тому +641

    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 роки тому +113

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

    • @its_w4yne
      @its_w4yne 4 роки тому +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 4 роки тому +53

      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 4 роки тому +59

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

  • @tncorgi92
    @tncorgi92 5 років тому +633

    Challenge: All the Stations, Geoff and Vicki.

    • @adigyran
      @adigyran 5 років тому +37

      I see, you are man of trains as well

    • @casperes0912
      @casperes0912 5 років тому +36

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

    • @snowfloofcathug
      @snowfloofcathug 5 років тому +16

      Casper S� Sung one syllable off of course

    • @KevFrost
      @KevFrost 5 років тому +4

      Drinking game?

    • @petermikhaylov
      @petermikhaylov 5 років тому

      YES OMG YES

  • @Bobstew68
    @Bobstew68 5 років тому +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.

  • @telotawa
    @telotawa 5 років тому +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 5 років тому +1

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

    • @howardbaxter2514
      @howardbaxter2514 5 років тому

      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...

  • @burk3
    @burk3 3 роки тому +48

    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

  • @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).

  • @Xatzimi
    @Xatzimi 5 років тому +457

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

    • @nurmr
      @nurmr 5 років тому +3

      but then why the -10?

    • @jsbrads1
      @jsbrads1 Рік тому +1

      Well… Zeno wasn’t even close! 😡😂

  • @custard131
    @custard131 5 років тому +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

  • @biancatherescuemouse3305
    @biancatherescuemouse3305 3 роки тому +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.

    • @rtxagent6303
      @rtxagent6303 2 місяці тому

      For some reason I have the 2147483648 number memorized

  • @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.

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

    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.

  • @rikwisselink-bijker
    @rikwisselink-bijker 5 років тому +112

    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 :)

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

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

  • @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

    • @Th3GingerOne
      @Th3GingerOne 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

  • @MTG_Music
    @MTG_Music 3 роки тому +27

    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.

  • @mo2cubing
    @mo2cubing Рік тому +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.

  • @robertzmirich9550
    @robertzmirich9550 5 років тому +193

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

    • @stephenbenner4353
      @stephenbenner4353 5 років тому +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 5 років тому +16

      Stephen Benner oh yes the good old study of mathematic.

    • @CrystaTiBoha
      @CrystaTiBoha 5 років тому +4

      Or, you could say, a Parker Title. lolol

    • @Tfin
      @Tfin 5 років тому +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 5 років тому +8

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

  • @VAXHeadroom
    @VAXHeadroom 5 років тому +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 5 років тому

      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 5 років тому

      @@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 5 років тому +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!"

  • @sethbushnell5051
    @sethbushnell5051 5 років тому +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 Рік тому

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

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

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

  • @aeugh4200
    @aeugh4200 Рік тому +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

  • @Raykkie
    @Raykkie 5 років тому +117

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

    • @benjaminnewlon7865
      @benjaminnewlon7865 5 років тому +4

      _only_

    • @nadadada3938
      @nadadada3938 5 років тому +1

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

    • @Tobberz
      @Tobberz 5 років тому +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.

  • @coryman125
    @coryman125 5 років тому +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

  • @hugovangalen
    @hugovangalen 5 років тому +4

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

  • @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

  • @retep8891
    @retep8891 5 років тому

    I am glad the book is coming out in America, but I couldn't wait. Bought one of your autographed copies from your store earlier this year

  • @moopidoo
    @moopidoo 5 років тому +169

    When you float an idea and double down.

    • @danielb270
      @danielb270 5 років тому +27

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

    • @marklonergan3898
      @marklonergan3898 5 років тому +5

      Taking it a bit too far!

    • @aditya95sriram
      @aditya95sriram 5 років тому +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 5 років тому +5

      nice pun there mate. :)

    • @ZuppaD.Cipolle
      @ZuppaD.Cipolle 5 років тому +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

  • @Cr42yguy
    @Cr42yguy 5 років тому +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 5 років тому +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 5 років тому +1

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

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

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

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

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

  • @DancingRain
    @DancingRain 5 років тому +5

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

  • @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

  • @HickoryJ
    @HickoryJ 5 років тому +12

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

  • @MsNosis
    @MsNosis 5 років тому +70

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

    • @pixymisa8087
      @pixymisa8087 5 років тому +9

      Welcome to Zeno Railways!

    • @MsNosis
      @MsNosis 5 років тому +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 5 років тому +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 5 років тому

      @@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 5 років тому +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. :)

  • @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

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

    Dude, I just love your videos. Can't wait to see you hit 1 million subs. Have a great 2022!

  • @JxH
    @JxH 5 років тому +21

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

    • @michaelsommers2356
      @michaelsommers2356 5 років тому +4

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

    • @lunasophia9002
      @lunasophia9002 5 років тому +7

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

    • @Brooklyn-Manhattan
      @Brooklyn-Manhattan 5 років тому

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

    • @Brooklyn-Manhattan
      @Brooklyn-Manhattan 5 років тому

      @SuperShadowChaos7
      * thinking noises *

  • @MrCheeze
    @MrCheeze 5 років тому +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 5 років тому +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 5 років тому +1

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

    • @gormster
      @gormster 5 років тому +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 5 років тому +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 5 років тому +1

      @@YourMJK How about MIN_INT - 11?

  • @MrTyler918273
    @MrTyler918273 5 років тому +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.

  • @BryndanMeyerholtTheRealDeal
    @BryndanMeyerholtTheRealDeal Рік тому +1

    2'30 Correction: It is 320 blocks tall plus 64 more blocks from Y=0, for a total of 384 blocks tall since 1.18

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

      This video was made in 2019, a few weeks before the release of 1.15

  • @NickDrian
    @NickDrian Рік тому +1

    signed integers do not typically use the top bit to represent negatives. that would be called signed magnitude. signed integers instead use 2's compliment which is a bit more complicated. Anyway, this is probably a combination of underflow and bit casting.

  • @LiamE69
    @LiamE69 5 років тому +49

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

    • @rosuav
      @rosuav 5 років тому

      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 5 років тому +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 5 років тому +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?

  • @GUIHTD
    @GUIHTD 5 років тому +26

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

  • @bunnygirl8
    @bunnygirl8 5 років тому +195

    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 5 років тому +1

      Where is the F pun? I missed it.

    • @the_furf_of_july4652
      @the_furf_of_july4652 5 років тому +2

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

    • @BobStein
      @BobStein 5 років тому

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

    • @subnormality5854
      @subnormality5854 5 років тому +6

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

    • @BobStein
      @BobStein 5 років тому +2

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

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

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

  • @cobaltbluesky2276
    @cobaltbluesky2276 Рік тому +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.

  • @ibramgaunt885
    @ibramgaunt885 3 роки тому +107

    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

  • @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

  • @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...”

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

    It's 10 higher than 2^63 and it's the binary compliment of 10. I bet the real number of stops is 10

  • @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

  • @Aviertje
    @Aviertje 5 років тому +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 Рік тому

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

  • @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

  • @Wordsnwood
    @Wordsnwood 5 років тому +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!

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

    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.

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

    2:28 nope, have you heard of cubic chunks? it allows the build height to be positive or negative the max 64 bit integer
    the reason its 255 is because any higher then it could cause lag, hence why the nether/hell dimention is 128

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

      Thomas Harper well, now it’s 384. Also, nether was (idk if the nether height changed in 1.17) the same: 256. Also, he was allying about vanilla.

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

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

  • @jtn2002
    @jtn2002 5 років тому +25

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

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

      They do it to hmor s. 😁

  • @mebamme
    @mebamme 5 років тому +161

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

    • @GvinahGui
      @GvinahGui 5 років тому +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 5 років тому +9

      @@GvinahGui Is that a Parker Train Parker Joke?

    • @donkosaurus
      @donkosaurus 5 років тому +6

      @@IceMetalPunk more of a parker parker train joke joke

    • @jaspermay5813
      @jaspermay5813 5 років тому +5

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

    • @BobStein
      @BobStein 5 років тому +1

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

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

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

  • @steptimusheap8860
    @steptimusheap8860 5 років тому +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

  • @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. 😂

  • @sorio99
    @sorio99 5 років тому +36

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

    • @JNCressey
      @JNCressey 5 років тому +10

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

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

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

  • @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.

  • @JohnVanderbeck
    @JohnVanderbeck 2 місяці тому +1

    I'm not a maths person, I'm a software engineer. The FIRST thing you should do when you see weird numbers like this come out of a computer is look up what the max value is for a given data time. In this case you are right around the maximum value of a signed long integer. Long is a datatype that is 64bits and as Matt says uses one bit for the sign. Meaning it cane be between -9,223,372,036,854,775,808 and +9,223,372,036,854,775,808.
    A common bug is to wrap or overflow this number. 65,536 is a very common one from the 16bit days.

  • @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.

  • @gaellafond6367
    @gaellafond6367 5 років тому +7

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

    • @inkyscrolls5193
      @inkyscrolls5193 5 років тому +2

      It does.

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

      Inky Scrolls No, more of a dialect change

    • @CTGReviews
      @CTGReviews Рік тому +2

      @@inkyscrolls5193it didn’t dude wth

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

    256 bricks high 💀

  • @jcortese3300
    @jcortese3300 Рік тому +1

    Only saw this just now -- all I want to know is why they need a 63-bit number to run a train. What could a train service provider possibly have 9 quintillion of that they need to keep track of?

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

    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.

  • @Nejvyn
    @Nejvyn 5 років тому +7

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

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

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

  • @Lord_Skeptic
    @Lord_Skeptic 2 місяці тому +3

    5:16 there are 10 types of people.
    Those who understand hexadecimal and f the rest.

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

    5:35 modern computers (i.e. since c1980s) use "two's complement" to represent negative numbers since that doesn't require the messy step of having to add one because that's handled as part of the negation operation. The "two's complement" algorithm is flip all the bits and then add one, note this works because the bit representation of the negative number when interpreted as an unsigned integer is congruent with the negative number modulo 2^64, in other words this works because computers implicitly use modulo arithmetic.

  • @wesleymays1931
    @wesleymays1931 Рік тому +1

    Correction at around [2:30]:
    While what you said was true at the time of recording, Minecraft's hard limit is mostly removed. If I recall, the new default limit is 2048 blocks, and can be changed in the configuration of a given world.

  • @YuvrajHanspal
    @YuvrajHanspal 5 років тому +7

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

  • @M104-q9y
    @M104-q9y 5 років тому +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 5 років тому +33

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

    • @tinldw
      @tinldw 5 років тому +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 5 років тому +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 5 років тому +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 5 років тому +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.

  • @Zeturic
    @Zeturic 5 років тому +12

    First thought is that it sounds like some kind of signedness weirdness.

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

    The truth: it is a normal 64-bit integer. In most systems today, we use signed bits. This means that we reserve the leading bit to tell us whether the integer is positive or negative. This leaves us with the 63 remaining bits. Now, because of two’s complement (and overflow), we subtract one from the maximum positive value to get our true maximum signed 64-bit value, while keeping the minimum the same without adding or subtracting anything. Now, the maximum number we can get is 9 more than the given number of stops, so I can reasonably conclude that the user had 9 stops on their 2h26m journey home.

  • @dtkedtyjrtyj
    @dtkedtyjrtyj 4 роки тому +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.