Skip to main content
GameDev.net gamedev.net
🔒 Locked

Periodic numbers, 1.9999999 == 2?

Started by Arcibald Wearlot May 26, 2005 at 3:08 PM 136 replies 25.4k views
Original Post
Arcibald Wearlot
Arcibald Wearlot
Some days ago I discovered something that really shocked me There's this way of converting a number with a periodic part into a fraction for example, if I have 1.2222222222.. A = 1.22222222.. 10 A = 12.2222222.. (subtracting A from both parts) 9 A = 11 A = 11/9 And that's OK. But If I have a number ending with a periodic 9, that's what happens: A = 1.9999999 10 A = 19.999999 9 A = 18 A = 18/9 = 2!!! So 1.999999999.. is mathematically equal to 2! Is that possible? There must be something wrong. Probably in the second line, where I multiply by 10 and just shift the periodic numbers, there is probably some approximation error going on here. Maybe there should be a 0 digit, and not just another 9, infinitely to the right or something like that. Any ideas? p.s. I was posting this in Math & Physics, but I think it's more suited here actually. Edit: little error in first computation :P [Edited by - Arcibald Wearlot on May 26, 2005 4:02:51 PM]
Mushu
Mushu
0.999... == 1
1.999... == 2

ZOMG!
smart_idiot
smart_idiot
It's both possible and correct. Blizzard Enterainment said so.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
twix
twix
We had a thread about this before, and it turned into a ridiculous argument.

YES, 1.99999... = 2. IT'S TRUE.

When we talk about repeating decimals we're referring to infinities, and regular arithmetic isn't properly equipped to handle them very well. But if you use some more advanced mathematics (limits), you can very easily prove that this is true.
benryves
benryves
Quote:
Original post by Jesper T
I predict this thread will become way longer than necessary.
37 pages of the same rehashed "maths"? Can't wait [rolleyes]
[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]
pinacolada
pinacolada
Yeah I like Twix's explaination the best. When you deal with infinity, weird stuff happens. You can't use plain old ordinary logic on things dealing with infinity.

I mean, the idea of repeating decimals is bordering on illogical to begin with. How can you have an infinite number of digits? Where would you put them all??? Even if each digit was really small, you would need a lot of space to put them somewhere. Maybe if you had really big buckets. But even that wouldn't be enough!! You would need an infinite number of buckets! But where do you get enough trees to get the wood to make an infinite number of buckets???? The mind boggles.
tstrimp
tstrimp
Quote:
Original post by Arcibald Wearlot
A = 1.22222222..
10 A = 12.2222222..
(subtracting A from both parts)
9 A = 10
A = 10/9

And that's OK. But If I have a number ending with a periodic 9, that's what happens:


That is ok? I do hope you mean 11/9 [razz]

Conner McCloud
Conner McCloud
12.22222222...
-1.22222222...
--------------
11.00000000...

Therefore, 0.99999.... ~= 1
Conner McCloud
Conner McCloud
A much more straight forward way of making fractions is just to throw the repeating part over an equal number of 9s.

0.12121212... == 12/99
8.12121212... == 8 12/99
5.105312105312... == 5 105312/999999

This suggests an alternate reasoning about 0.9999... == 1:

1/9 = 0.11111...
2/9 = 0.22222...
3/9 = 0.33333...
4/9 = 0.44444...
5/9 = 0.55555...
6/9 = 0.66666...
7/9 = 0.77777...
8/9 = 0.88888...
9/9 = 0.99999...

Not mathematically rigorous, of course, but enough to fuck with your head.

CM
smart_idiot
smart_idiot
#include <iostream>int main() {  struct _{char value;_*next;}nine={'9',&nine},point={'.',&nine},zero={'0',&point},*digit=&zero    for(; digit; digit=digit->next)   std::cout << digit->value; }
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
kSquared
kSquared
Quote:
Original post by Arcibald Wearlot
So 1.999999999.. is mathematically equal to 2! Is that possible?

Not only is it possible, it's a tautology. =)

Here's an informal proof. Let's start with what the notion of a decimal number means:

[1] 0.k1k2 ... = k1/10 + k2/100 + ... + kp/10p + ...

Now let's apply the specific case where the digits after the decimal point are all 9s. This gives

[2] 0.999... = 9/10 + 9/100 + ... = 9/101 + 9/102 + ...

Now let's show this continuing pattern as an infinite sum:

[3] 0.999... = Sum[n = 1 --> infinity] { 9/10n }

The above statement says that "0.999..." is equal to the sum of the series "9/101 + 9/102 + ...", which is just a restatement of [2]. Now instead of looking at the infinite sum, let's just look at part of the infinite sum:

[4] 0.999... = Sum[n = 1 --> m] { 9/10n }

which is the partial series ""9/101 + 9/102 + ... + 9/10m". Now let's consider what happens as m gets bigger and bigger:

