Shop OBEX P1 Docs P2 Docs Learn Events
1 + 2 + 4 + 8 + 16 ... = -1 Overflow the universe — Parallax Forums

1 + 2 + 4 + 8 + 16 ... = -1 Overflow the universe

Heater.Heater. Posts: 21,230
edited 2016-05-28 12:10 in General Discussion
So I stumbled accross this neat infinite sum the other day:

1 + 2 + 4 + 8 + 16 ... = -1

Clearly this is nuts. There is no way adding ever increasing powers of 2 can ever go negative.

If you do a quick search of the net will find rough and ready demonstrations that the sum is in fact -1. Like this:
https://www.youtube.com/watch?annotation_id=annotation_768684&feature=iv&src_vid=girlJhUials&v=kIq5CZlg8Rg

Or you will find more mathematically rigorous, and hard to understand, proofs. Sorry can't find a link.

So, I was thinking about this and a way of looking at it occurred to me that I have not seen anwhere....

Anybody who is into programming will immediately see this problem in binary. Every term is a power of 2 so it's
just setting the next bit along a binary representation of the sum. On an 8 bit computer it would go like this:
Terms    In binary     Partial Sum   In decimal
1        00000001      00000001      1
2        00000010      00000011      3
4        00000100      00000111      7
8        00001000      00001111     15 
16       00010000      00011111     31
32       00100000      00111111     63
64       01000000      01111111    127
128      10000000      11111111     -1            !!!!!

Ugh, what happened on that last line?

Well, using two's complement representation that top bit indicates a negative number and the whole thing means -1.

"Ah", you say, "don't use two's complement then we can get to 255, a tad closer to the infinite sum we want"

I say no. You see if we don't know what the result will be before we start we must allow for negative numbers and keep the sign bit.

Now, of course we could use a 16, 32 or 64 bit machine to get us even closer to the infinite sum we want.

In the extreme we need a machine with an infinite number of bits and start flipping them on one by one.

That is to say if we filled the entire infinite universe up with bits we could form the sum, but when we flip that last bit
the result is -1. We overflow the number range of the universe!

Q.E.D.

If this kind of thing appeals to you try this out: Making sense of 1+2+3+... = -1/12






«13

