# 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

EXAMPLE:

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.

this is a recent idea i heard somewhere

at the moment of the big bang there was pushing gravity according to smarty pants science people

X = pow (2,-Y)

I dont know how to write that in smart-I-studied-language - but this is what the function pow does:

http://processing.org/reference/pow_.html

And it works!

THANKS (it _was_ helpful :)

1.5777218E-30
3.1554436E-30
6.3108872E-30
1.26217745E-29
2.5243549E-29
5.0487098E-29
1.00974196E-28
2.0194839E-28
4.0389678E-28
8.0779357E-28
1.6155871E-27
3.2311743E-27
6.4623485E-27
1.2924697E-26
2.5849394E-26
5.1698788E-26
1.03397577E-25
2.0679515E-25
4.135903E-25
8.271806E-25
1.6543612E-24
3.3087225E-24
6.617445E-24
1.323489E-23
2.646978E-23
5.293956E-23
1.0587912E-22
2.1175824E-22
4.2351647E-22
8.4703295E-22
1.6940659E-21
3.3881318E-21
6.7762636E-21
1.3552527E-20
2.7105054E-20
5.421011E-20
1.0842022E-19
2.1684043E-19
4.3368087E-19
8.6736174E-19
1.7347235E-18
3.469447E-18
6.938894E-18
1.3877788E-17
2.7755576E-17
5.551115E-17
1.110223E-16
2.220446E-16
4.440892E-16
8.881784E-16
1.7763568E-15
3.5527137E-15
7.1054274E-15
1.4210855E-14
2.842171E-14
5.684342E-14
1.1368684E-13
2.2737368E-13
4.5474735E-13
9.094947E-13
1.8189894E-12
3.6379788E-12
7.2759576E-12
1.4551915E-11
2.910383E-11
5.820766E-11
1.1641532E-10
2.3283064E-10
4.656613E-10
9.313226E-10
1.8626451E-9
3.7252903E-9
7.4505806E-9
1.4901161E-8
2.9802322E-8
5.9604645E-8
1.1920929E-7
2.3841858E-7
4.7683716E-7
9.536743E-7
1.9073486E-6
3.8146973E-6
7.6293945E-6
1.5258789E-5
3.0517578E-5
6.1035156E-5
1.2207031E-4
2.4414062E-4
4.8828125E-4
9.765625E-4
0.001953125
0.00390625
0.0078125
0.015625
0.03125
0.0625
0.125
0.25
0.5
1.0

Sorry, but you are not getting the exponential growth factor in this :)

Code from Processing:

***********

float Y = 214.7787009; // The input is Y, that is our variable
float X = 1/(2*Y); // X is what we should be able to calculate (but not with that equation I am afraid)
float ThisShouldTurnOne = X; // For programming reasons I am not re-using X, but a copy.. That should turn (approx) 1, if all was well

for (int test = 0; test <Y; test = test +1){
ThisShouldTurnOne = ThisShouldTurnOne + ThisShouldTurnOne;
println (ThisShouldTurnOne);
}

// That goes bonanza, exponential growth is a hard ball - this example ends in overflow, which is a bit more than 1 ;)

***********

X must be EXTREMELY small - It's OK to only work it out with say Y=10, or instead of the result being 1, it could be a million. Just fixed (I can devide it down :)

***********

Results from your first tries, TH, BM & JD:

0.0046559554
0.009311911
0.018623821
0.037247643
0.074495286
0.14899057
0.29798114
0.5959623
1.1919246
2.3838491
4.7676983
9.535397
19.070793
38.141586
76.28317
152.56635
305.1327
610.2654
1220.5308
2441.0615
4882.123
9764.246
19528.492
39056.984
78113.97
156227.94
312455.88
624911.75
1249823.5
2499647.0
4999294.0
9998588.0
1.9997176E7
3.9994352E7
7.9988704E7
1.59977408E8
3.19954816E8
6.3990963E8
1.27981926E9
2.55963853E9
5.1192771E9
1.02385541E10
2.04771082E10
4.0954216E10
8.1908433E10
1.63816866E11
3.27633732E11
6.5526746E11
1.31053493E12
2.62106985E12
5.2421397E12
1.04842794E13
2.09685588E13
4.1937118E13
8.3874235E13
1.67748471E14
3.35496941E14
6.7099388E14
1.34198776E15
2.68397553E15
5.3679511E15
1.07359021E16
2.14718042E16
4.2943608E16
8.5887217E16
1.71774434E17
3.43548868E17
6.8709774E17
1.37419547E18
2.74839094E18
5.4967819E18
1.0993564E19
2.1987128E19
4.3974255E19
8.794851E19
1.7589702E20
3.5179404E20
7.035881E20
1.4071762E21
2.8143523E21
5.6287046E21
1.1257409E22
2.2514819E22
4.5029637E22
9.005927E22
1.8011855E23
3.602371E23
7.204742E23
1.4409484E24
2.8818968E24
5.7637936E24
1.1527587E25
2.3055174E25
4.611035E25
9.22207E25
1.844414E26
3.688828E26
7.377656E26
1.4755312E27
2.9510623E27
5.9021246E27
1.1804249E28
2.3608498E28
4.7216997E28
9.443399E28
1.8886799E29
3.7773597E29
7.5547195E29
1.5109439E30
3.0218878E30
6.0437756E30
1.2087551E31
2.4175102E31
4.8350205E31
9.670041E31
1.9340082E32
3.8680164E32
7.736033E32
1.5472066E33
3.094413E33
6.188826E33
1.2377652E34
2.4755305E34
4.951061E34
9.902122E34
1.9804244E35
3.9608488E35
7.9216975E35
1.5843395E36
3.168679E36
6.337358E36
1.2674716E37
2.5349432E37
5.0698864E37
1.0139773E38
2.0279546E38
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity
Infinity

Congrats, you discovered limit calculation:)

And btw, don't do like that :P

The last bit is stolen from Facebook!!

Nope. I have it in my collection a long time as many other funny math comics. Never said though, I have created it.

I saw that on fb too

The last bit is stolen from Facebook!!

I don't understand if you are joking with me, explaining me stuff, or talking about something else.

But I am very happy to learn - once again - that LMR is a pool of mostly very talented persons.