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

Home > Numbers
e pluribus unum ii (Posted on 2004-01-22) Difficulty: 3 of 5
Below are three groups of three numbers each. Combine the numbers in each group using the standard binary operations (addition, subtraction, multiplication, division, and exponentiation) so that each group yields the same number.
  1. 3, 15, 18
  2. 10, 13, 36
  3. 24, 27, 39

For an example, see the first problem.

See The Solution Submitted by DJ    
Rating: 4.7143 (7 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts Attempt at a computer solution | Comment 1 of 13
The following program fails to find a solution. The program itself tries to produce all possible results and place them in a file with the result at the beginning of each record. That file is sorted and then another program looks for matches with three different equations producing them.

I had written a program for pluribus 1, but due to a bug (not permuting the numbers) did not find the answer. This program could have some other bug, or the answer is more exotic than allowed for here:

DEFDBL A-Z

op$ = "+-*/^"
DATA 3,5,18, 10,13,36, 24,27,29
FOR i = 1 TO 3
  FOR j = 1 TO 3
    READ opnd(i, j)
  NEXT
NEXT

OPEN "epluribs.txt" FOR OUTPUT AS #2

FOR eq = 1 TO 3
 DO
  FOR op1 = 1 TO 5
   err1 = 0
   SELECT CASE op1
     CASE 1
       rslt1a = opnd(eq, 1) + opnd(eq, 2)
     CASE 2
       rslt1a = opnd(eq, 1) - opnd(eq, 2)
     CASE 3
       rslt1a = opnd(eq, 1) * opnd(eq, 2)
     CASE 4
       rslt1a = opnd(eq, 1) / opnd(eq, 2)
     CASE 5
       IF LOG(opnd(eq, 1)) * opnd(eq, 2) < 300 * LOG(10) THEN
        rslt1a = opnd(eq, 1) ^ opnd(eq, 2)
       ELSE
        rslt1a = 1: err1 = 1
       END IF
   END SELECT
   IF err1 = 0 THEN
     FOR op2 = 1 TO 5
       err1 = 0
       err2 = 0
       SELECT CASE op2
         CASE 1
           rslt2a = opnd(eq, 2) + opnd(eq, 3)
           rslt1 = rslt1a + opnd(eq, 3)
         CASE 2
           rslt2a = opnd(eq, 2) - opnd(eq, 3)
           rslt1 = rslt1a - opnd(eq, 3)
         CASE 3
           rslt2a = opnd(eq, 2) * opnd(eq, 3)
           rslt1 = rslt1a * opnd(eq, 3)
         CASE 4
           rslt2a = opnd(eq, 2) / opnd(eq, 3)
           rslt1 = rslt1a / opnd(eq, 3)
         CASE 5
           IF LOG(opnd(eq, 2)) * opnd(eq, 3) < 300 * LOG(10) THEN
            rslt2a = opnd(eq, 2) ^ opnd(eq, 3)
           ELSE
            rslt2a = 1: err2 = 1
           END IF
           IF LOG(ABS(rslt1a)) * opnd(eq, 3) < 300 * LOG(10) THEN
            rslt1 = rslt1a ^ opnd(eq, 3)
           ELSE
            rslt1 = 0: err1 = 1
           END IF
       END SELECT
       SELECT CASE op1
         CASE 1
           rslt2 = opnd(eq, 1) + rslt2a
         CASE 2
           rslt2 = opnd(eq, 1) - rslt2a
         CASE 3
           rslt2 = opnd(eq, 1) * rslt2a
         CASE 4
           rslt2 = opnd(eq, 1) / rslt2a
         CASE 5
           IF LOG(opnd(eq, 1)) * rslt2a < 300 * LOG(10) THEN
            rslt2 = opnd(eq, 1) ^ rslt2a
           ELSE
            rslt2 = 1: err2 = 1
           END IF
       END SELECT

       IF err1 = 0 THEN
         PRINT #2, rslt1; TAB(30);
         PRINT #2, USING "## "; eq;
         PRINT #2, USING " # ## ! ## ! ##"; 1; opnd(eq, 1); MID$(op$, op1); opnd(eq, 2); MID$(op$, op2); opnd(eq, 3)
       END IF
       IF err2 = 0 THEN
         PRINT #2, rslt2; TAB(30);
         PRINT #2, USING "## "; eq;
         PRINT #2, USING " # ## ! ## ! ##"; 2; opnd(eq, 1); MID$(op$, op1); opnd(eq, 2); MID$(op$, op2); opnd(eq, 3)
       END IF

     NEXT
   END IF
  NEXT op1

  flag = 0
  IF opnd(eq, 1) < opnd(eq, 2) THEN
   IF opnd(eq, 2) < opnd(eq, 3) THEN
    SWAP opnd(eq, 2), opnd(eq, 3)
   ELSE
    IF opnd(eq, 3) < opnd(eq, 1) THEN
     h = opnd(eq, 1)
     opnd(eq, 1) = opnd(eq, 2)
     opnd(eq, 2) = opnd(eq, 3)
     opnd(eq, 3) = h
    ELSE
     h = opnd(eq, 3)
     opnd(eq, 3) = opnd(eq, 2)
     opnd(eq, 2) = opnd(eq, 1)
     opnd(eq, 1) = h
    END IF
   END IF
  ELSE
   IF opnd(eq, 2) < opnd(eq, 3) THEN
    SWAP opnd(eq, 2), opnd(eq, 3)
   ELSE
    SWAP opnd(eq, 1), opnd(eq, 3): flag = 1
   END IF
  END IF
  PRINT opnd(eq, 1), opnd(eq, 2), opnd(eq, 3)
 LOOP UNTIL flag

NEXT eq


  Posted by Charlie on 2004-01-22 11:21:33
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 (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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