Each digit you can use only once!
Spoiler
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
Spoiler
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
Okay, sorry about that first message. I accidentally hit Enter when pasting
those colons and it sent the message.
Here's my one and only solution (though I'm sure there are more):
((2/8) + 6) * 4 = 25
Cheers.
-Fraggler?
--
www.reality-syndicate.com
A forum for the free exchange
of abnormal ideas and media!
> > and only the arithmetic operations + - * /
> > and reach 25.
> >
> > Each digit you can use only once!
> >
>
> Spoiler
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> :
> ((2/8) + 6) * 4 = 25
In that case, I have a solution too:
2468*K
(where K happens to have a value of 25/2468 :-)
--
Peter
> > > ((2/8) + 6) * 4 = 25
> >
> > In that case, I have a solution too:
> >
> > 2468*K
> >
> > (where K happens to have a value of 25/2468 :-)
> Sorry, K is not allowed :-)
In that case, "((2/8) + 6) * 4" is not allowed either,
and the problem, as stated, has no solution.
--
Peter
The problem didn't specify algebraic notation. Using Polish prefix
notation we could express this one as:
* + / 2 8 6 4
Or, more transparently,
* 4 + 6 / 2 8
--
Jim Gillogly
30 Afteryule S.R. 2001, 04:13
12.19.7.16.5, 4 Chicchan 8 Muan, First Lord of Night
> > > > > ((2/8) + 6) * 4 = 25
> > > >
> > > > In that case, I have a solution too:
> > > >
> > > > 2468*K
> > > >
> > > > (where K happens to have a value of 25/2468 :-)
> >
> > > Sorry, K is not allowed :-)
> >
> > In that case, "((2/8) + 6) * 4" is not allowed either,
> > and the problem, as stated, has no solution.
>
> The problem didn't specify algebraic notation. Using Polish prefix
> notation we could express this one as:
> * + / 2 8 6 4
> Or, more transparently,
> * 4 + 6 / 2 8
True, then we can just use integer arithmetic with standard infix
notation: 24 + 8 / 6
--
Peter
They are always allowed in such a puzzle, because it's shorthand notation
for 'I divide 2 by 8, add 6, and multiply the result by 4' which only uses
the four arithmetic operations. parentheses are nothing more than
indications of operator order.
But you don't need parentheses:
2 / 8 + 6 * 4 (strict left, happens to work on this one)
2 8 6 4 / + * (reverse polish, always works)
For the record: [reverse] polish is the easiest way to enumerate over the
possibilities for a brute-force program.
SaSW,
--
Willem (at stack dot nl)
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
> ): > > and only the arithmetic operations + - * /
> ): > > and reach 25.
> ): > >
> ): > > Each digit you can use only once!
> ): > ((2/8) + 6) * 4 = 25
> )Where are parentheses allowed?
> They are always allowed in such a puzzle, because it's shorthand notation
This particular puzzle explicitly stated "only" these digits and "only"
these operations.
> for 'I divide 2 by 8, add 6, and multiply the result by 4' which only uses
> the four arithmetic operations. parentheses are nothing more than
> indications of operator order.
They are symbols/characters/marks, etc, and this puzzle is about making
do with a specified set of such symbols.
> But you don't need parentheses:
>
> 2 / 8 + 6 * 4 (strict left, happens to work on this one)
> 2 8 6 4 / + * (reverse polish, always works)
and then there are different bases,
and one could use positional exponentiation, which uses no other symbols.
There is a certain elegance in using conventional manners, and a certain
sophistry in resorting to nonconventional trickery.
> For the record: [reverse] polish is the easiest way to enumerate over the
> possibilities for a brute-force program.
How so? I don't think so. Au contraire.
"When in doubt, use brute force." -- Ken Thompson
--
Peter
It said _use_ only these operations. It _didn't_ say in what order. Using
parentheses is just shorthand for specifying the order. In other words: the
parentheses aren't 'used', they're just a form of notation about the way you
use the arithmetic operations.
)> for 'I divide 2 by 8, add 6, and multiply the result by 4' which only uses
)> the four arithmetic operations. parentheses are nothing more than
)> indications of operator order.
)
)They are symbols/characters/marks, etc, and this puzzle is about making
)do with a specified set of such symbols.
If the puzzle said: 'Make a formula using each member of this set of digits
once, any number of members from this set of symbols and nothing else' I
would agree with you. But it said '_use_ members from this set of
_operations_ ...'
For example, the following would also be correct:
2 / 8 = 1/4, 1/4 + 6 = 6 1/4, 6 1/4 * 4 = 25
The puzzle stated _nothing_ about the notation of the answer.
)> But you don't need parentheses:
)>
)> 2 / 8 + 6 * 4 (strict left, happens to work on this one)
)> 2 8 6 4 / + * (reverse polish, always works)
)
)and then there are different bases,
)and one could use positional exponentiation, which uses no other symbols.
)
)There is a certain elegance in using conventional manners, and a certain
)sophistry in resorting to nonconventional trickery.
This is no trickery. They all mean exactly the same, namely: 'divide two by
eight, then add six to that, and multiply the result by four'
No elegance or sophistry, just different notation. You can't compare using
polish _notation_ to using different bases and positional exponentiation.
By the way, positional exponentiation is dissalowed, as you're only allowed
to _use_ the _operations_ + - * /, which doesn't include exponentiation.
)> For the record: [reverse] polish is the easiest way to enumerate over the
)> possibilities for a brute-force program.
)
)How so? I don't think so. Au contraire.
Besides the fact that reverse polish is easy to implement (think 'stack'),
there are only a small number of distinct patterns with four numbers and
three symbols, and then you can easily iterate over all possibilities.
I'd like to know what you think is easier than that.
> )> For the record: [reverse] polish is the easiest way to enumerate over the
> )> possibilities for a brute-force program.
> )
> )How so? I don't think so. Au contraire.
>
> Besides the fact that reverse polish is easy to implement (think 'stack'),
> there are only a small number of distinct patterns with four numbers and
> three symbols, and then you can easily iterate over all possibilities.
>
> I'd like to know what you think is easier than that.
It's no harder to have those 4 symbols between the 4 numbers.
(5 symbols, actually, but that's an implementation detail)
And there are lots of ready made infix expression evaluators you can feed
the results to, e.g. bc or awk, without having to write your own.
--
Peter
> > ): > Doron Stein <dos...@cisco.com> wrote in message
> > ): > > and only the arithmetic operations + - * /
> > ): > > and reach 25.
> [...]
> > )Where are parentheses allowed?
> [...]
> They are symbols/characters/marks, etc, and this puzzle is about making
> do with a specified set of such symbols.
Funny, I could have sworn it was about making do with a specified set
of operations.
Paul
In all NATO countries, except as explicitly prohibited.
Nick
--
Nick Wedd ni...@maproom.co.uk
Do you maintain that parentheses are digits, or that they are
operations?
>> for 'I divide 2 by 8, add 6, and multiply the result by 4' which only uses
>> the four arithmetic operations. parentheses are nothing more than
>> indications of operator order.
>
>They are symbols/characters/marks, etc, and this puzzle is about making
>do with a specified set of such symbols.
Is it? How do you know? Doron Stein, who posted the puzzle, did not
say so.
>> But you don't need parentheses:
>>
>> 2 / 8 + 6 * 4 (strict left, happens to work on this one)
>> 2 8 6 4 / + * (reverse polish, always works)
>
>and then there are different bases,
>and one could use positional exponentiation, which uses no other symbols.
>
>There is a certain elegance in using conventional manners, and a certain
>sophistry in resorting to nonconventional trickery.
Quite. That is why
(6 + 2 / 8 ) * 4 = 25
is a good answer, and
2 / 8 + 6 * 4
2 8 6 4 / + *
are not.
Okay, it's been a while since I worked with reverse polish, but
doesn't your expression evaluate to 19? It looks like you first
divided 6 by 4 to get 1 1/2, then added 8 to get 9 1/2, then you
multiplied by 2 to get 19. If polish expressions are *stacked*
as I remember, then the expression you were after was:
4 6 2 8 / + *
One *other* solution (which some might consider illegal) which
hasn't been suggested yet: Turn the 6 digit *upside down* and
write: (98 + 2) / 4 = 25 (At least that avoids fractions!)
-- Jim Waters <jwa...@az.com>
Sent via Deja.com
http://www.deja.com/
Yup, you're right, my bad. (I just typed into an rpn-calculator)
ObTrivia: WTF ? Is there a calculator that you can type reverse polish
into ? What is it called ?
)One *other* solution (which some might consider illegal) which
)hasn't been suggested yet: Turn the 6 digit *upside down* and
)write: (98 + 2) / 4 = 25 (At least that avoids fractions!)
Illegal! That also has parentheses! ;-)
How about the woodworker's answer: 9 + 8 + 4 + 2 = 25 ?
SaSW,
--
Willem (at stack dot nl)
> ObTrivia: WTF ? Is there a calculator that you can type reverse polish
> into ? What is it called ?
Yes. dc
try "man dc"
--
Peter
HP calculators at least used too use RPN. excellent. PN or RPN are so
elegant.
peter
| elegant. ^
not so elegant
>ObTrivia: WTF ? Is there a calculator that you can type reverse polish
>into ? What is it called ?
I use a Hewlett Packard 48G (which is still being sold), and prefer to use
reverse Polish notation (RPN). Many calculators use infix with the four
basic functions (add, subtract, multiply, and divide), but resort to reverse
Polish for the rest of the functions (sine, cosine, square root, tangent,
etc.). With a true RPN calculator, the functions are consistently reverse
Polish, rather than partly infix and partly reverse Polish.
Carl G.
I couldn't agree more! This story reminds me of my good old HP 25 (bought it
in 1974, retired it around 1984, by that time the LEDs had gotten a *lot*
dimmer), the first device I programmed ;-)
Luc
Most calculators use infix with binary operators and postfix with
unary operators; obviously they can't use infix with unary operators,
so I don't consider this inconsistent.
--
Matthew T. Russotto russ...@pond.com
"Extremism in defense of liberty is no vice, and moderation in pursuit
of justice is no virtue."