• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use five 5s to make 37

 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fill in the operators for the following equation. You may use any operators you wish. There should be at least two different ways to solve this equation.
5 5 5 5 5 = 37
[Note: The solution to the equation is 37. As such, you may not split up the '3' and the '7' by placing any operators in between them.]
[ July 20, 2003: Message edited by: Jason Menard ]
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let I be the set of integers. Define an operation op on IxIxIxIxI such that op(5, 5, 5, 5, 5) = 37. Then
op(5, 5, 5, 5, 5) = 37. QED :-)

Here's another that's more likely to be among Jason's solutions, assuming base ten arithmetic:
((55)/5)+5+5=(3*7)
Another is
5+5+((55)/5)=(3*7)
A third is
5+((55)/5)+5=(3*7)
Those three are all basically the same, though. Maybe there's another? Neat...I wasn't thinking about 3*7 at first.
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Didn't think we could split up the 37, but if so how about...
(55/5) - (5/5) = 3 + 7
or
(5/5) - ((5*5)/5) = 3 - 7
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No splitting up the 37.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jason Menard:
No splitting up the 37.


55555 != 37
5-5-5-5-5 != 37
just kidding
 
Author
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hints
a) 2^5=32 (if power is allowed)
b) 1<<5=32 and 5|5=5
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jignesh Malavia:
hints
a) 2^5=32 (if power is allowed)
b) 1<<5=32 and 5|5=5


2^5 won't work because there is no 2, and '^' is used in programming languages as an exponent operator, but isn't a real math operator. Even if it were to be used, then you could get something like 5^5. but not 2^5. Bit shifting, while being a Java operator, is also not a math operator in the true sense of the word (human beings have no need to bit encode digits to manipulate them, that's a computer thing). You're best bet would be to stick with the normal mathematical operators imho.
[ July 20, 2003: Message edited by: Jason Menard ]
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is factorial allowed?
(5 x 5) + 5! - (5!/5)
 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following is allowed:
1) Factorial
Most problems of this nature do accept ! as a valid mathematical symbol.
2) Summation
Some accept this, some do not. Those who do not argue that you need two numbers to define a summation. Those who do, allow a single number, with the terminal base to be implied as zero.
3) (Square) Roots
Are square roots allowed? Are other roots? A root sign typically has a a number associated with it. Some allow for a root sign sans number to imply a square root.
4) Rounding, Flooring, trig functions, etc
Can we allow other functions which are typically represented by alphabetic symbols?
--Mark
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is this allowed?
++5 * 5 + ++5 + 5/5 = 37
 
Jignesh Malavia
Author
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jason Menard:


2^5 won't work because there is no 2
Yes, but we can get one using (5+5)/5
Even if it were to be used, then you could get something like 5^5. but not 2^5.
(((5+5)/5)^5)+5 = 37
Bit shifting, while being a Java operator, is also not a math operator in the true sense of the word (human beings have no need to bit encode digits to manipulate them, that's a computer thing).
Well, okay. If it were allowed, my answer was ((5/5)<<5)|5|5
You're best bet would be to stick with the normal mathematical operators imho.
So is factorial (!) allowed? In that case Michael Dunn was pretty close.
(5 x 5) + 5! - (5!/5)
(5 * 5) + (5! / (5+5))
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sure this works better in a non-programmer crowd.
The solutions I have seen maybe (or maybe not) use the following math operators: (,),+,-,*,/,!. (<-- that's a period, not a decimal point) It is also acceptable to run numbers together, so that in this case you could use numbers such as 5, 55, 555, etc...
In other words, pretty much the basic stuff. No functions (floor, ceiling, rounding, trig functions, etc...). No increment or decrement (pre or post). I suppose square root would probably be allowed, but I'm guessing not other roots as that would call for an additional number. In any case the solution does not call for it. Nor does the solution call for raising anything to the 5th or 55th or 555th power (not sure if that is even acceptable in these types of problems though). As far as summations, I would think that you would need another number, right? The place I grabbed this from didn't go into much detail so all I can tell you is the symbols I have seen similar problems use (and of course I've seen the solution for this one.
[ July 20, 2003: Message edited by: Jason Menard ]
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jignesh Malavia:
(5 * 5) + (5! / (5+5))


Good job! That is a correct answer. I know of at least two more.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A factorial is a "normal" operator but exponentiation is not? You've got some weird definitions here, Jason.
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jim Yingst:
A factorial is a "normal" operator but exponentiation is not? You've got some weird definitions here, Jason.


I don't think that I said that exponentiation wasn't acceptable, merely that I didn't know. However since you all are making me put way more work into this then I had planned , further researching my sources indicates that exponentiation is indeed acceptable. I have seen it indicated as either ** or ^. Square roots are also acceptable.
My appologies for the confusion. Sheesh... computer people.
[ July 20, 2003: Message edited by: Jason Menard ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(5 x 5) + 5! - (5!/5)
oops... I was thinking 5! was 1+2+3+4+5
Is there a sumof operator?
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that I said that exponentiation wasn't acceptable, merely that I didn't know.
True, but you tried to discourage it.
'^' is used in programming languages as an exponent operator, but isn't a real math operator
Of course ^ is just computer shorthand for the "real" (i.e. more common) mathematical notation, which would be to write the exponent as a superscript. Doesn't even require any extra symbols; it's purely positional. Just as valid as the "operator" that says two fives next to each other == fifty-five. Except we can't show it properly in this forum without the ^ symbol because HTML is off.
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is another solution
(5! + 5! - 55)/5
 
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks correct!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This one works too
(5! / (5 + 5)) + (5 * 5)
 
reply
    Bookmark Topic Watch Topic
  • New Topic