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. 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) 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) 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) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)