Solving a simple addition / multiplication puzzle.
|
02-22-2024, 09:47 PM
(This post was last modified: 02-22-2024 11:37 PM by deachp.)
Post: #12
|
|||
|
|||
RE: Solving a simple addition / multiplication puzzle.
Hello,
It's an underdetermined system of 4 variables and two equations, therefore it has infinitely many solutions. If the goal is to obtain positive values with two decimal points, one can combine a quadratic equation, divisor calculation, and filtering out negative numbers and rational numbers. Here, I've developed a program for the 50G calculator that could be ported to the HP Prime: « 711 0 0 0 0 0 0 -> P a b c d ldivis ldivis2 « 4 P * 1000000 * DIVIS 'ldivis' STO 1 ldivis SIZE FOR i ldivis i GET 'a' STO 4 P * a / DIVIS 'ldivis2' STO 1 ldivis2 SIZE FOR j ldivis2 j GET 'b' STO IF '((a+b)-P)^2' ->NUM '4*P*1000000/(a*b)' ->NUM >= THEN IF '((P-(a+b))+SQRT(((a+b)-P)^2-4*P*1000000/(a*b)))/2' ->NUM DUP FP 0 == THEN 'c' STO 'P-c-a-b' EVAL 'd' STO IF a 0 > b 0 > AND c 0 > AND d 0 > AND THEN a I->R 100 / "a" ->TAG b I->R 100 / "b" ->TAG c I->R 100 / "c" ->TAG d I->R 100 / "d" ->TAG END ELSE DROP END END NEXT NEXT » » SQRT: Square root symbol -> : Arrow a:1.25 b:3.16 c:1.5 d:1.2 It takes 20 sec., to emulator in "Authentic Calculator Speed" mode, to found the answers. It can be optimized. -Dante Aroní C. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)