Let's Make Robots!

Simple math problem.. I think.. If I was good at math :)

I am going nuts over this (possibly) simple equation that I need for a fun Processing project.

I need to have the "calculation" or "equation" for X

Y is the number of times we go (X=X+X), and the end result should always be 1



IF Y is 2 then X = 0.25, because

0.25+0.25=0.5 (Y1)

0.5+0.5=1 (Y2)

HOW on earth does one calculate X? (if Y is for example 214.7787009)?

I imagine it'd be something like X=1/SQR Fish Y Something Hotdog?!?


There's SO much respect to the person cracking this! :) (Or I'll delete the post and pretend this never happened, if the answer is really simple :)

Thanks :) (and respect)


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I know that you are a mathematician Markus :-) (but had to google B.Sc.just now)

What I don't like is something endless to the top....I like defined areas/ranges/numbers with an END.

So I want to know what Frits is planning with this calculation.

//Edit: This article in the link is from you...got you because of the very unique username :)

"So I want to know what Frits is planning with this calculation."

I just needed to be able to insert predicted gravity in time&space in an virtual invironment, while learning Processing, and having frantic spasms and tics. (Don't ask me, nothing makes sense, I work and play by intuition :)

The number 1 is gravity 1 at "the edge" of a given object. Y is the distence to the object. X's are amount of gravity, relative to 1 at the surface. My mind flew from space, and was now affected by X, as an object came closer. I knew the distance to the object, Y - but how much gravity should I feel, I was wondering :D The answer was X!

...is that you are not able to phrase out your problem to us "O Master of LMR". Also, this is not a mathematical problem but a physical one. Yes we'll be using a lot of maths to solve it (atleast till I get a PHD in quantum physics and prove that maths is wrong and insufficient).

What I understand from your last para is this- You want to calculate how much gravity is present at the edge of an object relative to a particular surface you define to have gravity equal to 1. All you know is the distance of the object (but from where? Your reference point or what?). What I'm giving below is a possible solution-

Now, going back to what I've studied in my old physics book (Concepts of Physics Part-1 by Dr.H.C. Verma Chapter 6, page 204), here is what Newton wrote when the apple fell on his head-

Force(F)=[Gravitational Constant(G)*Mass of 1st object(M1)*Mass of 2nd object(M2)]/{[Distance b/w the 2 objects(r)]^2}

Or- F=GM1M2/(r^2).

Now, what it simply means is that each object applies a gravitational force on every other object. Simply said, right now as you read this, Pluto is trying its best to pull you off the ground. However, as the distance r is very large and r^2 is just too large for me to mention is, F tends to 0 (limits yes...).

Now coming to the frame of earth (ie all calculations that will be done only on earth),

g(gravitational acceleration aka gravity you feel)=F/M2 where M1 is mass of earth and M2 is mass of any other object.

which implies, g=G*M1/(r^2) where r^2 is the distance of center of object 2 from center of the earth.

Now, as you said, any object will have gravity equal to 1, so g1 felt by that object is = GM1/(r1^2) where r1 is the distance of that object from the center of the earth. Now, if you know the distance of the object 2, ie the object you want to find out about, g2=GM1/(r2^2). So if g1=1 and g1/g2=(r2^2)/(r1^2)=(r2/r1)^2, g2=(r1/r2)^2.

If you are out of earth frame ie in general space- g2=(m2*r1^2)/(m2*r2^2) if g1=1. It also means that g2


if m2>m1 and r2>r1.


What I believe you are not understanding is that gravity is relative and not just that any object has a particular gravity at one point. For the simplest example, consider your weight. If say, its 60kgs on earth, its not kg as in mass but kgwt. On moon, it'll be 20kgs only (gravity on moon is 1/3 of earth roughly). Your gravity is not just a quantity. Its an attractive force which acts on both bodies in opposite directions. If earth pulls you, you also pull it back with the same force. That's one of the reason's why we say there is no gravity in outer space. That's because there is nothing to pull you back. You need some 3rd body to get an idea of what you are going to define gravity by and then calculate the reltives of the 2 bodies.

I don't know if I've made my point, inform me.

I am out now LOL

hey vishu, don't say that you can prove that maths is wrong! no!!! maths is a language! and dispoving it is like disproving language, plus, maths is the one who can make it easier to calculate properties and make theories explain and learn via numbers, it's hard to just explain a theory with just words, you need to use another language, and that language is maths!

Oh - and "endless at the top": All in universe is affecting all. That is why. But my dick is only affecting Mars with very.. very small numbers. Very!

Would I be correct in guessing you are using this to identify which samples to examine from a universe of samples? to achieve a certain reliability or satisfaction?

Y is the number of times we go (X=X+X), and the end result should always be 1

...which I interpreted as 2^Y*X=1  (2^Y means 2 to the power Y)

so: X=1/(2^Y) which is exactly what pow(2,-Y) means

Sorry I can not follow you, Antonio.

First of all, in math x=x+x makes no sense, because x=x+x <=> x=2x <=> 1=2 (contradiction).

If I understand Frits (admittedly horrible) description, it is the simple equation 2xy=1. Solving for x, we get x=1/(2y).

I see no any reason to use y as an exponent. This would lead to a logarithm equation. Your equation is only true for the special case y=2, because 2+2=2*2=4 and 2^2=4. But for example 2*3=6 and 2^3=8.




From what I understood Frits wanted a piece of code to compute a function F(Y) such that the following function returns 1:

function testF(int y) {

float x = F(y);

for (int i = 0;i<y;i++) {

x=x+x; //which is x=x*2


return x;


Notice that the loop doubles x y times so this function can be rewritten as:

function testF(int y) {

float x = F(y);

x = x*pow(2,y);

return x;


Since we want this function to return 1 we could write the equivalent ecuation as F(y)*2^y=1 or F(y)=1/2^y

Does it make sense now?

Also, x=x+x is a perfectly valid ecuation, the only solution for x is 0 :)