Re: combinatoric card problem
- To: mathgroup at smc.vnet.net
- Subject: [mg25842] Re: combinatoric card problem
- From: Mike Yukish <may106 at psu.edu>
- Date: Wed, 1 Nov 2000 01:25:31 -0500 (EST)
- Organization: Penn State University, Center for Academic Computing
- References: <8tdrsn$61d@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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