Comments

  • evanhevanh Posts: 15,188
    What?! That's just an integer encoding thing. It's certainly not a fundamental nature of numbers.

    Floats wouldn't give that result. And ints don't have to be 2's-complement encoded either. 1's-complement will be -0 outcome, and sign+mag will be -127 (for 8-bits) outcome.
  • evanhevanh Posts: 15,188
    edited 2016-05-28 12:49
    Err, sign+mag will probably be +127 limited (clipped) since that's its typical use case.
  • The Mathologer video has a good explanation of these sort of infinite sums. To get a finite value they usually require subtracting infinity from the sum at some point, which is normally forbidden because infinity is not a number. However, if you allow this it works, but these are only relevant in certain situations.
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2016-05-28 14:04
    But don't you know that we are all living in the Matrix and ALL numbers are represented with signed integer math? Eventually the infinite Nth bit will roll-over producing a -1 as in Heaters last line example.

    I am more concerned with statistical curves that follow a tangent function to be honest
  • Heater.Heater. Posts: 21,230
    Beau,

    In 3D video games there is only so much "stuff" they can put on the screen before GPU memory runs out or performance suffers. To hide this limitation they use tricks like keeping you inside rooms in a building or obscuring the distant view with fog so you can't see to the edge.

    Now we have found that the universe is expanding, and expanding at an increasing rate. This means there is a limit to how far out into space we can see. Light from objects beyond that limit can never reach us.

    This is just a trick that the designers of the Matrix came up with to limit the amount of stuff they had to hold in memory and not break the illusion for us. It's conclusive proof of the Matrix.

    Now, what "statistical curves that follow a tangent function" are keeping you up at night?
  • Cluso99Cluso99 Posts: 18,069
    edited 2016-05-28 16:43
    Heater. wrote: »
    ...
    Now we have found that the universe is expanding, and expanding at an increasing rate. This means there is a limit to how far out into space we can see. Light from objects beyond that limit can never reach us.
    That is only true if the relative expansion between us and the object in question is expanding at a rate above the speed of light.

    Since the universe is expanding far less than half the speed of light, no two objects can experience relative speeds greater than the speed of light. Hence we will be able to see those objects at some time in the future.

    Can the universe keep expanding until such times it is expanding at speeds in excess of 1/2 speed of light ??? If so, then some objects may never be able to see some other objects. Could this be how multiple universes evolve(d) ???

    Next conundrum is that nothing can go faster than the speed of light. This is the same as two objects travelling away from each other at 1/2 SOL. What happens here?
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2016-05-28 17:43
    Heater,

    [Now, what "statistical curves that follow a tangent function" are keeping you up at night? ] ... Heater

    The tangent function very closely follows/resembles a population growth curve. Whether you look at a specific species, or individual organism. Each living thing or group of things follow a similar pattern in various phases of the function (evolution) . For example if you look at the blue line in the image it could represent the human population. We might be somewhere at y=2 or y=4 as we approach p/2 ... and what happens after p/2 is something that has been going on time and time again throughout history (The rise and fall of civilizations for example). For the bottom (negative) half of the graph the curve very much follows a typical growth chart. The tangent function is natures way (the Matrix way) of keeping things balanced where there are infinite number of overlapping tangent functions, each in different phases keyed to every aspect of the phenomenon we call life.

    Tan.jpg
  • Heater.Heater. Posts: 21,230
    Closso,
    That is only true if the relative expansion between us and the object in question is expanding at a rate above the speed of light.

    Since the universe is expanding far less than half the speed of light, no two objects can experience relative speeds greater than the speed of light. Hence we will be able to see those objects at some time in the future.
    Not quite.

    In the 1930's Hubble observed that galaxies were moving away from us. The further away they were the faster they were moving away. He suggested a linear relationship: v = H * d.

    In recent times, with use of the Hubble Space Telescope, they were checking this law to see if it was still linear out at further distances. In fact they were looking to find that the expansion slowed down out their, as we might
    expect gravity to cause. The surprise was that they found the opposite. The expansion is accelerating!

    Now, the speed of light limit does not really apply. It's not as if the galaxies were racing through space. Rather space itself is getting bigger. There is indeed a point out there where galaxies can be moving away from us faster
    than the speed of light. That light can never get here. We in are living in a big sphere of what is observable.
    Next conundrum is that nothing can go faster than the speed of light. This is the same as two objects travelling away from each other at 1/2 SOL. What happens here?
    A can move away from B. A will never see B moving faster than light. B will never see A moving faster than light. Although they can approach the speed of light relative to each other. In order to say "This is the same as two objects travelling away from each other at 1/2 SOL" you would have to introduce a third observer C in the middle. It's not clear to me what speeds C measures.

  • Heater.Heater. Posts: 21,230
    Beau Schwabe,
    The tangent function very closely follows/resembles a population growth curve.
    That's a new one on me.

    Growth and population is often thought of in terms of the exponential function. y = e ^^ x.

    Whilst tan and exp can be scaled to sort of match up over some range they seem fundamentally different to me. Tan runs away to plus infinity
    asymptotically at PI/2 only to return from minus infinity on the other side. Exp on the other hand keeps growing
    toward plus infinity no matter how far to the right you go.

    The Matrix way of keeping these things in check is to use something like the Logistic map.
    http://www.stsci.edu/~lbradley/seminar/logdiffeqn.html
    https://en.wikipedia.org/wiki/Logistic_map

    Could have sworn I saw the same black cat pass by twice just then.
  • Heater.Heater. Posts: 21,230
    evanh,
    What?! That's just an integer encoding thing. It's certainly not a fundamental nature of numbers.
    I thought about that when I noticed what goes on in that sum.

    Thing is, it is meaningless to say the sum 1 + 2 + 4 + 8 + ... = ∞.

    I mean Cantor showed there are many different infinities, of many different sizes, in fact in infinity of them!

    But we would like to have a value that represents the sum in some way.

    I would turn it around and say that the demonstration that this sum comes to -1, and there are many ways to do that, demonstrates that two's complement is actually in the fundamental nature of numbers.

    Mind you I can see a little problem with my assertion...

    Consider the sum -1 - 2 - 4 - 8 - 16 ..... In two's complement we eventually overflow to zero.

    But that sum of negatives is just the sum of positives, -1, multiplied by minus one. So how come the result is not +1 ?

    Oops...


  • The fact that 1 + 2 + 4 + 8 + ... can equal both -1 and -1/12 makes me pretty sure that, if you do the math right, you can make it equal to pretty much whatever you want.
  • The fact that 1 + 2 + 4 + 8 + ... can equal both -1 and -1/12 makes me pretty sure that, if you do the math right, you can make it equal to pretty much whatever you want.

    No, those are two different sums from two different sequences. The first sequence is the sum of the powers of two. The second sum is the sum of all positive integers.
  • evanhevanh Posts: 15,188
    Heater. wrote: »
    This is just a trick that the designers of the Matrix came up with to limit the amount of stuff they had to hold in memory and not break the illusion for us. It's conclusive proof of the Matrix.

    If that's the best a simulation can do then I'd say this just proves reality ain't a simulation.
  • Heater.Heater. Posts: 21,230
    edited 2016-05-29 01:00
    Electrodude,

    Looks like you did not pay attention in maths classes :)

    1 + 2 + 3 + 4 + 5 .... = -1/12

    1 + 2 + 4 + 8 + 16 ... = -1


  • evanhevanh Posts: 15,188
    Heater. wrote: »
    Now, the speed of light limit does not really apply. It's not as if the galaxies were racing through space. Rather space itself is getting bigger.
    Doesn't this little detail imply that space must be a medium of some sort?
  • Heater.Heater. Posts: 21,230
    Seems the reason don't find any reference to two's complement with respect to this series is that the mathematicians have a different name for it.

    At the bottom of the wikipedia article on this series it says:

    "It is also possible to view this series as convergent in a number system different from the real numbers, namely, the 2-adic numbers. As a series of 2-adic numbers this series converges to the same sum, −1, as was derived above by analytic continuation" with a link to this: https://en.wikipedia.org/wiki/P-adic_number which seems to include two's complement.

  • Martin_H wrote: »
    The fact that 1 + 2 + 4 + 8 + ... can equal both -1 and -1/12 makes me pretty sure that, if you do the math right, you can make it equal to pretty much whatever you want.

    No, those are two different sums from two different sequences. The first sequence is the sum of the powers of two. The second sum is the sum of all positive integers.

    Since addition is commutative, if you get 1 + 2 + 3 + 4 + ... and move all of the non-powers-of-two to the end of the series, you're left with the sum of the powers of two. Therefore, -1/12 = -1. :)

    But, yes, I must admit, I did fail to realize that they used different series. I saw the -1/12 thing a while ago and forgot that it was all positive integers. I was suprised that I didn't see the two's complement thing when I first saw the -1/12 thing, and it turns out that this was because the -1/12 thing was positive integers and not powers of 2.
  • evanhevanh Posts: 15,188
    edited 2016-05-29 01:21
    Heater. wrote: »
    At the bottom of the wikipedia article on this series it says:
    I guess, if one is simulating a circular (eg: compass dial) arrangement, then it works. Otherwise it's just an error.

    EDIT: I actually used this property heavily on my largest project - A flow-wrapping machine. Because the machine always spun in the one forward direction and never returned the servo counts would eventually roll over. I just had to make sure all positional calculations and comparisons were relative/accumulative.
  • Heater.Heater. Posts: 21,230
    evanh,

    We can't simply write this kind of thing off as "just an error".

    For example, almost all of modern physics theory depends on using the square root of minus one. Well, that's nuts, there is no square root of minus one. Should we give up? No, we give a name to this non-existent thing, "i", and continue on with our reasoning using it. In the end the "i" goes away and we get results that correspond with reality to an amazing degree of accuracy.

    This is kind of spooky. For a long time mathematicians were very wary of this "i" thing but now everyone seems happy with it.

    Similarly the infinite sums we have here come up in theoretical physics. We could stop there and give up. There is not much you can do with infinities in your equations. Or we could assume the "wrong" result has some kind of truth to it and continue. Sure enough when we do that useful results come out the other end.

    Admittedly I'm not familiar with where such sums are cropping up.
  • Cluso99Cluso99 Posts: 18,069
    Heater. wrote: »
    Closso,
    That is only true if the relative expansion between us and the object in question is expanding at a rate above the speed of light.

    Since the universe is expanding far less than half the speed of light, no two objects can experience relative speeds greater than the speed of light. Hence we will be able to see those objects at some time in the future.
    Not quite.

    In the 1930's Hubble observed that galaxies were moving away from us. The further away they were the faster they were moving away. He suggested a linear relationship: v = H * d.

    In recent times, with use of the Hubble Space Telescope, they were checking this law to see if it was still linear out at further distances. In fact they were looking to find that the expansion slowed down out their, as we might
    expect gravity to cause. The surprise was that they found the opposite. The expansion is accelerating!

    Now, the speed of light limit does not really apply. It's not as if the galaxies were racing through space. Rather space itself is getting bigger. There is indeed a point out there where galaxies can be moving away from us faster
    than the speed of light. That light can never get here. We in are living in a big sphere of what is observable.
    Next conundrum is that nothing can go faster than the speed of light. This is the same as two objects travelling away from each other at 1/2 SOL. What happens here?
    A can move away from B. A will never see B moving faster than light. B will never see A moving faster than light. Although they can approach the speed of light relative to each other. In order to say "This is the same as two objects travelling away from each other at 1/2 SOL" you would have to introduce a third observer C in the middle. It's not clear to me what speeds C measures.
    No. If A is moving away from B approaching SOL (relative to each other, no third person required!), then they will still see each other, just not in real time.

    Now, suppose both are accelerating, and both are near 0.5 SOL. WHat happens as they increase speed? Well each can tell that relatively, they are moving away from each other near 1.0 SOL and it is increasing. As they approach 1.0 SOL they still see each other. But as soon at they reach 1.000000 SOL they will not see each other. WHat can they deduce??? 1.00000 SOL has been reached (relative) or the other blew up / disappeared or whatever. Why, because the other disappeared.

    The only reason you need C is to work out who is moving, moving faster, etc. But this then is now only relative to C. We need a lot of others to be able to deduce where the centre is, and hence who is moving where.

    Anyway I will leave the pondering to Hawkins and the like. I am having enough fun designing and programming props ;)
    It is not going to matter to me if the universe is expanding or contracting, whether it will end in a big crunch or whatever. I will not be here.
  • evanhevanh Posts: 15,188
    edited 2016-05-29 01:35
    Heater. wrote: »
    Admittedly I'm not familiar with where such sums are cropping up.
    I've added examples where circular systems work.
  • Heater.Heater. Posts: 21,230
    edited 2016-05-29 02:19
    @Clusso,

    I can't begin to speculate about what you are describing. The maths of General Relativity are way out of my league.

    However, my understanding of Special Relativity, limited as it is, tells me that as soon as you say "real time" you have to stop right there. There is no "real-time". The old Newtonian idea that the universe has some kind of "master clock" whose time value changes everywhere in sync is just not workable.

    Certainly we don't much care about whether the universe is expanding or contracting apart from a deep curiosity to get an idea as to what's going on. The whole enterprise does have a profound impact on our lives here and now though. Such experiment, observation, measurement and logical reasoning counters the threat of the muddled reasoning of creationists and other religious nut heads that has been the curse of the human race for millennia and still is in large parts of the world.

    Also I'm sure there are useful spinoffs. CERN did bring us the World Wide Web and the interactive C++ interpreter :)

    @evanh,

    Yep, such circular arithmetic often comes in handy. Like when making lock free FIFOs, or using CNT on the Propeller. I was referring to sums of infinite sequences though.
  • evanhevanh Posts: 15,188
    I suspect infinite and circular are related here.
  • In one sense this is a joke of sorts.

    If you converted numbers into tangible items like pieces of lumber and if counted them, they don't go poof unless you're a accountant or lawyer.

    The accountant will simply point to his faulty accounting and say nothing exists and the lawyer will argue that a stack of lumber is actually a watermelon and bill you $20,000 dollars.
  • Heater.Heater. Posts: 21,230
    edited 2016-05-29 12:23
    rod1963,

    Actually...that could be an interesting experiment...

    If you started stacking up pieces of lumber to represent numbers as you accumulated that infinite sum, with a hope to get to infinity, then at some point the whole thing would collapse in on itself under the force of it's own gravity. The resulting release of energy would cause a massive explosion.

    To see how that is so check out what happens when you compress paper under a 100 ton hydraulic press.



    Never mind, we will continue stacking up lumber. At some point, long before you get to infinity, all that mass is going to collapse supernova style into a neutron star. With a dramatically big explosion. Like so:



    Never mind, we'll continue stacking up lumber in there. At some point, long before you get to infinity, all that mass will have so much gravitational force it will collapse into a black hole. No doubt with yet another massive explosion.



    Then what?

    That's about the end of the experiment, you could keep lobbing lumber into the black hole. Problem is now you have lost count. The number you were stacking up is lost behind the event horizon, never to be retrieved.

    But wait, if all those lumber sticks were the same mass then the mass of the black hole represents the accumulated count. We can estimate the mass from the orbits of other things around the black hole.

    I think it would be better to do this experiment with lawyers and advertising people than lumber sticks :)



  • Heater.Heater. Posts: 21,230
    Wait a minute....

    If you are accumulating that infinite sum by lobbing lumber sticks into a black hole, and keeping count by measuring the mass of the black hole. And if we expect the final result to be -1....

    Then, that means at the end of time, when you reached the infini'th term of the sum, the mass of the black hole goes negative.

    That means gravitational repulsion rather than attraction.

    That means boom! As everything explodes in a new big bang.

    Welcome to the next universe!




  • "...If you are accumulating that infinite sum by lobbing lumber sticks into a black hole, and keeping count by measuring the mass of the black hole. And if we expect the final result to be -1.... Then, that means at the end of time, when you reached the infini'th term of the sum, the mass of the black hole goes negative. That means gravitational repulsion rather than attraction. That means boom! As everything explodes in a new big bang. Welcome to the next universe! " ... Still sounds like a tangent function to me rather than an exponentiation function.... an exponentiation function wouldn't "reset" upon applying more and more lumber sticks, where at the point of reaching p/2 in my earlier example... <- or "the event horizon" however you look at it, the reset occurs after you've passed p/2 ... and there is your big bang. ... Same in population growth mentioned earlier, you can't keep adding more and more people. At some point you will reach a critical mass and a collapse where the numbers will significantly move in the reverse direction. Not necessarily to the point of extinction, although it has happened with other species that have tried to make a run on this planet, but to a substantially low number.
  • Heater.Heater. Posts: 21,230
    Beau,

    Interesting....

    But surely population growth, which looks like a exponential or tangent curve initially, catastrophically fails back down to zero or some such.

    The tangent flips to minus infinity. Which does not make intuitive sense immediately to me.

    The "trick" with my arguments above is that you can never get to infinity along the X or Y axis with the exponential, as is the case with the infinite sum I started with.

    On the other hand the tangent does fly to infinity in the Y direction for finite X. It has that asymptote.


  • SeairthSeairth Posts: 2,474
    edited 2016-05-29 16:22
    Heater. wrote: »
    So I stumbled accross this neat infinite sum the other day:

    1 + 2 + 4 + 8 + 16 ... = -1

    Okay. I'm still waiting for the punchline. I thought the video was the joke, but it wasn't uploaded on April 1. I usually have high regard for MinutePhysics videos, but this one is so blatantly wrong that I begin to question their other videos!

    Edit: wow! This concept (as well as the -1/12 variant) is all over the place! But it's still wrong, as far as I can see!

    For instance, take the MinutePhysics video. The process goes like this:
    1. Imagine the sum (S): ∑(n= 0 -> m) 2^n (where m approaches infinity)
    2. Now, since 2 - 1 = 1, we can also say that 2S-S=S.
    3. But then the video ends up showing the following: 2(∑(n= 0 -> m-1) 2^n) - (∑(n= 0 -> m) 2^n) = -1
  • Negative Temperatures are HOT - Sixty Symbols

Sign In or Register to comment.