Results 1 to 10 of 10

Thread: Programming Challenge

  1. #1
    Guest

    Programming Challenge



    Nine 9s

    Combining nine 9s with any number of the operators +, -, *, /, (, ) ,
    what is the smallest positive integer that cannot be expressed? * * *
    Hints:

    * * * 1)The answer isn't zero. You can express zero like this:
    * * * * * * (9 - 9) * (9 + 9 + 9 + 9 + 9 + 9 + 9)
    * * Also, zero isn't a positive integer.

    * * * 2) The answer isn't one. You can express one like this:
    * * * * * * *9 - (9 * 9 - 9)/9 + 9 - 9 + 9 - 9

    * * * 3) It's not a trick question.

    * * * 4) Be sure to handle parentheses correctly.

    Notes:

    * * * You cannot exponentiate.
    * * * You cannot concatenate (for example, put two 9s together to make
    99).
    * * * The - operator can be used in either its binary or unary form.
    * * * Assume base 10.

    --EDIT--

    The correct text, this time.

  2. #2
    Guest

    Re: Programming Challenge

    can I flip the 9 so that it looks like a 6?

  3. #3
    Guest

    Re: Programming Challenge


    can I flip the 9 so that it looks like a 6?
    Nope, sorry I can't allow that

  4. #4
    Guest

    Re: Programming Challenge

    bc session:
    Code:
    ((9*(9+9))/(9*9))+9-9+9-9
    2.00

  5. #5
    Guest

    Re: Programming Challenge

    And I'm glad you're not heart broken anymore (juding from your avatar at least)

  6. #6
    Guest

    Re: Programming Challenge

    bc session:
    Code:
    ((9*(9+9))/(9*9))+9-9+9-9
    2.00
    Nope... the smallest positive integer which CANNOT be expressed.. 2 can be expressed.

    GnuVince, you will probably have to do some coding in order to solve this... and don't expect me to have the answer, I'm trying to solve it as well.... along with several engineering students.

  7. #7
    Guest

    Re: Programming Challenge

    I just wanted to show that 2 could be expressed.

  8. #8
    Guest

    Re: Programming Challenge


    And I'm glad you're not heart broken anymore (juding from your avatar at least)
    Nope sorry, still hung on her...

  9. #9

    Re: Programming Challenge

    What do you mean by "cannot be expressed"?

  10. #10
    Guest

    Re: Programming Challenge


    What do you mean by "cannot be expressed"?
    We are looking for the smallest positive integer which we cannot make using the above...

Similar Threads

  1. A Challenge for the GUI gifted
    By in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 01-02-2004, 08:23 AM
  2. The Challenge That Is Linux
    By cloverm in forum General Chat
    Replies: 5
    Last Post: 05-09-2002, 02:01 PM
  3. Quotation challenge
    By in forum General Chat
    Replies: 64
    Last Post: 04-29-2002, 02:06 PM
  4. Cryptography challenge
    By ndogg in forum General Chat
    Replies: 15
    Last Post: 02-20-2002, 01:50 AM
  5. Replies: 84
    Last Post: 12-11-2001, 05:00 AM

Bookmarks

Posting Permissions

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