r/ProgrammerHumor • • Oct 25 '26

Meme xkcdRelevanceAgain

Post image
14k Upvotes

323 comments sorted by

View all comments

Show parent comment

501

u/--cheese-- Oct 25 '26

99

u/Specific_Giraffe4440 Oct 25 '26

50

u/danielcw189 Oct 25 '26

I thought the 4 in the XKCD comic was random, and it was about Sony picked the same random number (not 4) everytime, instead of picking new ones.

35

u/dekoboko_melancholy Oct 25 '26

The comic came first. The PS3 random number issue didn't literally use 4, the team that discovered it just used it as a joke in their con talk sharing explaining it

7

u/danielcw189 Oct 25 '26

The [xkcd] comic came first

Thanks for the correction. In my mind I remembered them using the comic at aC3 talk, but I incorrectly remembered that being about a different issue. So I mixed up the timeline.

In fact the xkcd comic is 3 years older than the reveal of Sony's screwup

The PS3 random number issue didn't literally use 4

just to be clear: I wrote that it was another number.

4

u/Admirable_Hour5169 Oct 25 '26 edited Oct 25 '26

Since 4 is the mode of the rolled dice, returning 4 in O(1) time—as mandated by the sacred xkcd #221 doctrine—is the only mathematically optimized implementation. Any other random number generator is a complete waste of CPU cycles and human sanity.

5

u/danielcw189 Oct 25 '26

your CPU dice don't go from 0 to 5? :)

5

u/Admirable_Hour5169 Oct 25 '26

Exactly. That is precisely why we truncate everything except 4 and return it in O(1) time. Implementing anything else is just courting CPU disaster. :)

94

u/Banes_Addiction Oct 25 '26

By the way, if you want a real life example of this, ask ChatGPT to generate you a random number between 0 and 30.

It's 17. It's always 17

0

u/[deleted] Oct 25 '26

[deleted] — view deleted comment

32

u/Eptalin Oct 25 '26

Most common between 1 and 100 is 37.
73 also ranks highly.
3's and 7's in general are popular.

→ More replies (1)

10

u/macaulaymcgloklin Oct 25 '26

Yup both Claude and ChatGPT says 17 for me. Definitely randmon

8

u/Schittz Oct 25 '26

That was weird. 17 just like you said

16

u/Forestmonk04 Oct 25 '26

I first got 17. I asked "Again", and it gave me 4.

17

u/Banes_Addiction Oct 25 '26

Yeah, I should have specified. It's the first one per session that comes out as 17.

9

u/Forestmonk04 Oct 25 '26

Oh that was obvious to me, I just wanted to point out that it was the funny number

6

u/Ratzing- Oct 25 '26

Hey I've got a 4 as a second one too!

1

u/Allegorist Oct 25 '26

That was the case like 4 years ago maybe? LLMs have used python now for quite a while. They're just as random as any other rng, or you can even have it pull from the atmospheric data number generators for something more "truly" random instead of algorithmic (but you would have to request this, obviously).

36

u/Banes_Addiction Oct 25 '26 edited Oct 25 '26

Have you tried it? Because before posting that I literally checked it still worked, and it worked with both ChatGPT and Gemini, in the last 20 minutes.

edit: since the post I'm replying to has been expanded about sources of randomness I figure I should say I did not in any way specify a source of randomness. The exact prompt I checked with was "can you generate me a random number between 0 and 30?"

Obviously random numbers can be generated according to all kinds of distributions, but if you are non-specific as I was, you'd probably expect uniform integers. I wouldn't have been at all surprised to get real numbers. But not a delta function at 17.

→ More replies (11)

27

u/FrenchFryCattaneo Oct 25 '26

I just tried it and got 17

12

u/exredditor81 Oct 25 '26

I just tried it and got 17

I got 17 too. weird.

10

u/pag07 Oct 25 '26

Same here I got

🎲 17

9

u/pk_me_ Oct 25 '26

Well shit I just got 17 too

I asked a friend to ask chatGPT, and not tell me what they got. I asked if they got 17. They asked me how the fuck I knew.

6

u/Banes_Addiction Oct 25 '26

I hope you said "some weirdo on reddit"

→ More replies (1)
→ More replies (4)
→ More replies (7)
→ More replies (2)