[5] 0.999... = Limit[m --> infinity] { Sum[n = 1 --> m] { 9/10n } }

This is equal to

[6] 0.999... = Limit[m --> infinity] { Sum[n = 1 --> m] { 9(1 - 10-(m+1))/(1 - 1/10) } }

You can verify yourself by plugging any value for m and seeing it's still just statement [5]. Reducing the denominator gives us

[7] 0.999... = Limit[m --> infinity] { Sum[n = 1 --> m] { 9(1 - 10-(m+1))/(9/10) } }

and allowing m to get increasingly larger gives us the limit,

[8] 0.999... = .9/(9/10)

[9] 0.999... = .9/.9

which leaves us with the final step,

[10] 0.999... = 1

QED! A more formal proof will require that you construct the number system from scratch. If you're really interested, you can look into Cauchy sequences.
- k2 "Choose a job you love, and you'll never have to work a day in your life." — Confucius"Logic will get you from A to B. Imagination will get you everywhere." — Albert Einstein"Money is the most egalitarian force in society. It confers power on whoever holds it." — Roger Starr{General Programming Forum FAQ<
Slaru
Slaru
We learned that at my school in the seventh grade!
Nathan Baum
Nathan Baum
Because 1/3 = 0.333~Then    3*1/3 = 0.999~Because 3*1/3 = 1And     3*1/3 = 0.999~Then    1 = 0.999~Because 1+1 = 2And     1 = 0.999~Then    2 = 1.999~

Nemesis2k2
Nemesis2k2
Quote:
Probably in the second line, where I multiply by 10 and just shift the periodic numbers, there is probably some approximation error going on here. Maybe there should be a 0 digit, and not just another 9, infinitely to the right or something like that. Any ideas?

Yeah, that's correct. A recurring decimal place doesn't actually have any bearing on this problem at all, it just makes the error harder to spot. When you multiply a number with an infinitely recurring portion, you're in fact adding a zero to the end at infinity + 1. It's the exact same thing as if you had no recurring digits at all. For example, consider this non-recurring case:

A = 1.999
10A = 19.990
9A = 19.990 - 1.999 = 17.991
8A = 17.991 - 1.999 = 15.992
7A = 15.992 - 1.999 = 13.993
6A = 13.993 - 1.999 = 11.994
5A = 11.994 - 1.999 = 9.995
4A = 9.995 - 1.999 = 7.996
3A = 7.996 - 1.999 = 5.997
2A = 5.997 - 1.999 = 3.998
1A = 3.998 - 1.999 = 1.999

If you now assume that A is 1.999 recurring, it doesn't change the outcome, the zero digit is now just added at infinity plus 1, and keeps the result just under 2.
twix
twix
Quote:
Original post by smart_idiot
*** Source Snippet Removed ***

Pfft, you think that's unnecessarily cryptic?

(setf num '(.9 9) (cddr num) (cdr num) ^__^ (loop for x in num do (princ x)))


Well, that was my intellectual contribution of the day. [grin]
twix
twix
Quote:
Original post by Nemesis2k2
Yeah, that's correct. A recurring decimal place doesn't actually have any bearing on this problem at all, it just makes the error harder to spot. When you multiply a number with an infinitely recurring portion, you're in fact adding a zero to the end at infinity + 1.

There's no such thing as infinity + 1. You really can't use logic that works for non-recurring decimals to deal with their infinite cousins.
Conner McCloud
Conner McCloud
Quote:
Original post by twix
Quote:
Original post by Nemesis2k2
Yeah, that's correct. A recurring decimal place doesn't actually have any bearing on this problem at all, it just makes the error harder to spot. When you multiply a number with an infinitely recurring portion, you're in fact adding a zero to the end at infinity + 1.

There's no such thing as infinity + 1.

Of course there is. If there weren't, then 1.999999... would be 2 and not 1.99999... Duh.

Not to mention the various arguments I wouldn't have won with my brother about precicely how much cooler Batman was than Superman.

CM
Michalson
Michalson
A more straight forward demonstration (if you want, just take out the [xxx] and you can even do this on your calculator):

A = 1.99[...]9

10A = 1.99[...]9 * 10 = 19.9[...]9

9A = 10A - A = 19.9[...]9 - 1.99[...]9 = 17.9[...]91

A = 9A / 9 = 17.9[...]91 / 9 = 1.99[...]9



twix
twix
Quote:
Original post by Michalson
A more straight forward demonstration (if you want, just take out the [xxx] and you can even do this on your calculator):

A = 1.99[...]9

10A = 1.99[...]9 * 10 = 19.9[...]9

9A = 10A - A = 19.9[...]9 - 1.99[...]9 = 17.9[...]91

A = 9A / 9 = 17.9[...]91 / 9 = 1.99[...]9

Ooh, you cheater. You're explicitly referring to the last digit in the decimal, which by definition does not exist. [wink]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.