Yoruichi-san Posted September 21, 2012 Report Share Posted September 21, 2012 (Okay yes, this was inspired by an xkcd comic...) Find the most accurate approximation (for the the units given) that has 5 characters or less (not counting negative sign or decimal point) for the following: 1) Gravitational constant: 6.673x10^-11 (m^3/kg/s) 2) Avogadro's number: 6.022x10^23 3) Planck's constant: 6.026x10^-34 (m^2*kg/s) 4) Electron mass: 9.109x10^-31 (kg) 5) Boltzmann constant: 8.617x10^-5 (eV/K) 6) Permittivity of free space: 8.854x10^-12 (F/m) 7) Elementary charge: 1.602x10^-19 C I.e. you could approximate a light-year as 99^8 (m). Quote Link to comment Share on other sites More sharing options...
0 phil1882 Posted September 22, 2012 Report Share Posted September 22, 2012 (edited) here's all my answers 7^-12 5^34 56^-19 38^-19 22^-3 24^-8 22^-14 and here's my pseudo-code that produced it. for i in range(2,100): result = i**int(math.log(value,i)) if result/value > 1: result = result/value-1 else: result = 1-result/value if result < aprox: aprox = result index = i exponent = int(math.log(value,i)) print(index,exponent) Edited September 22, 2012 by phil1882 Quote Link to comment Share on other sites More sharing options...
0 Yoruichi-san Posted September 23, 2012 Author Report Share Posted September 23, 2012 That's pretty good. In case my example confused anyone, you can also use things besides exponents (including operators), and you can use non-integers in exponents. Heck, go ahead and throw in pi (it can count as one character) and e if you want for fun . Quote Link to comment Share on other sites More sharing options...
0 James33 Posted September 24, 2012 Report Share Posted September 24, 2012 May be cheating but Avogadro's constant=R/K Quote Link to comment Share on other sites More sharing options...
0 Rob_Gandy Posted September 24, 2012 Report Share Posted September 24, 2012 Pi47.83 Still trying to make it better/nicer. Quote Link to comment Share on other sites More sharing options...
0 Rob_Gandy Posted September 26, 2012 Report Share Posted September 26, 2012 I came up with some others. 1) Pi-7.53e 5) 19.67-Pi 6) e-25.45 7) Pi-37.8 I went the Pi/e route.Planck's constant and Electron mass are still giving me troubles with using Pi or e. Quote Link to comment Share on other sites More sharing options...
Question
Yoruichi-san
(Okay yes, this was inspired by an xkcd comic...)
Find the most accurate approximation (for the the units given) that has 5 characters or less (not counting negative sign or decimal point) for the following:
1) Gravitational constant: 6.673x10^-11 (m^3/kg/s)
2) Avogadro's number: 6.022x10^23
3) Planck's constant: 6.026x10^-34 (m^2*kg/s)
4) Electron mass: 9.109x10^-31 (kg)
5) Boltzmann constant: 8.617x10^-5 (eV/K)
6) Permittivity of free space: 8.854x10^-12 (F/m)
7) Elementary charge: 1.602x10^-19 C
I.e. you could approximate a light-year as 99^8 (m).
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.