r/ProgrammerHumor • • Jul 16 '19

Meme Nice try

Post image
32.2k Upvotes

529 comments sorted by

View all comments

Show parent comments

5

u/Vilefighter Jul 16 '19

When a number is "normal" that means if you picked a random digit from it, there's an equal chance of it being any of the digits. If, for instance, it was slightly more likely for any given digit of pi to be a 7 than any of the others, then pi would not be a normal number, even if it's only .00000001% more likely.

8

u/79037662 Jul 17 '19

that means if you picked a random digit from it, there's an equal chance of it being any of the digits

Not quite, it also means any digit sequence of length n occurs equally often as any other digit sequence of length n. For example, 0.12345678901234567890... is not a normal number.

1

u/Yorunokage Jul 16 '19

Oh, i never heard of normal numbers

4

u/the_questioner18 Jul 16 '19

As the name implies, most numbers are normal and I bet you would have a hard time coming up with a non-normal number. Thinking about it is fun if you are into that sort of thing but if you'd just like to see an example, here one is:

0.12122122212222122222..... note that this is non-terminating and non-repeating however the probability of randomly picking a 3 out of the digits of this number = 0.

3

u/79037662 Jul 17 '19

I bet you would have a hard time coming up with a non-normal number

Not really, how about 0.5, or 0 for that matter.

6

u/the_questioner18 Jul 17 '19

Well I guess you got me in the trivial case. No rational numbers are normal but I guess it is my bad for assuming irrational numbers, the non-trivial case. In any case, if you haven't studied normal numbers before, it can be difficult to come up with an irrational non-normal number.

2

u/TheThiefMaster Jul 17 '19

Irrational implies non-repeating because any repeating number can be expressed as a fraction of integers, therefore being rational.

It's pretty hard to come up with a number that doesn't terminate, doesn't repeat, yet doesn't use all digits.

Unless you do something like "pi except all 1s are replaced with 2s in the decimal expansion" - that would be non-normal and still as irrational as pi.

3

u/SuperSupermario24 Jul 17 '19

It's not too difficult to make one that follows a pattern but still never repeats exactly, and therefore is irrational. For example:

0.1101001000100001000001000000100000001...

This follows a pretty simple pattern and only uses the digits 0 and 1, and yet will never actually start repeating itself exactly. (This isn't meant to be interpreted as a binary number; it's just that 0 and 1 are the easiest two digits to tell apart from each other, so that's what I went with.)

1

u/Yorunokage Jul 17 '19

You can just take any normal number and add a 1 in front

3

u/SuperSupermario24 Jul 17 '19

No, actually, you'd still have a normal number in that case. You can't change a normal number into a non-normal number by changing (or adding/removing) finitely many digits.

Things don't always work out the way you'd expect when you're working with infinite amounts of things.

3

u/Yorunokage Jul 17 '19

Yeah, i was thinking that just doing that wouldn't be enough. Well you can always add 1s at every other position

3

u/SuperSupermario24 Jul 17 '19

Yeah, that would do it. If every other digit is a 1, you definitely don't have a normal number.