Four fours

Four fours

Four fours is a mathematical puzzle. The goal of four fours is to find the simplest mathematical expression for every whole number from 0 to some maximum, using only common mathematical symbols and the digit four (no other digit is allowed). Most versions of four fours require that each expression have exactly four fours, but some variations require that each expression have the minimum number of fours.

Rules

There are many variations of four fours; their primary difference is which mathematical symbols are allowed. Essentially all variations at least allow addition ("+"), subtraction ("−"), multiplication ("×"), division ("÷"), and parentheses, as well as concatenation (e.g., "44" is allowed). Most also allow the factorial ("!"), exponentiation (e.g. "444"), the decimal digit (".") and the square root operation, although sometimes square root is specifically excluded on the grounds that there is an implied "2" for the second root. Other operations allowed by some variations include subfactorial, ("!" before the number: !4 equals 9),overline (an infinitely repeated digit), an arbitrary root power, the gamma function (Γ(), where Γ("x") = ("x" − 1)!),and percent ("%"). Thus 4/4% = 100 and Γ(4)=6. A common use of the overline in this problem is for this value::.overline{4} = .4444... = 4/9

Typically the "log" operators are not allowed, since there is a way to trivially create any number using them. Paul Bourke credits Ben Rudiak-Gould with this description of how natural logarithms (ln()) can be used to represent any positive integer "n" as::n = -sqrt4frac{lnleft [left(lnunderbrace{sqrt{sqrt{cdotssqrt4}_{n} ight) / ln4 ight] }{ln{4

Additional variants (usually no longer called "four fours") replace the set of digits ("4, 4, 4, 4") with some other set of digits, say of the birthyear of someone. For example, a variant using "1975" would require each expression to use one 1, one 9, one 7, and one 5.

olutions

Here is a set of four fours solutions for the numbers 0 through 20, using typical rules. Some alternate solutions are listed here, although there are actually many more correct solutions

* 0 = 44 − 44 = 4 − 4 + 4 − 4
* 1 = 44 ÷ 44 = 4 ÷ 4 + 4 − 4
* 2 = 4 ÷ 4 + 4 ÷ 4
* 3 = (4 + 4 + 4) ÷ 4
* 4 = 4 ×(4 − 4) + 4
* 5 = (4 × 4 + 4) ÷ 4
* 6 = 4 × .4 + 4.4 = 4 + (4 + 4) ÷4
* 7 = 44 ÷ 4 − 4 = 4 + 4 − (4 ÷ 4)
* 8 = 4 + 4.4 − .4 = 4 + 4 + 4 − 4
* 9 = 4 + 4 + (4 ÷ 4)
* 10 = (44 − 4) / 4 = 44 ÷ 4.4 = 4 + √4 + √4 + √4
* 11 = 4 ÷ .4 + 4 ÷ 4
* 12 = (44 + 4) ÷ 4
* 13 = 4! − 44 ÷ 4
* 14 = 4 × (4 − .4) − .4 = 4 ÷ .4 + √4 + √4
* 15 = 44 ÷ 4 + 4 = 4 × 4 − 4 ÷ 4
* 16 = .4 × (44 − 4) = 4 × 4 × 4 ÷ 4 = 4 + 4 + 4 + 4 = √4 × √4 × √4 × √4
* 17 = 4 × 4 + 4 ÷ 4
* 18 = 44 × .4 + .4 = 4 × 4 + 4 ÷ √4
* 19 = 4! − 4 − 4 ÷ 4
* 20 = 4 × (4 ÷ 4 + 4)

Note that numbers with values less than one are not usually written with a leading zero. For example, "0.4" is usually written as ".4". This is because "0" is a digit, and in this puzzle only the digit "4" can be used.

A given number will generally have many possible solutions; any solution that meets the rules is acceptable. Some variations prefer the "fewest" number of operations, or prefer some operations to others. Others simply prefer "interesting" solutions, i.e., a surprising way to reach the goal.

Certain numbers, such as 113 and 123, are particularly difficult to solve under typical rules. For 113, Wheeler suggests Γ(Γ(4)) −(4! + 4)/4. For 123, Wheeler suggests the expression:

:sqrt{sqrt{sqrtleft(sqrt{4}/.4 ight)}^{4! - sqrt{4}.

The first printed occurrence of this activity is in "Mathematical Recreations and Essays" by W. W. Rouse Ball published in 1892. In this book it is described as a "traditional recreation".

Algorithmics of the problem

This problem and its generalizations (like the five fives and the six sixes problem, both shown below) may be solved by a simple algorithm. The basic ingredients are hash tables that map rationals to strings. In these tables, the keys are the numbers being represented by some admissible combination of operators and the chosen digit "d", e.g. four, and the values are strings that contain the actual formula. There is one table for each number "n" of occurrences of "d". For example, when "d=4", the hash table for two occurrences of "d" would contain the key-value pair "8" and 4+4, and the one for three occurrences, the key-value pair "2" and (4+4)/4 (strings shown in bold).

The task is then reduced to recursively computing these hash tables for increasing "n", starting from "n=1" and continuing up to e.g. "n=4." The tables for "n=1" and "n=2" are special, because they contain primitive entries that are not the combination of other, smaller formulas, and hence they must be initialized properly, like so (for "n=1") T [4] := "4"; T [4/10] := ".4"; T [4/9] := ".4...";

and

T [44] := "44";.

(for "n=2"). Now there are two ways in which new entries may arise, either as a combination of existing ones through a binary operator, or by applying the factorial or square root operators (which does not use additional instances of "d"). The first case is treated by iterating over all pairs of subexpressions that use a total of "n" instances of "d". For example, when "n=4", we would check pairs "(a,b)" with "a" containing one instance of "d" and "b" three, and with "a" containing two instances of "d" and "b" two as well. We would then enter "a+b, a-b, b-a, a*b, a/b, b/a)" into the hash hable, including parenthesis, for "n=4". Here the sets "A" and "B" that contain "a" and "b" are calculated recursively, with "n=1" and "n=2" being the base case. Memoization is used to ensure that every hash table is only computed once.

The second case (factorials and roots) is treated with the help of an auxiliary function, which is invoked every time a value "v" is recorded. This function computes nested factorials and roots of "v" up to some maximum depth, restricted to rationals.

The last phase of the algorithm consists in iterating over the keys of the table for the desired value of "n" and extracting and sorting those keys that are integers. This algorithm was used to calculate the five fives and six sixes examples shown below. The more compact formula (in the sense of number of characters in the corresponding value) was chosen every time a key occurred more than once.

Excerpt from the solution to the five fives problem

In the table below, the notation .5... represents the value 5/9 (recurring decimal 5).

139 = ((((5+(5/5)))!/5)-5) 140 = (.5*(5+(5*55))) 141 = ((5)!+((5+(5+.5))/.5)) 142 = ((5)!+((55/.5)/5)) 143 = ((((5+(5/5)))!-5)/5) 144 = ((((55/5)-5))!/5) 145 = ((5*(5+(5*5)))-5) 146 = ((5)!+((5/5)+(5*5))) 147 = ((5)!+((.5*55)-.5)) 148 = ((5)!+(.5+(.5*55))) 149 = (5+(((5+(5/5)))!/5))

Excerpt from the solution to the six sixes problem

241 = ((.6+((6+6)*(6+6)))/.6) 242 = ((6*(6+(6*6)))-(6/.6)) 243 = (6+((6*(.6*66))-.6)) 244 = (.6...*(6+(6*(66-6)))) 245 = ((((6)!+((6)!+66))/6)-6) 246 = (66+(6*((6*6)-6))) 247 = (66+((6+((6)!/.6...))/6)) 248 = (6*(6+(6*(6-(.6.../6))))) 249 = (.6+(6*(6+((6*6)-.6)))) 250 = (((6*(6*6))-66)/.6) 251 = ((6*(6+(6*6)))-(6/6)) 252 = (66+(66+((6)!/6))) 253 = ((6/6)+(6*(6+(6*6)))) 254 = ((.6...*((6*66)-6))-6) 255 = ((((6*6)+66)/.6)/.6...) 256 = (6*(6*(6-(6/(.6-6))))) 257 = (6+(((6)!+((6)!+66))/6)) 258 = ((6)!-(66+(6*66))) 259 = ((((6*6)+((6)!/6))-.6)/.6) 260 = ((66+(((6)!/.6)/6))-6)

ee also

*Krypto (game)

External links

* [http://astronomy.swin.edu.au/~pbourke/fun/4444 Bourke, Paul. "Four Fours Problem".]
* [http://www.dwheeler.com/fourfours Wheeler, David A. 2002. "The Definitive Four Fours Answer Key".]
* [http://www.johnvalentine.co.uk/p00010.html John Valentine's Four Fours page.]
* [http://www-2.cs.cmu.edu/~chengwen/four4/four4.html Cheng-Wen's Four Fours page.]
* [http://www.cut-the-knot.org/arithmetic/funny/4_4.shtml A. Bogomolny's Four Fours page] at cut-the-knot
* [http://mathforum.org/ruth/four4s.puzzle.html Carver, Ruth. "Four Fours Puzzle" at MathForum.org]
* [http://www.wheels.org/math/44s.html "Four Fours Problem" at Wheels.org]
* [http://www.math.toronto.edu/mathnet/questionCorner/fourfours.html University of Toronto Math Net's The Four Fours Problem]
* [http://drb9.drb.insel.de/~heiner/Puzzles/Year Marxen, Heiner. The Year Puzzle]

* [http://groups.google.com/group/es.ciencia.matematicas/browse_thread/thread/95c4be93ed0a38fe/3a19c844a815a9e8?lnk=raot#3a19c844a815a9e8 Riedel, Marko. A MAPLE program for the Four Fours problem]
* [http://groups.google.com/group/es.ciencia.matematicas/browse_thread/thread/fe6327c55ca865df/e9e694e07265091b#e9e694e07265091b Riedel, Marko. Solutions to the Five Fives and Six Sixes problem]


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Four/Fours —   [englisch/amerikanisch, fɔː(r)/fɔː(r)s], Chase Chorus …   Universal-Lexikon

  • Fours — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom.  Pour l’article homophone, voir Four. Fours est un nom de lieu notamment porté par : Fours, commune française de la Gironde Fours, commune… …   Wikipédia en Français

  • four — [ fur ] n. m. • forn 1080; lat. furnus 1 ♦ Ouvrage de maçonnerie généralement voûté, de forme circulaire, muni d une ouverture par devant, et où l on fait cuire le pain, la pâtisserie, etc. Four de boulanger. Four à pizza. Bouche, gueule d un… …   Encyclopédie Universelle

  • Fours à bois (céramique) — Four dragon (Japon). Un four à bois est un four utilisant, comme combustible, le bois et dans lequel les cendres végétales peuvent également, dans certains cas, être utilisées à des fins de glaçure. Les fours à bois ont été les premiers fours… …   Wikipédia en Français

  • Fours électriques à résistances — Four Pour les articles homonymes, voir Four (homonymie). Four solaire d Odeillo en France Un four est une …   Wikipédia en Français

  • Four à pain — Four collectif (daté de 1870) de la maison Cornec à St Rivoal dans le Finistère Le four à pain est un four spécifiquement consacré à la cuisson du pain. On en trouve dans diverses régions du monde : en Afrique (le tinzia et le tabun), en… …   Wikipédia en Français

  • Four électrique — Four Pour les articles homonymes, voir Four (homonymie). Four solaire d Odeillo en France Un four est une …   Wikipédia en Français

  • Fours à pain — Four à pain Four collectif (daté de 1870) de la maison Cornec à St Rivoal dans le Finistère Sommaire 1 Four à pain t …   Wikipédia en Français

  • Four a reverbere — Four à réverbère Principe du four à réverbère Schéma effectué à partir de la planche XXIV de l ouvrage Description de l art de fabriquer des canons de Gaspard Monge(18 pluviôse an 2 : 6 février 1794 Un four à réverbère est un four où la… …   Wikipédia en Français

  • Four À Réverbère — Principe du four à réverbère Schéma effectué à partir de la planche XXIV de l ouvrage Description de l art de fabriquer des canons de Gaspard Monge(18 pluviôse an 2 : 6 février 1794 Un four à réverbère est un four où la chaleur est réfléchie …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”