Results 1 to 26 of 26

Thread: Calculator

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42

    Question Calculator

    This is a slightly more interesting problem featuring calculators.

    What is the minimum number of mathematical operations needed (buttons pressed), if we want to get all the numbers from 0 to 10? Use a scientific calculator and anytime you cannot press any digit button. I mean we can only use buttons on the top (like log, triginometric, etc).

    Definitely it will start from Zero as most scientific calculators do that already.

    A simple example being just take log inverse twice. The 1st one will give 1 and the 2nd will give 10.

    Also it would be further interesting to find the desired count if we add the restriction that one should not arrive to the same number more than once.

    TRY!!!!!!!!!

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    ok type 0
    now it starts
    ex that gets you numeber 1
    +ans gets you 2, then 4,then 8
    then I can go back and get 10
    can't get any others, yet.
    Have I helped you? Please Rate my posts.

  3. #3
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    I get 1 through to 10 in 19 moves (excluding the zero at the start).

    method:
    [zero]
    [2nd] [10x] [2nd] [ans] [=]
    [->] [X] [=]
    [+] [X] [=]
    [=]
    [=]
    [=]
    [=]
    [=]
    [=]
    [=]
    [=]

    There, 19 moves on a TI-83, or was I cheating?
    Have I helped you? Please Rate my posts.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    2: !+!
    3: !+!+!
    4: !+!*ANS
    5: !+!*ANS+!
    6: !+!*ANS+!+!
    7 loginv loginv-!-!-!
    8 loginv loginv-!-!
    9 loginv loginv-!
    yeah I know i'm lazy, but i'm also tired and have to get some sleep..
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Does it count if we get an answer that is actually a loop?

    For example, if we solve sin(x*whatevertoget1) = 0
    Don't pay attention to this signature, it's contradictory.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    minor improvement
    4: !+! ^2
    5: !+! ^2+!
    6: !+! ^2+!+!
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    How many are the smallest amount of number you are actually up to now....

    I only have to push 13 times....

  8. #8

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    Hey! What is this? Don't use any programmable calculator. When I said standard scientific calculator, I meant we can use the following buttons only:
    1. The three Trigonometric functions (sin, cos, tan) and their inverse (use only degrees. No radians)
    2. Logarithmic function (Ln, log, e^x) and their inverse
    3. Factorial function (!)
    4. 1/x
    5. Powers & Roots (x^2, x^3, x^(1/2), x^(1/3)) only, no usage of the x^y as U cannot use memory and even can't press a digit

    No addition, substraction, multiplication, division and memory usage. If U press = its not considered a count. By the way I asked for minimum mathematical operations, not buttons pressed.

    For examples:
    Start with 0.
    1. Do !, get 1.
    2. Do Log Inverse, get 10.
    3. Do x^2, get 100
    4. Do Log, get 2
    5. Do x^2, get 4
    6. Do x^(1/2), get 2
    7. Do x^3, get 8
    8. Do x^(1/3), get 2
    9. Do Log Inverse, get 100
    10. Do x^(1/2), get 10
    11. Do Log Inverse, get 10^10
    12. Do x^(1/2), get 10^5
    13. Do Log, get 5

    This was just a redundant example to produce some numbers. Still 3, 6, 7 and 9 are left. Moreover there are methods to get these 7 numbers (which I showed), in less than 13 operations. Notice that throughout these steps, I never pressed the = button.

    Remember: Don't use memory.

    Enjoy!

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    BTW...arey you allowed to use + - / *????

  10. #10

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    As I said U cannot use +, -, *, /

    Remember the old scientific calculators where these buttons used to be with the number buttons on the lower half. We can only use the upper half.

  11. #11
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    But you said that we could use X^2 and that is a number....2 has to be pressed....or did I missunderstand that too?

  12. #12

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    There is a button in scientific calculators that says X^2 and x^(1/2). It just returns the x^2 of the number on the screen if you press the button. If U want the other use shift of inv button before pressing this one.

    If U don't have a square button, U can use x^y where U can press 2. But remember use only 2, 3, 1/2 and 1/3 as powers.

  13. #13
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Ok...

    0! = 1
    int(Tan(ans)^2) = 2
    abs(int(tan(ans))) = 3
    abs(int(tan(ans^3))) = 4
    int(tan(ln(ans))) = 5
    abs(int(tan(ans^(1/3))) = 8
    abs(int(tan(ans))) = 7
    int(e^(ans^(1/3))) = 6
    int(e^ans^(1/2)) = 11
    int(e^ans^(1/3)) = 9
    0! = 1, inverse log(ans) = 10

    Good?

    Last edited by DiGiTaIErRoR; Dec 18th, 2003 at 04:37 PM.

  14. #14

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    I wrote that use only degrees in trigonometric functions. Don't use radians.

  15. #15

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    Also use of int() & abs() is not permitted. The only permitted functions are the one I told earlier.

    I think the toughest is to get 7.

  16. #16
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by fundu
    Also use of int() & abs() is not permitted. The only permitted functions are the one I told earlier.

    I think the toughest is to get 7.
    Anal retentive bastard.


  17. #17
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by DiGiTaIErRoR

    When I get more time to waste I'll try it without addition.

    If you could use addition. You could just write

    e0

    then

    Ans + e0


    then

    enter
    enter
    enter
    enter

    and so on....

    and you would have 1,2,3,4,5,and so on...

  18. #18
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by NoteMe
    If you could use addition. You could just write

    e0

    then

    Ans + e0


    then

    enter
    enter
    enter
    enter

    and so on....

    and you would have 1,2,3,4,5,and so on...
    But that's not creative!


  19. #19
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by DiGiTaIErRoR
    But that's not creative!

    You don't have to be creative to have the best solution.....

  20. #20
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I can get everything except 7 atm
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  21. #21
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by fundu
    I wrote that use only degrees in trigonometric functions. Don't use radians.
    Psh, Screw degrees. Radians own you! 2pi radians, to be exact.

  22. #22
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by NoteMe
    You don't have to be creative to have the best solution.....
    Best solution? What happened to good ol' mathematic fun?


  23. #23
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by DiGiTaIErRoR
    Best solution? What happened to good ol' mathematic fun?


    What about it....I think it was fun finding out that I could do it in only 5 button presses....

  24. #24

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    If U all want I may post one method of getting 7?

  25. #25
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    veto! I've been trying to work something out for ages.. you can't just do that
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  26. #26

    Thread Starter
    Member
    Join Date
    Dec 2003
    Location
    USA
    Posts
    42
    One way to get 7 is:

    1. I am starting from 8
    2. Take sin of 8
    3. Now take cos inverse, It will return 82
    4. Take log inverse, get 10^82
    5. Take root, get 10^41
    6. Take log, get 41
    7. Take sin of 41
    8. Now do cos inverse, get 49
    9. Take root, get 7 !!!!!!!

    Howz that?

    I think 3 was pretty simple so didn't wrote that.

    If U don't know then in short U can start from 5, do 5!, get 120 take tan of 120 & square it to get 3. Go on 2 get 6 & 9.

    Though still better methods are yet 2 come from U studds.

    If on one is interested & I receive no replies, then I will close the thread on monday.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width