All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 A neat trick (Posted on 2013-12-26)
A magician asks you to choose two integers between 1 and 50 and add them.
Then add the largest two of the three integers at hand.
Then add the largest two again.
Repeat this around ten times.
Disclose to the magician your final number n.

The magician then tells you the next number.

How?

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: I would need a calculator (spoiler) | Comment 3 of 5 |
(In reply to I would need a calculator (spoiler) by Steve Herman)

DEFDBL A-Z
CLS
FOR a = 1 TO 50
FOR b = a TO 50
x = a: y = b
FOR i = 1 TO 13
z = x + y
x = y: y = z
IF i >= 9 THEN
pred = INT(x * 1.618034 + .5)
IF pred <> y THEN
PRINT i, a; b, x, pred, y
END IF
END IF
NEXT
NEXT
NEXT

finds that the last failure is in trying to predict the ninth iteration from the eighth. The truncated version (1.618) starts to fail again trying to predict the 13th from the 12th.

The failures for gen 8 to gen 9 using the more accurate multiplier:

`term to be    a   b         prev        predicted      actualpredicted                   term9             1  40         1381          2235          22349             1  41         1415          2290          22899             1  42         1449          2345          23449             1  43         1483          2400          23999             1  44         1517          2455          24549             1  45         1551          2510          25099             1  46         1585          2565          25649             1  47         1619          2620          26199             1  48         1653          2675          26749             1  49         1687          2730          27299             1  50         1721          2785          27849             2  42         1470          2379          23789             2  43         1504          2434          24339             2  44         1538          2489          24889             2  45         1572          2544          25439             2  46         1606          2599          25989             2  47         1640          2654          26539             2  48         1674          2709          27089             2  49         1708          2764          27639             2  50         1742          2819          28189             3  43         1525          2468          24679             3  44         1559          2523          25229             3  45         1593          2578          25779             3  46         1627          2633          26329             3  47         1661          2688          26879             3  48         1695          2743          27429             3  49         1729          2798          27979             3  50         1763          2853          28529             4  45         1614          2612          26119             4  46         1648          2667          26669             4  47         1682          2722          27219             4  48         1716          2777          27769             4  49         1750          2832          28319             4  50         1784          2887          28869             5  47         1703          2756          27559             5  48         1737          2811          28109             5  49         1771          2866          28659             5  50         1805          2921          29209             6  48         1758          2845          28449             6  49         1792          2900          28999             6  50         1826          2955          29549             7  50         1847          2989          2988`

 Posted by Charlie on 2013-12-26 13:34:29

 Search: Search body:
Forums (0)