Post Reply 
Solving a simple addition / multiplication puzzle.
02-20-2024, 06:47 PM (This post was last modified: 02-20-2024 08:05 PM by Albert Chan.)
Post: #11
RE: Solving a simple addition / multiplication puzzle.
(02-19-2024 04:53 PM)Albert Chan Wrote:  Do this by hand, I would probably try A in reverse order.
Even if tested number is not a, it may have hit b or c.

>>> A[::-1]
[125, 120, 100, 96, 90, 80, 79, 75]

Perhaps we should *not* check if the number hit b or c, to avoid double counting.
Try first number from A[::-1], apply AM/GM inequality for (b, d) valid ranges:

a = 125
b = 094 .. 133, possibilities = [125, 120, 100]
d = 247 .. 318, possibilities = [250, 288, 300, 316]

It is true that from possible (b,d)'s, we have solved the puzzle.
What if solution is not here? Then, we try the next one on the list.

a = 120
b = 098 .. 136, possibilities = [125, 120, 100]
d = 247 .. 318, possibilities = [250, 288, 300, 316]

Now, (a,b)=(120,125) is double counted. Same thing happens for case a=100
It is better to assume a is really the smallest. For a=125, only test for b=125

With a≤b restriction, no double counting.
Code:
a       b           b's     d           d's     (b's)×(d's)
125     125 .. 133  1       247 .. 318  4       4
120     120 .. 136  2       247 .. 318  4       8
100     117 .. 152  4       248 .. 306  3       12
 96     122 .. 156  3       247 .. 301  3       9
 90     133 .. 164  4       245 .. 292  2       8
 80     161 .. 183  1       236 .. 264  3       3
 79     166 .. 186  1       234 .. 259  3       3
 75     195 .. 203  1       221 .. 229  1       1
        TOTAL CASES 17                  23      48

Use quadratic formula for (c,d), cases to check = 17
But even tried all possible (c,d)'s, total cases is only 48

What if we know a is multiple of 79? (Again, (b,c,d) assume sorted)
Code:
a       b           b's     d           d's     (b's)×(d's)
79*1    166 .. 186  1       234 .. 259  2       2
79*2     81 .. 119  3       237 .. 313  4       12
79*3     76 .. 107  4       200 .. 258  4       16
79*4    114 .. 122  1       141 .. 150  2       2
        TOTAL CASES 9                  12       32

Note: we don't have to actually solve all the valid ranges.

Keeping same GM, if numbers are further apart, AM will grow bigger.
If it is impossible to make AM ≥ GM, there is no solution ... we skipped it.
This allowed "solving" AM/GM inequality by trial and errors. (see post #2)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Solving a simple addition / multiplication puzzle. - Albert Chan - 02-20-2024 06:47 PM



User(s) browsing this thread: 1 Guest(s)