Find the shortest expression to store 3+√(10) into Ans. The obvious way


Code:
3+√(10


is five bytes, but there's something shorter! For your reference, 3+sqrt(10) is about 6.1623.


I realize this can be solved using a Levin search ("try all possible programs"), but I'm hoping someone will find the solution a different way.
I suspect that the key here is to find a constant that is derived from √10 in some way, but so far I'm drawing a blank. I suspect the fact that 2π is close to 3+√10 is a red herring.
this is it a bit tough. my solution will probably be invalid, but it's pretty close....

3 bytes.
Code:
√38

=

6.1644

it's about .0021 off, but I would say that's pretty darn good...

probably not the solution your looking for though Sad

Code:
6+Ans⁻¹
is 4 bytes but I'm pretty sure it doesn't count because you have to do it a few times.
Are you allowed to have "3+√(10" stored in Str1 beforehand and just use expr(Str1) as the code, or is that kind of cheap? This is harder than I thought it would be. Sad
readroof2 wrote:
Are you allowed to have "3+√(10" stored in Str1 beforehand and just use expr(Str1) as the code, or is that kind of cheap? This is harder than I thought it would be. Sad


That would probably be still as many bytes long as the expression, assuming that the calculator replaces Str1 by it's true value during calculations
AliceIsDead wrote:
readroof2 wrote:
Are you allowed to have "3+√(10" stored in Str1 beforehand and just use expr(Str1) as the code, or is that kind of cheap? This is harder than I thought it would be. Sad


That would probably be still as many bytes long as the expression, assuming that the calculator replaces Str1 by it's true value during calculations


I made two different programs, one with 3+√(10 in it and the other with expr(Str1 with "3+√(10" already stored in Str1, and they both worked but the program with expr(Str1 was 4 bytes. However, I doubt this is the answer. I agree with Kerm that it probably has something to do with changing the √(10 part.
readroof2 wrote:


I made two different programs, one with 3+√(10 in it and the other with expr(Str1 with "3+√(10" already stored in Str1, and they both worked but the program with expr(Str1 was 4 bytes. However, I doubt this is the answer. I agree with Kerm that it probably has something to do with changing the √(10 part.


Like merging the 3 and the 10 under the same root...


I have been trying a lot of stuff and I still have no idea how to solve this.

I figured this out earlier:
x₂ - (x-1)₂ = x + (x-1)


Although √10 and √9 aren't consecutive numbers, 10 and 9 are...
AliceIsDead wrote:
readroof2 wrote:


I made two different programs, one with 3+√(10 in it and the other with expr(Str1 with "3+√(10" already stored in Str1, and they both worked but the program with expr(Str1 was 4 bytes. However, I doubt this is the answer. I agree with Kerm that it probably has something to do with changing the √(10 part.


Like merging the 3 and the 10 under the same root...


I have been trying a lot of stuff and I still have no idea how to solve this.

I figured this out earlier:
x₂ - (x-1)₂ = x + (x-1)


Although √10 and √9 aren't consecutive numbers, 10 and 9 are...


I also tried to make them one radical, but I couldn't remember if there was a way to. I will look up how to merge two radicals.
readroof2 wrote:
Are you allowed to have "3+√(10" stored in Str1 beforehand and just use expr(Str1) as the code, or is that kind of cheap?


It's a math puzzle, what do you think? ._.

hooloovoo's solution is clever, but there are a ton of errors that can come out of it depending on what Ans is... I doubt this'll help in solving, but is it a coincidence that 6.162277667^-1 is .1622776602 [and that sqrt(10)^-1==sqrt(10)/10]?
M. I. Wright wrote:
... but there are a ton of errors that can come out of it depending on what Ans is...

The only error I could pull out of it is if ans is 0. Otherwise, it always converges.
Michael2_3B wrote:
this is it a bit tough. my solution will probably be invalid, but it's pretty close....

3 bytes.
Code:
√38

=

6.1644

it's about .0021 off, but I would say that's pretty darn good...

probably not the solution your looking for though Sad


The cubed root of 234 is 4 bytes and 6.162240148, so very close. Any higher of an index and it would get over 5 bytes because cubed root has a 1 byte token, but the xth root needs two number input type things.
The closer I could get was √40. It is 6.32455532..., which is √10 + 3 with the decimal part *2
A hint and related puzzle:

Find the shortest expression to store the golden ratio, (1+√(5))/2, into Ans. The obvious way

Code:
.5+.5√(5

is seven bytes, but there is something shorter!

To solve this you can either do the math, or find someone who already did...
I asked my brother about this, and mentioned hyperbolic trig. We did some mental math, and came up with " e to the arcshine of 3", which translated into real words is
Code:
e^cosh⁻¹(3

3 bytes.
Hooloovoo wrote:
I asked my brother about this, and mentioned hyperbolic trig. We did some mental math, and came up with " e to the arcshine of 3", which translated into real words is
Code:
e^cosh⁻¹(3

3 bytes.

That's 4 bytes (but still smaller than 5)

Code:
e       (1)
^       (2)
cosh⁻¹(  (3)
3       (4)

Maybe I'm doing something wrong , but it doesn't give me 3+√(10 which is 6.1622..., instead this gives me 5.828427...
Hooloovoo, you've solved it!

Of course you mean


Code:
e^(sinh⁻¹(3


which is still 3 bytes.
Yes, that's exactly what I mean. I just translated me and my brothers' arcshine silliness wrong.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement