Results 1 to 17 of 17

Thread: Solve Puzzles

  1. #1

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Solve Puzzles

    Hai friends,

    When puzzles of this type put on, how effecinetly solve them insted of trying 100's of patters and wasting time

    example

    -----------

    Question:Using 1 through 9 in order, and using only addition or subtraction, create an equation that equals 100.

    <Note:I have 10kinds of answers for this>

    i.e:. Look at the following example:
    Notice that the digits 1 through 9 are used in order to arrive at 106.
    1 + 23 - 4 + 5 - 6 + 78 + 9 = 106

    ---------------

  2. #2

  3. #3

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Solve Puzzles

    dclamp,
    Great!

    But, i did not expect the answer here
    Just want to no how to approach to solve it

    how many attempts you tried neally?

  4. #4
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Solve Puzzles

    zero. Google is my fran
    My usual boring signature: Something

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Solve Puzzles

    Try working backwards... takes a few attempts.

  6. #6
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Solve Puzzles

    Who the hell is Fran?

  7. #7
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Solve Puzzles

    Well he doesn't have a girlfriend, per se, but google shows him lots of dirty pictures so it's close enough

  8. #8
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Solve Puzzles

    Between each digit you can have one of three things:
    "+"
    or
    "-"
    or
    ""

    So that gives you 6561 possible equations, the vast majority of which do not equal 100.

    Brute forcing this would be the easiest algorithm but the execution time would be terribly slow. It would be exponentially computationally expensive if you used a larger radix (hexadecimal or base32 etc).

    Depends if you want to find ANY single correct answer or ALL correct answers.

    You could always use a Genetic Algorithm or a Monte Carlo method, those would both certainly be very efficient for this puzzle if the radix is not specified before-hand.
    I don't live here any more.

  9. #9

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Solve Puzzles

    Quote Originally Posted by wossname
    Between each digit you can have one of three things:
    "+"
    or
    "-"
    or
    ""

    So that gives you 6561 possible equations, the vast majority of which do not equal 100.

    Brute forcing this would be the easiest algorithm but the execution time would be terribly slow. It would be exponentially computationally expensive if you used a larger radix (hexadecimal or base32 etc).

    Depends if you want to find ANY single correct answer or ALL correct answers.

    You could always use a Genetic Algorithm or a Monte Carlo method, those would both certainly be very efficient for this puzzle if the radix is not specified before-hand.
    Thans wossi for the explanation

  10. #10
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Solve Puzzles

    12345679 * 9 = 111111111
    12345679 * 18 = 222222222
    12345679 * 27 = 333333333
    12345679 * 36 = 444444444
    12345679 * 45 = 555555555
    12345679 * 54 = 666666666
    12345679 * 63 = 777777777
    12345679 * 72 = 888888888
    12345679 * 81 = 999999999

  11. #11

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Solve Puzzles

    Quote Originally Posted by MartinLiss
    12345679 * 9 = 111111111
    12345679 * 18 = 222222222
    12345679 * 27 = 333333333
    12345679 * 36 = 444444444
    12345679 * 45 = 555555555
    12345679 * 54 = 666666666
    12345679 * 63 = 777777777
    12345679 * 72 = 888888888
    12345679 * 81 = 999999999
    oh cool

  12. #12
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Solve Puzzles

    This BASH command will give you the equations that match...

    Code:
    for i in {"1+","1-","1"}{"2+","2-","2"}{"3+","3-","3"}{"4+","4-","4"}{"5+","5-","5"}{"6+","6-","6"}{"7+","7-","7"}{"8+","8-","8"}"9"; do echo "$i = $[i]"; done | grep " = 100$"
    Try doing that in MSDOS
    Last edited by wossname; Jan 14th, 2009 at 03:28 PM.
    I don't live here any more.

  13. #13
    Fanatic Member kregg's Avatar
    Join Date
    Feb 2006
    Location
    UK
    Posts
    524

    Re: Solve Puzzles

    Quote Originally Posted by wossname
    This BASH command will give you the equations that match...

    Code:
    for i in {"1+","1-","1"}{"2+","2-","2"}{"3+","3-","3"}{"4+","4-","4"}{"5+","5-","5"}{"6+","6-","6"}{"7+","7-","7"}{"8+","8-","8"}"9"; do echo "$i = $[i]"; done | grep " = 100$"
    Try doing that in MSDOS
    Name:  oh_dear.jpg
Views: 181
Size:  54.3 KB

    I blame Jacob Roman.

  14. #14

  15. #15
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Solve Puzzles

    1+2+3+4+5+6+7+8+9=45
    1*2*3*4*5*6*7*8*9=362880

    362880/45 = 8064


  16. #16
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Solve Puzzles

    Quote Originally Posted by mudcake
    1+2+3+4+5+6+7+8+9=45
    1*2*3*4*5*6*7*8*9=362880

    362880/45 = 8064
    A system of mathematical statements whose end result is of no significance to anything!

  17. #17
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Solve Puzzles

    aka "Statistics"

    *ba-dum-tish*
    I don't live here any more.

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