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

Home > General > Tricks
A neat trick (Posted on 2013-12-26) Difficulty: 3 of 5
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?

See The Solution Submitted by Ady TZIDON    
Rating: 4.0000 (1 votes)

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      actual
predicted                   term
9             1  40         1381          2235          2234
9             1  41         1415          2290          2289
9             1  42         1449          2345          2344
9             1  43         1483          2400          2399
9             1  44         1517          2455          2454
9             1  45         1551          2510          2509
9             1  46         1585          2565          2564
9             1  47         1619          2620          2619
9             1  48         1653          2675          2674
9             1  49         1687          2730          2729
9             1  50         1721          2785          2784
9             2  42         1470          2379          2378
9             2  43         1504          2434          2433
9             2  44         1538          2489          2488
9             2  45         1572          2544          2543
9             2  46         1606          2599          2598
9             2  47         1640          2654          2653
9             2  48         1674          2709          2708
9             2  49         1708          2764          2763
9             2  50         1742          2819          2818
9             3  43         1525          2468          2467
9             3  44         1559          2523          2522
9             3  45         1593          2578          2577
9             3  46         1627          2633          2632
9             3  47         1661          2688          2687
9             3  48         1695          2743          2742
9             3  49         1729          2798          2797
9             3  50         1763          2853          2852
9             4  45         1614          2612          2611
9             4  46         1648          2667          2666
9             4  47         1682          2722          2721
9             4  48         1716          2777          2776
9             4  49         1750          2832          2831
9             4  50         1784          2887          2886
9             5  47         1703          2756          2755
9             5  48         1737          2811          2810
9             5  49         1771          2866          2865
9             5  50         1805          2921          2920
9             6  48         1758          2845          2844
9             6  49         1792          2900          2899
9             6  50         1826          2955          2954
9             7  50         1847          2989          2988

  Posted by Charlie on 2013-12-26 13:34:29
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information