Help, our train home is making 9 quintillion stops.

  Рет қаралды 972,335

Stand-up Maths

Stand-up Maths

4 жыл бұрын

Thanks as always to Jane Street! Here is that blog post about 63-bit numbers.
blog.janestreet.com/what-is-g...
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.uk/standupmaths...
CORRECTIONS
- None yet, let me know if you spot any mistakes!
Thanks again, as always, for Jane Street being my principal sponsor.
www.janestreet.com/
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 300
@Gasmanic
@Gasmanic 4 жыл бұрын
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 жыл бұрын
shingebis it’s probably because 9 quintillion are negative and 9 quintillion positive.
@SuperFranzs
@SuperFranzs 4 жыл бұрын
@@bbaovanc Why would the amount of stops be a signed integer?
@meowthecat422
@meowthecat422 4 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
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.
@ChromeBirb
@ChromeBirb 3 жыл бұрын
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 жыл бұрын
It's always nice to see a Stryder fan
@knickohr01
@knickohr01 3 жыл бұрын
And hitting a block for 416 years crashes the game
@realbignoob1886
@realbignoob1886 3 жыл бұрын
@@knickohr01 ikr
@FandangoJepZ
@FandangoJepZ 3 жыл бұрын
And bonking for a few minutes wins the game
@squibble311
@squibble311 3 жыл бұрын
stryder7x gang
@No-uc6fg
@No-uc6fg 3 жыл бұрын
9 quintillion stops in 2 hours and 26 minutes? That's incredible.
@The_Bird_Bird_Harder
@The_Bird_Bird_Harder 3 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@No-uc6fg i dont think that's a pun lmao
@jakubrossa7794
@jakubrossa7794 3 жыл бұрын
basically means you can jump of the train at any point in the journey
@corinnepowers9646
@corinnepowers9646 3 жыл бұрын
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
@NFSHeld
@NFSHeld 3 жыл бұрын
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 жыл бұрын
Dang you got it all figured out
@throwaway-og7qs
@throwaway-og7qs 2 жыл бұрын
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 Жыл бұрын
@@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! :)
@dominicpancella3012
@dominicpancella3012 8 ай бұрын
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 8 ай бұрын
​@@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).
@kylecobb9982
@kylecobb9982 4 жыл бұрын
A stop every 10 femtometres or something like that
@InTheBeginningTheUniverseWas
@InTheBeginningTheUniverseWas 4 жыл бұрын
over a quadrillion stops per second
@Lovuschka
@Lovuschka 4 жыл бұрын
Which means it's over 9000.
@pyral514
@pyral514 4 жыл бұрын
@@Lovuschka Which mean it's over 1.
@Symphony_
@Symphony_ 4 жыл бұрын
@@Lovuschka actually that was 8000 not 9 , XD
@Lovuschka
@Lovuschka 4 жыл бұрын
@@Symphony_ The fan translation which became the meme was over 9000, however.
@leefisher6366
@leefisher6366 4 жыл бұрын
Occam's razor, Matt. Perhaps the train really is making that many stops.
@davidmurray3542
@davidmurray3542 4 жыл бұрын
I would argue that the existence of 9 quintillion stops is not the simplest explanation...
@jamespolland958
@jamespolland958 4 жыл бұрын
@@davidmurray3542 and I would argue that it is
@herbert164
@herbert164 4 жыл бұрын
@@jamespolland958 so where would they fit?
@jamespolland958
@jamespolland958 4 жыл бұрын
@@herbert164 you'd have to ask a train expert about that one man. Sory
@herbert164
@herbert164 4 жыл бұрын
@@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?
@thenoone
@thenoone 3 жыл бұрын
2:26 "You can't build a wall up to 256 blocks high" **laughs in 21w06a**
@lestaironblack1259
@lestaironblack1259 3 жыл бұрын
The universe is expanding.
@bene5431
@bene5431 3 жыл бұрын
*evil-laughs in cubic chunks*
@baguettegamer5313
@baguettegamer5313 3 жыл бұрын
i never used mods so this is actually god tier news for my potato pc
@marioisawesome8218
@marioisawesome8218 3 жыл бұрын
21
@rhysbaker2595
@rhysbaker2595 3 жыл бұрын
Wait, they are letting you build higher now?
@tinybabybread
@tinybabybread 3 жыл бұрын
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 жыл бұрын
My head canon is that Matt walks around with literal numbers floating over his head all day.
@Imrooniel
@Imrooniel 9 ай бұрын
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 8 ай бұрын
@@jdubya7139 No doubt many people visualise numbers when thinking about them.
@AalbertTorsius
@AalbertTorsius 4 жыл бұрын
I feel we're missing a piece of the puzzle. How many stops _are_ there between those stations?
@Henrix1998
@Henrix1998 4 жыл бұрын
Probably 10 or 11
@JesperDramsch
@JesperDramsch 4 жыл бұрын
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 жыл бұрын
@@Henrix1998 Is that 2 or 3?
@m1lkweed
@m1lkweed 4 жыл бұрын
~9 quintillion
@OlafDoschke
@OlafDoschke 4 жыл бұрын
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
@hadz8671
@hadz8671 4 жыл бұрын
"Humble Pi" appear at 3:14 - nice touch!
@Lattamonsteri
@Lattamonsteri 4 жыл бұрын
Duuuuuude :D awesome!
@anasorabi123
@anasorabi123 4 жыл бұрын
Wonder if it was on purpose
@sebastianjost
@sebastianjost 4 жыл бұрын
@@anasorabi123 I think it is... Matt is the kind of guy who would insist on such details
@RFC3514
@RFC3514 4 жыл бұрын
Technically should appear at 3:08.4 (i.e., 3.14 minutes). I guess seconds should be renamed "Parker decimals"...?
@GFmanaic
@GFmanaic 4 жыл бұрын
Should be named Humble half Tau
@Bananasforthesoul
@Bananasforthesoul 4 жыл бұрын
I can’t even imagine the notifications on a 255 person WhatsApp group.
@tlh1337
@tlh1337 4 жыл бұрын
I'm in a group with 215 participants and... 0 messages in the last 4 days
@Bananasforthesoul
@Bananasforthesoul 4 жыл бұрын
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 жыл бұрын
@@Bananasforthesoul that's true.
@qtulhoo
@qtulhoo 4 жыл бұрын
Nicholas Stormbreath Oh god that's scary.
@Oberon4278
@Oberon4278 3 жыл бұрын
The very first notification I'd see would be from me leaving the group.
@Interesting_Failure
@Interesting_Failure 2 жыл бұрын
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-setun
@cara-setun 2 жыл бұрын
You deserve all the likes
@handuo6301
@handuo6301 8 ай бұрын
A train quantum wave packet!
@denelson83
@denelson83 7 ай бұрын
As in sub-Planck length?
@Alolyn
@Alolyn 7 ай бұрын
This is why you dont use trains in quantum problems Leave those for special relatively
@AnssiArpiainen
@AnssiArpiainen 4 жыл бұрын
Just yesterday we had breaking news in finland about a person whose bank account was in debt for 2^63 euros
@Awkwerp
@Awkwerp 4 жыл бұрын
I would definitely assume overflow since its negative. Who knew being too rich could happen lol
@kilvesx7924
@kilvesx7924 4 жыл бұрын
Haven't heard of this, can you link it?
@AnssiArpiainen
@AnssiArpiainen 4 жыл бұрын
www.iltalehti.fi/kotimaa/a/e514a9e9-2080-4ce8-8e69-2171be52d024
@davidmurray3542
@davidmurray3542 4 жыл бұрын
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 жыл бұрын
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 4 жыл бұрын
That's just a bit shorter than a CVS receipt
@YingwuUsagiri
@YingwuUsagiri 4 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@YingwuUsagiri Thermal paper isn't just "paper" tho.
@nurmr
@nurmr 4 жыл бұрын
@@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 4 жыл бұрын
"I'm not an hex-pert" Why Matt, why
@martinrocket1436
@martinrocket1436 4 жыл бұрын
Sware, because he doesn't have 16 fingers.
@KuraIthys
@KuraIthys 4 жыл бұрын
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 Ай бұрын
@@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 жыл бұрын
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 жыл бұрын
And then he starts to nuke you. Hilarious bug I think 😂
@elietheprof5678
@elietheprof5678 4 жыл бұрын
That's what happens when people keep their emotions bottled up inside 😂
@its_w4yne
@its_w4yne 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
I can tell you from experience that Gandhi is a nuking maniac even if he has the worst tech level of all players.
@Green0Photon
@Green0Photon 4 жыл бұрын
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 жыл бұрын
A word is 4 bytes no?
@Squossifrage
@Squossifrage 4 жыл бұрын
@@thedocta_certified In the Intel world, a word is 16 bits, a dword is 32, a qword is 64.
@Idran
@Idran 4 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@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.
@Real28
@Real28 4 жыл бұрын
"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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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.
@burk3
@burk3 3 жыл бұрын
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 жыл бұрын
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
@IceMetalPunk
@IceMetalPunk 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Maybe there was a parity bit - used to catch errors, but obviously not this particular kind of error.
@Eugenethemooer1Wolffe
@Eugenethemooer1Wolffe 4 жыл бұрын
I thought this might be the case, but why would they have been storing a negative number of stops in the first place?
@tncorgi92
@tncorgi92 4 жыл бұрын
Challenge: All the Stations, Geoff and Vicki.
@adigyran
@adigyran 4 жыл бұрын
I see, you are man of trains as well
@casperes0912
@casperes0912 4 жыл бұрын
That's be quite awesome ;). And Jay Foreman should do a song about 'em all
@snowfloofcathug
@snowfloofcathug 4 жыл бұрын
Casper S� Sung one syllable off of course
@KevFrost
@KevFrost 4 жыл бұрын
Drinking game?
@petermikhaylov
@petermikhaylov 4 жыл бұрын
YES OMG YES
@thenickstrikebetter
@thenickstrikebetter 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Does that mean you can build 64 blocks below bedrock into the void?
@mooosje
@mooosje 3 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@mooosje that sounds epic, so now you can build structures below the world
@jamesmichael7528
@jamesmichael7528 3 жыл бұрын
@@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
@Xatzimi
@Xatzimi 4 жыл бұрын
You missed the other obvious solution: Zeno was driving the train and was trying to make infinite stops
@nurmr
@nurmr 4 жыл бұрын
but then why the -10?
@jsbrads1
@jsbrads1 8 ай бұрын
Well… Zeno wasn’t even close! 😡😂
@Bobstew68
@Bobstew68 4 жыл бұрын
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 жыл бұрын
"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 жыл бұрын
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 жыл бұрын
I was going to post this
@Jiffy_Park
@Jiffy_Park 3 жыл бұрын
@@chyza2012 where can I read about these laws?
@sgbench
@sgbench 3 жыл бұрын
@@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.
@ultlifeform
@ultlifeform 3 жыл бұрын
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.
@ryanjensen1945
@ryanjensen1945 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 8 ай бұрын
@@ryanjensen1945 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.
@ryanjensen1945
@ryanjensen1945 8 ай бұрын
@@ultlifeform yeah it's funny, I think the magic number was like 244 or 246.
@MTG_Music
@MTG_Music 3 жыл бұрын
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 жыл бұрын
​@@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.
@rikwisselink-bijker
@rikwisselink-bijker 4 жыл бұрын
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 жыл бұрын
So, you're saying there's 7 kinds of people who can count in hexadecimal, aye??
@rikwisselink-bijker
@rikwisselink-bijker 3 жыл бұрын
@@tomasstana5423 Determining the difference between those 7 kinds of people is left as an exercise to the reader.
@tomasstana5423
@tomasstana5423 3 жыл бұрын
@@rikwisselink-bijker Yeah, yeah, no problem, just wanted to be sure its not a typo ;)
@rikwisselink-bijker
@rikwisselink-bijker 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 жыл бұрын
@@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 жыл бұрын
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 2 жыл бұрын
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.
@memofromessex
@memofromessex 3 жыл бұрын
Thanks for cheering me up, I've just come back from another disappointing date 😢
@telotawa
@telotawa 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@Logarithm906 Yep, that's it exactly. Still leaves you wondering why we need two flavors of zero.
@Logarithm906
@Logarithm906 4 жыл бұрын
@@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...
@robertzmirich9550
@robertzmirich9550 4 жыл бұрын
"This is the Sorcerer's Stone to the Philosophers Stone" lolol
@stephenbenner4353
@stephenbenner4353 4 жыл бұрын
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 жыл бұрын
Stephen Benner oh yes the good old study of mathematic.
@CrystaTiBoha
@CrystaTiBoha 4 жыл бұрын
Or, you could say, a Parker Title. lolol
@Tfin
@Tfin 4 жыл бұрын
@@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 жыл бұрын
@@Tfin Do Americans shorten "statistics" to "stat"? I'm just curious...
@HickoryJ
@HickoryJ 4 жыл бұрын
I’m a software engineer, and this was immediately my suspicion hahahah
@gferrol118
@gferrol118 3 жыл бұрын
"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 жыл бұрын
gferrol118 I was looking for this comment
@gferrol118
@gferrol118 3 жыл бұрын
@El Xabi de Siempre no its from -64, to +320. So 384 blocks total
@gferrol118
@gferrol118 3 жыл бұрын
@El Xabi de Siempre the bottom of the world is now -64 instead of 0
@gferrol118
@gferrol118 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
@Cr42yguy
@Cr42yguy 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
That speed would approximately be c^2. Not bad for a train!
@VAXHeadroom
@VAXHeadroom 4 жыл бұрын
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 жыл бұрын
@@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!"
@hugovangalen
@hugovangalen 4 жыл бұрын
Gotta love powers of two. HP recently warned users to upgrade their SSDs before these crash after using them for 32.768 hours...
@DancingRain
@DancingRain 4 жыл бұрын
The subroutine that formats the number might be ignoring sign, because they never expected a negative value.
@moopidoo
@moopidoo 4 жыл бұрын
When you float an idea and double down.
@danielb270
@danielb270 4 жыл бұрын
and then it takes too long seriously though, it is (Long.MAX_VALUE - 10)
@marklonergan3898
@marklonergan3898 4 жыл бұрын
Taking it a bit too far!
@aditya95sriram
@aditya95sriram 4 жыл бұрын
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 жыл бұрын
nice pun there mate. :)
@ZuppaD.Cipolle
@ZuppaD.Cipolle 4 жыл бұрын
@@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
@Raykkie
@Raykkie 4 жыл бұрын
Everybody's gangsta until the long scale says that there's only 9 trillions stops
@benjaminnewlon7865
@benjaminnewlon7865 4 жыл бұрын
_only_
@nadadada3938
@nadadada3938 4 жыл бұрын
is... is this a pun... this... is... I love it
@Tobberz
@Tobberz 4 жыл бұрын
@@epsi Old boi Britons used long scale too :D
@WaterShowsProd
@WaterShowsProd 3 жыл бұрын
Long live long scale!
@RH-ro3sg
@RH-ro3sg 3 жыл бұрын
@@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.
@Hazearil
@Hazearil 3 жыл бұрын
"In Minecraft you cannot built a block over 256 blocks high." Minecraft 1.17 begs to differ.
@Fyngys
@Fyngys 3 жыл бұрын
This videos over a year old mate
@nagitokomaeda3237
@nagitokomaeda3237 3 жыл бұрын
Dude, nobody plays 1.9+
@Livestreamlurker
@Livestreamlurker 3 жыл бұрын
@@xX1infinityedge1Xx How dare they.
@22tfortnitevevo
@22tfortnitevevo 3 жыл бұрын
@@nagitokomaeda3237 i'd say that 1.16 is better than 1.8
@LiamE69
@LiamE69 4 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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?
@bunnygirl8
@bunnygirl8 4 жыл бұрын
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 жыл бұрын
Where is the F pun? I missed it.
@the_furf_of_july4652
@the_furf_of_july4652 4 жыл бұрын
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 жыл бұрын
@@BobStein 5:13, can we get an f in the chat
@BobStein
@BobStein 4 жыл бұрын
@@subnormality5854 thank you. Classic Matt Parker understated humor.
@coryman125
@coryman125 4 жыл бұрын
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
@deanmoncaster
@deanmoncaster 3 жыл бұрын
On southern rail this is quite feasible due to the sheer number of breakdowns you need to expect.
@thorndust5329
@thorndust5329 3 жыл бұрын
Minecraft now has a building limit over 256. Extended by 64 both directions in the y axis
@MsNosis
@MsNosis 4 жыл бұрын
very short stops though, since the trip still only takes a couple of hours.
@pixymisa8087
@pixymisa8087 4 жыл бұрын
Welcome to Zeno Railways!
@MsNosis
@MsNosis 4 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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. :)
@JxH
@JxH 4 жыл бұрын
Re book: Although Canada is within North America, most Canadians would want the English version of the book.
@michaelsommers2356
@michaelsommers2356 4 жыл бұрын
@Memento Mori You mean the "English spelled correctly" version.
@lunasophia9002
@lunasophia9002 4 жыл бұрын
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 *
@mallorystrom7511
@mallorystrom7511 3 жыл бұрын
i learned “check if the weird big number is a power of two” from humble pi
@jtn2002
@jtn2002 4 жыл бұрын
The american book it probably missing a few "u"'s as well....
@ElectroDFW
@ElectroDFW 3 жыл бұрын
They do it to hmor s. 😁
@GUIHTD
@GUIHTD 4 жыл бұрын
So when is "Humble Parker - When Matt Goes Wrong in the Real World" coming out?
@Aviertje
@Aviertje 4 жыл бұрын
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 8 ай бұрын
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 6 ай бұрын
I mean i kinda had an idea of what he was saying there but this comment made it much clearer, thanks
@elishmuel1976
@elishmuel1976 2 жыл бұрын
Dude, I just love your videos. Can't wait to see you hit 1 million subs. Have a great 2022!
@PixelBytesPixelArtist
@PixelBytesPixelArtist 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
@sethbushnell5051
@sethbushnell5051 4 жыл бұрын
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 4 ай бұрын
Except it's not the compliment. It's the complement. 10 isn't paying compliments to 2^63 because she's a pretty number.
@yashrawat9409
@yashrawat9409 2 жыл бұрын
0:17 A valid cause for concern *Of course*
@XanTheDragon
@XanTheDragon 3 жыл бұрын
I saw the thumbnail and I IMMEDIATELY knew what went wrong. That number is one I will pick out any day.
@cloverberry721
@cloverberry721 3 жыл бұрын
Matt: You can’t build a wall more than 256 blocks tall in Minecraft Snapshot 21w06a: *Are you sure about that?*
@HNaledi123
@HNaledi123 3 жыл бұрын
Did not expect this comment to pop up here this quickly... wow
@theblinkingbrownie4654
@theblinkingbrownie4654 3 жыл бұрын
@@HNaledi123 yep crazy how fast stuff spreads over the internet
@HNaledi123
@HNaledi123 3 жыл бұрын
@@theblinkingbrownie4654 Yup, guess so.
@cloverberry721
@cloverberry721 3 жыл бұрын
@@HNaledi123 Minecrafters be like: We...are...speed
@bene5431
@bene5431 3 жыл бұрын
Cubic chunks: boooring
@mebamme
@mebamme 4 жыл бұрын
This comment contains a "Parker train" joke to save you the hassle of making your own.
@GvinahGui
@GvinahGui 4 жыл бұрын
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 жыл бұрын
@@GvinahGui Is that a Parker Train Parker Joke?
@donkosaurus
@donkosaurus 4 жыл бұрын
@@IceMetalPunk more of a parker parker train joke joke
@jaspermay5813
@jaspermay5813 4 жыл бұрын
@@donkosaurus It's a Parker 'Parker train' joke.
@BobStein
@BobStein 4 жыл бұрын
@@jaspermay5813 So, a Parker Train Joke ... *squared?*
@ibramgaunt885
@ibramgaunt885 3 жыл бұрын
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 жыл бұрын
myth
@ibramgaunt885
@ibramgaunt885 3 жыл бұрын
@@niccy266 you can look it up, it's how a hilarious running gag started.
@ultlifeform
@ultlifeform 3 жыл бұрын
@@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 жыл бұрын
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 жыл бұрын
@@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
@retep8891
@retep8891 4 жыл бұрын
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
@mo2cubing
@mo2cubing 8 ай бұрын
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.
@SojournerDidimus
@SojournerDidimus 4 жыл бұрын
I quickly scanned over the article. So they say that they use the lowest bit to flag that the other 63 bits are an integer. The tricky thing then is that you'd normally use the highest bit to check for the sign. But when you shift all bits down by one, you must copy the previous highest bit into the new highest bit, or it will indeed be close to 2 pow 63. This process is called sign extension, and their bug probably was forgetting to do this. Processors have separate instructions to do shifting, but sometimes also for shift with sign extension, so they might have missed those up as well.
@SojournerDidimus
@SojournerDidimus 4 жыл бұрын
@@vigor_grego Yes, I know. Yet when designing such exotic types that use the lowest bit as an indicator for the other 63 bits being integer, the abstraction in between might have had some oversight, some weird corner case that is not handled as it should be.
@sethberry9185
@sethberry9185 3 жыл бұрын
“I’m gonna be a little late to work. How late? Well my train has to make a few stops before mine...”
@devlinw4735
@devlinw4735 Жыл бұрын
6:12 that makes so much sense because the original number of stops was 10 off the 2 to power 63 number
@DaxSudo
@DaxSudo 8 ай бұрын
Love that this is popping up in my feed now
@mlies37
@mlies37 4 жыл бұрын
When you described Neil Codling as “Twitter user” rather than “amazing musician” or something, my heart broke a little.
@grshorwich
@grshorwich 3 жыл бұрын
"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 жыл бұрын
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. 😂
@Quancheese
@Quancheese 8 ай бұрын
I loved reading Humble Pi! It’s one of those page turners that you can read in a couple of sittings. 💛
@aeugh4200
@aeugh4200 5 ай бұрын
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
@Wordsnwood
@Wordsnwood 4 жыл бұрын
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!
@MrCheeze
@MrCheeze 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
What's the maximum native integer size on a 6502 anyway?
@gormster
@gormster 4 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@YourMJK How about MIN_INT - 11?
@dtkedtyjrtyj
@dtkedtyjrtyj 3 жыл бұрын
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.
@Jaabo37
@Jaabo37 4 жыл бұрын
Thanks for simplifying the book for us. Never thought it would be so interesting to see why a number is wrong. Makes me think of all the flaky troubles we get in telecommunications. It’s pretty easy to spot patterns that kind of help tell when it’s a physical problem vs a computer or coding problem
@MrTyler918273
@MrTyler918273 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.
@_jb_3441
@_jb_3441 3 жыл бұрын
"we can see that this number is really F-ed" That broke me :D
@nialltracey2599
@nialltracey2599 4 жыл бұрын
Wow. All the things you could have checked and looked up, but didn't bother to. What an informative video.
@markrowland1366
@markrowland1366 3 жыл бұрын
Love this. I wowed my arithmetic teacher, first day at school. You can't do it that way! Chuckantala Devi says I should.
@brycemw
@brycemw 4 жыл бұрын
I love my copy of Humble Pi. I got the first version even though I’m in Canada. I even got a signed one! I just finished it a few days ago, it’s a great book that I would definitely recommend to anyone who finds maths interesting
@vibaj16
@vibaj16 3 жыл бұрын
Bryce Why’d you get it signed? Pi is always positive!
@Josh-ui7nq
@Josh-ui7nq 4 жыл бұрын
My question is who decided 63 bits was needed to show the stops? Surely 16 would be far more than enough.
@ferretyluv
@ferretyluv 3 жыл бұрын
Every time you talk about powers of 2, I think of your praise of the game 2068.
@mariojoia1337
@mariojoia1337 4 жыл бұрын
14 Fs in the same number, so much respect.
@gamingmusicandjokesandabit1240
@gamingmusicandjokesandabit1240 3 жыл бұрын
(already pressed F in the chat) 🙂
@sorio99
@sorio99 4 жыл бұрын
So, I’m thinking they were actually 10 stops away. Right?
@JNCressey
@JNCressey 4 жыл бұрын
Or maybe 10 steps into their journey but it started keeping track counting from 0 instead of the real number.
@poisonpotato1
@poisonpotato1 4 жыл бұрын
3:25 it’s a Parker Theory
@_Atzin
@_Atzin 4 жыл бұрын
This such a great video, pretty useful information regarding debugging strange numbers.
@-Osiris-
@-Osiris- 4 жыл бұрын
Thanks Matt, this was super interesting
@GrizonII
@GrizonII 4 жыл бұрын
“Using creative _bits_ of mathematics” seems quite relevant to this video’s topic.
@Nejvyn
@Nejvyn 4 жыл бұрын
"So there you are! What are the chances? ... Quite high." ¯\_(ツ)_/¯ I lol'd
@bigiron9393
@bigiron9393 4 жыл бұрын
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.
@ProGrow_
@ProGrow_ 3 ай бұрын
When I read the title, for some reason, I assumed the video was gonna be about a theoretical train that visits each country one by one and stopping at each convienent place such that, for example, each person only has to walk 15 mins to their destination and in my head the answer would turn out to be 9 quintillion. Would be an interesting question to actually work out but I was still not disappointed with what the video was actually about!
@YuvrajHanspal
@YuvrajHanspal 4 жыл бұрын
That shade at the end about the crappy American English 🤣🤣🤣
@llearch
@llearch 4 жыл бұрын
Vital question: is it possible to order the UK edition in the US, to show the moronic editors that yes, we _can_ read english, and not just american? (admittedly, I'm expat, so it doesn't count in my case, but still, the point stands...)
@stza16
@stza16 4 жыл бұрын
Me don’t understand your comment. Please right in American.
@loveforsberg530
@loveforsberg530 4 жыл бұрын
@@stza16 If y'all'd've sold an illustrated meme version real 'muricans could've read it.
@BBall0027
@BBall0027 5 ай бұрын
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.
@michaelphelps2350
@michaelphelps2350 3 жыл бұрын
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.
@samtherat6
@samtherat6 3 жыл бұрын
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.
@Zeturic
@Zeturic 4 жыл бұрын
First thought is that it sounds like some kind of signedness weirdness.
@jon9103
@jon9103 3 жыл бұрын
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.
@LimitedWard
@LimitedWard 3 жыл бұрын
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.
The Problem With Infinite Summations On YouTube
22:01
Stand-up Maths
Рет қаралды 520 М.
I found Amongi in the digits of pi!
18:04
Stand-up Maths
Рет қаралды 597 М.
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 20 МЛН
Cat story: from hate to love! 😻 #cat #cute #kitten
00:40
Stocat
Рет қаралды 14 МЛН
How many pencils can hold me up?
00:40
A4
Рет қаралды 18 МЛН
Recursive PowerPoint Presentations [Gone Fractal!]
14:47
Stand-up Maths
Рет қаралды 542 М.
What was the first (known) maths mistake?
14:09
Stand-up Maths
Рет қаралды 817 М.
What was the most expensive book ever?
17:54
Stand-up Maths
Рет қаралды 462 М.
What's special about 277777788888899? - Numberphile
14:24
Numberphile
Рет қаралды 2,2 МЛН
Why 82,000 is an extraordinary number - Numberphile
7:45
Numberphile
Рет қаралды 1,2 МЛН
Why is TV 29.97 frames per second?
14:27
Stand-up Maths
Рет қаралды 2 МЛН
What is the biggest tangent of a prime?
10:59
Stand-up Maths
Рет қаралды 353 М.
Why the longest English word is PAPAL and SPA is the pointiest.
31:20
Stand-up Maths
Рет қаралды 837 М.
She’s Giving Birth in Class…?
0:21
Alan Chikin Chow
Рет қаралды 5 МЛН
The Worlds Most Powerfull Batteries !
0:48
Woody & Kleiny
Рет қаралды 15 МЛН
ToRung short film: he is a good friend😍
0:36
ToRung
Рет қаралды 20 МЛН
Настоящий Железный Человек ( @ALEXLAB )
0:51
EpicShortsRussia
Рет қаралды 15 МЛН
1000 iq guy 😱 @fash
0:11
Tie
Рет қаралды 29 МЛН