MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: combinatoric card problem

  • To: mathgroup at
  • Subject: [mg25842] Re: combinatoric card problem
  • From: Mike Yukish <may106 at>
  • Date: Wed, 1 Nov 2000 01:25:31 -0500 (EST)
  • Organization: Penn State University, Center for Academic Computing
  • References: <8tdrsn$>
  • Sender: owner-wri-mathgroup at

You want to form all possible strings of the form

A  x  B  y  C  z  D

Where A, B, C, D  are in the set {1,...,13}
and x, y, z are in the set  {*, /, +, -}

You also need to account for the unique combinations of parentheses.

The largest number you'd get is L=13^4, and the smallest number you'd get is
S=(1-13)*13^3, so make a list of size (L+S) indexed from -S. Build each string
Q, stick the string Q at the position of the list EvaluateString[Q]. Throw out
non-integers. Just overwrite any old answers when you have duplicates.

Hit shift-return, and go play outside for a while, and voila, your list.

pw wrote:

> In China they often play this card game:
> put four card on a table and try, as fast as possible, to arrive to the
> result 24 using only addtion subtraction multiplication and division.
> ex. the cards: { hearts_6 ,hearts_7 ,clove_8 ,spades_king } gives the
> numbers:
> {6,7,8,12}
> and 12*(6+8)/7=24
> Is there some way to do determine how to do this with mathematica, or maybe
> there is some way to determine if a certain quadruple can make the required
> result?
> Peter W

  • Prev by Date: Re: Is it possible to plot a point a time on the same graph in Mathematica?
  • Next by Date: Re: combinatoric card problem
  • Previous by thread: Re: combinatoric card problem
  • Next by thread: Re: combinatoric card problem