Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Use 4 digits only: 2 4 6 8

0 views
Skip to first unread message

Doron Stein

unread,
Jan 20, 2001, 3:03:57 AM1/20/01
to

and only the arithmetic operations + - * /
and reach 25.

Each digit you can use only once!

Fraggler?

unread,
Jan 20, 2001, 5:11:59 AM1/20/01
to

Doron Stein <dos...@cisco.com> wrote in message
news:3A69466D...@cisco.com...

>
> and only the arithmetic operations + - * /
> and reach 25.
>
> Each digit you can use only once!
>

Spoiler
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:


Fraggler?

unread,
Jan 20, 2001, 5:14:40 AM1/20/01
to

Doron Stein <dos...@cisco.com> wrote in message
news:3A69466D...@cisco.com...
>
> and only the arithmetic operations + - * /
> and reach 25.
>
> Each digit you can use only once!
>

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!


Peter Renzland

unread,
Jan 20, 2001, 11:32:40 AM1/20/01
to
Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
>
> Doron Stein <dos...@cisco.com> wrote in message

> > 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

Doron Stein

unread,
Jan 20, 2001, 3:20:09 PM1/20/01
to
Sorry, K is not allowed :-)

Lee

unread,
Jan 20, 2001, 4:59:05 PM1/20/01
to

"Peter Renzland" <N010...@dancing.org> wrote in message
news:I4ja6.334069$_5.75...@news4.rdc1.on.home.com...

: Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
: >
: > Doron Stein <dos...@cisco.com> wrote in message
:
: > > and only the arithmetic operations + - * /
: > > and reach 25.
: > >
: > > Each digit you can use only once!
: > >
: >
: > Spoiler
: > ((2/8) + 6) * 4 = 25
:
Where are parentheses allowed?


Peter Renzland

unread,
Jan 20, 2001, 9:56:46 PM1/20/01
to
Doron Stein wrote on Sat, 20 Jan 2001 22:20:09 +0200:
> Peter Renzland wrote:
> > Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
> > > Doron Stein <dos...@cisco.com> wrote in message
> >
> > > > and only the arithmetic operations + - * /
> > > > and reach 25.
> > > >
> > > > Each digit you can use only once!

> > > ((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

Jim Gillogly

unread,
Jan 20, 2001, 11:17:09 PM1/20/01
to

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

Peter Renzland

unread,
Jan 20, 2001, 11:56:26 PM1/20/01
to
Jim Gillogly wrote on Sat, 20 Jan 2001 20:17:09 -0800:
> Peter Renzland wrote:
> > Doron Stein wrote on Sat, 20 Jan 2001 22:20:09 +0200:
> > > Peter Renzland wrote:
> > > > Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
> > > > > Doron Stein <dos...@cisco.com> wrote in message
> > > >
> > > > > > and only the arithmetic operations + - * /
> > > > > > and reach 25.
> > > > > >
> > > > > > Each digit you can use only once!

> > > > > ((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

Willem-Jan Monsuwe

unread,
Jan 21, 2001, 4:48:38 PM1/21/01
to
In article <94d1o3$op1$1...@news.snowcrest.net>, Lee wrote:
)
)"Peter Renzland" <N010...@dancing.org> wrote in message
)news:I4ja6.334069$_5.75...@news4.rdc1.on.home.com...
): Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
): >
): > Doron Stein <dos...@cisco.com> wrote in message
):
): > > and only the arithmetic operations + - * /
): > > and reach 25.
): > >
): > > Each digit you can use only once!
): > >
): >
): > Spoiler
): > ((2/8) + 6) * 4 = 25
):
)Where are parentheses allowed?

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

Peter Renzland

unread,
Jan 21, 2001, 5:26:37 PM1/21/01
to
Willem-Jan Monsuwe wrote on 21 Jan 2001 21:48:38 GMT:
> In article <94d1o3$op1$1...@news.snowcrest.net>, Lee wrote:
> )"Peter Renzland" <N010...@dancing.org> wrote in message
> ): Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
> ): > Doron Stein <dos...@cisco.com> wrote in message

> ): > > 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

Willem-Jan Monsuwe

unread,
Jan 21, 2001, 6:23:05 PM1/21/01
to
)> ): > > 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.

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.

Peter Renzland

unread,
Jan 21, 2001, 6:52:38 PM1/21/01
to
Willem-Jan Monsuwe wrote on 21 Jan 2001 23:23:05 GMT:

> )> 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

Paul Guertin

unread,
Jan 22, 2001, 8:25:03 AM1/22/01
to
N010...@dancing.org (Peter Renzland) wrote:

> > ): > 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

Nick Wedd

unread,
Jan 29, 2001, 6:16:22 PM1/29/01
to
In article <94d1o3$op1$1...@news.snowcrest.net>, Lee <sh...@snowcrest.net>
writes

In all NATO countries, except as explicitly prohibited.

Nick
--
Nick Wedd ni...@maproom.co.uk

Nick Wedd

unread,
Jan 29, 2001, 6:16:56 PM1/29/01
to
In article <xmJa6.340337$_5.776...@news4.rdc1.on.home.com>, Peter
Renzland <N010...@dancing.org> writes

>Willem-Jan Monsuwe wrote on 21 Jan 2001 21:48:38 GMT:
>> In article <94d1o3$op1$1...@news.snowcrest.net>, Lee wrote:
>> )"Peter Renzland" <N010...@dancing.org> wrote in message
>> ): Fraggler? wrote on Sat, 20 Jan 2001 02:14:40 -0800:
>> ): > Doron Stein <dos...@cisco.com> wrote in message
>
>> ): > > 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.

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.

Jim Waters

unread,
Jan 30, 2001, 5:09:19 AM1/30/01
to
In article <slrn96mm9m...@toad.stack.nl>,

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/

Willem-Jan Monsuwe

unread,
Jan 30, 2001, 1:08:31 PM1/30/01
to
)> 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.
)
)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 / + *

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)

Peter Renzland

unread,
Jan 30, 2001, 2:10:07 PM1/30/01
to
Willem-Jan Monsuwe wrote on 30 Jan 2001 18:08:31 GMT:

> ObTrivia: WTF ? Is there a calculator that you can type reverse polish
> into ? What is it called ?

Yes. dc

try "man dc"

--
Peter

peter

unread,
Jan 30, 2001, 2:27:03 PM1/30/01
to
30 Jan 2001 18:08:31 GMT rec.puzzles Willem-Jan Monsuwe:

| ObTrivia: WTF ? Is there a calculator that you can type reverse polish
| into ? What is it called ?

HP calculators at least used too use RPN. excellent. PN or RPN are so
elegant.

peter

peter

unread,
Jan 30, 2001, 2:35:22 PM1/30/01
to
30 Jan 2001 19:27:03 GMT rec.puzzles peter:

| elegant. ^
not so elegant

Carl G.

unread,
Jan 30, 2001, 3:06:33 PM1/30/01
to

Willem-Jan Monsuwe wrote in message ...

>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.


Luc Kumps

unread,
Jan 30, 2001, 4:36:04 PM1/30/01
to

"Carl G." <cgi...@microprizes.com> wrote in message
news:d9Fd6.569$9B3....@newsread1.prod.itd.earthlink.net...

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

Matthew Russotto

unread,
Jan 30, 2001, 4:47:43 PM1/30/01
to
In article <d9Fd6.569$9B3....@newsread1.prod.itd.earthlink.net>,

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."

0 new messages