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

 Rectangular Logic (Posted on 2005-01-28)
Promising them an increase in their allowance if they get the answer, I offer my two sons, Peter and Paul, the following puzzler:

"I am thinking of a rectangle with integer sides, each of which are greater than one inch. The total perimeter of the rectangle is no greater than eighty inches."

I then whisper the total area to Peter and the total perimeter to Paul. Neither of them are allowed to tell the other what they heard: their job is to work out the rectangle's dimensions.

Their subsequent conversation goes like this:

Peter: Hmmm... I have no idea what the perimeter is.
Paul: I knew you were going to say that. However, I don't know what the area is.
Peter: Still no clue as to the perimeter...
Paul: But now I know what the area is!
Peter: And I know what the perimeter is!

What are the dimensions of the rectangle?

 No Solution Yet Submitted by Sam Rating: 3.7500 (12 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Did anyone have this solution yet? | Comment 10 of 44 |

I get the answer 2 x 3, by the following eliminations and finding:

Phase 1 Peter looks for unique areas.
elim  1 x  1;   1  4
elim  1 x  3;   3  8
elim  1 x  5;   5 12
elim  1 x  7;   7 16
elim  1 x 11;  11 24
elim  1 x 13;  13 28
elim  7 x  7;  49 28
elim  5 x 11;  55 32
elim  1 x 17;  17 36
elim  5 x 13;  65 36
elim  7 x 11;  77 36
elim  1 x 19;  19 40
elim  3 x 17;  51 40
elim  7 x 13;  91 40
elim  7 x 14;  98 42
elim  3 x 19;  57 44
elim  5 x 17;  85 44
elim  9 x 13; 117 44
elim 11 x 11; 121 44
elim  1 x 23;  23 48
elim  5 x 19;  95 48
elim  7 x 17; 119 48
elim 11 x 13; 143 48
elim  2 x 23;  46 50
elim  6 x 19; 114 50
elim  3 x 23;  69 52
elim  7 x 19; 133 52
elim  9 x 17; 153 52
elim 13 x 13; 169 52
elim  4 x 23;  92 54
elim  8 x 19; 152 54
elim  5 x 23; 115 56
elim  7 x 21; 147 56
elim  9 x 19; 171 56
elim 11 x 17; 187 56
elim 13 x 15; 195 56
elim  6 x 23; 138 58
elim 10 x 19; 190 58
elim  1 x 29;  29 60
elim  5 x 25; 125 60
elim  7 x 23; 161 60
elim 11 x 19; 209 60
elim 13 x 17; 221 60
elim  2 x 29;  58 62
elim  8 x 23; 184 62
elim 12 x 19; 228 62
elim 14 x 17; 238 62
elim  1 x 31;  31 64
elim  3 x 29;  87 64
elim  9 x 23; 207 64
elim 13 x 19; 247 64
elim 15 x 17; 255 64
elim  2 x 31;  62 66
elim  4 x 29; 116 66
elim 10 x 23; 230 66
elim 11 x 22; 242 66
elim 14 x 19; 266 66
elim 16 x 17; 272 66
elim  3 x 31;  93 68
elim  5 x 29; 145 68
elim 11 x 23; 253 68
elim 13 x 21; 273 68
elim 15 x 19; 285 68
elim 17 x 17; 289 68
elim  4 x 31; 124 70
elim  6 x 29; 174 70
elim 10 x 25; 250 70
elim 12 x 23; 276 70
elim 14 x 21; 294 70
elim 16 x 19; 304 70
elim  5 x 31; 155 72
elim  7 x 29; 203 72
elim  9 x 27; 243 72
elim 11 x 25; 275 72
elim 13 x 23; 299 72
elim 15 x 21; 315 72
elim 16 x 20; 320 72
elim 17 x 19; 323 72
elim  6 x 31; 186 74
elim  8 x 29; 232 74
elim 14 x 23; 322 74
elim 15 x 22; 330 74
elim 17 x 20; 340 74
elim 18 x 19; 342 74
elim  1 x 37;  37 76
elim  7 x 31; 217 76
elim  9 x 29; 261 76
elim 11 x 27; 297 76
elim 13 x 25; 325 76
elim 15 x 23; 345 76
elim 16 x 22; 352 76
elim 17 x 21; 357 76
elim 19 x 19; 361 76
elim  2 x 37;  74 78
elim  8 x 31; 248 78
elim 10 x 29; 290 78
elim 13 x 26; 338 78
elim 14 x 25; 350 78
elim 16 x 23; 368 78
elim 17 x 22; 374 78
elim 18 x 21; 378 78
elim  3 x 37; 111 80
elim  9 x 31; 279 80
elim 11 x 29; 319 80
elim 13 x 27; 351 80
elim 14 x 26; 364 80
elim 15 x 25; 375 80
elim 16 x 24; 384 80
elim 17 x 23; 391 80
elim 18 x 22; 396 80
elim 19 x 21; 399 80
elim 20 x 20; 400 80
phase 2 Paul looks for unique perims.
elim  2 x  2;   4  8
Phase 3 Peter looks for unique areas.
elim  1 x  4;   4 10
Phase 4 Paul looks for unique perims.
found  2 x  3;   6 10

Note phase 4 found only one unique answer, so we don't need to go to phase 5.  Also, Paul's remark that he knew that Peter would not be able to find it on the first round was also not necessary to take into consideration, but it is indeed true as, when Paul knew the perimeter was 10, he knew that the area had to be 4 or 6, each of which was non-unique:

2 x 2;   4  8
1 x 4;   4  10
2 x 3;   6 10
1 x 6;  6  14

Based on the following program, which uses a number in the marked array to signify at what stage the given dimensions were eliminated, so as to allow consideration of those dimensions if they are only to be eliminated in the current round:

DEFINT A-Z
n = 500
DIM side1(n), side2(n), area(n), perim(n), marked(n)
OPEN "rectlog1.txt" FOR OUTPUT AS #2
FOR sum = 2 TO 40
FOR s1 = 1 TO sum / 2
s2 = sum - s1
i = i + 1
side1(i) = s1: side2(i) = s2
perim(i) = 2 * (s1 + s2)
area(i) = s1 * s2
NEXT s1
NEXT sum

howMany = i: totSub = i
PRINT #2, "Phase 1 Peter looks for unique areas."
FOR i = 1 TO totSub
compare = area(i)
foundMatch = 0
FOR j = 1 TO totSub
IF i <> j THEN
IF area(j) = compare THEN foundMatch = j: EXIT FOR
END IF
NEXT j
IF foundMatch = 0 THEN
PRINT #2, USING "elim ## x ##; ### ## "; side1(i); side2(i); area(i); perim(i)
marked(i) = 1
howMany = howMany - 1
END IF
NEXT i

PRINT #2, "phase 2 Paul looks for unique perims."

FOR i = 1 TO totSub
compare = perim(i)
foundMatch = 0
FOR j = 1 TO totSub
IF i <> j AND marked(j) = 0 OR marked(j) = 2 THEN
IF perim(j) = compare THEN foundMatch = j: EXIT FOR
END IF
NEXT j
IF foundMatch = 0 THEN
IF marked(i) = 0 THEN
PRINT #2, USING "elim ## x ##; ### ## "; side1(i); side2(i); area(i); perim(i)
howMany = howMany - 1
marked(i) = 2
END IF
END IF
NEXT i

PRINT #2, "Phase 3 Peter looks for unique areas."
FOR i = 1 TO totSub
IF marked(i) = 0 THEN
compare = area(i)
foundMatch = 0
FOR j = 1 TO totSub
IF i <> j AND marked(j) = 0 OR marked(j) = 3 THEN
IF area(j) = compare THEN foundMatch = j: EXIT FOR
END IF
NEXT j
IF foundMatch = 0 THEN
PRINT #2, USING "elim ## x ##; ### ## "; side1(i); side2(i); area(i); perim(i)
marked(i) = 3
howMany = howMany - 1
END IF
END IF
NEXT i

PRINT #2, "Phase 4 Paul looks for unique perims."

FOR i = 1 TO totSub
IF marked(i) = 0 THEN
compare = perim(i)
foundMatch = 0
FOR j = 1 TO totSub
IF i <> j AND marked(j) = 0 OR marked(j) = 4 THEN
IF perim(j) = compare THEN foundMatch = j: EXIT FOR
END IF
NEXT j
IF foundMatch = 0 THEN
PRINT #2, USING "found ## x ##; ### ## "; side1(i); side2(i); area(i); perim(i)
marked(i) = 4
howMany = howMany - 1
END IF
END IF
NEXT i

 Posted by Charlie on 2005-02-01 03:04:32

 Search: Search body:
Forums (0)