Find two numbers based on their sum/difference

Logic Level 3

Two logicians must find two distinct integers A A and B B such that they are both between 2 and 100 inclusive, and A A divides B B . The first logician knows the sum A + B A + B and the second logician knows the difference B A B-A .

Then the following discussion takes place:

Logician 1: I don't know them.
Logician 2: I already knew that.

Logician 1: I already know that you are supposed to know that.
Logician 2: I think that... I know... that you were about to say that!

Logician 1: I still can't figure out what the two numbers are.
Logician 2: Oops! My bad... my previous conclusion was unwarranted. I didn't know that yet!

What are the two numbers?

Enter your answer as a decimal number A . B A.B .
( ( For example, if A = 23 A=23 and B = 92 B=92 , write 23.92. ) 23.92.)


Note: In this problem, the participants are not in a contest on who finds numbers first. If one of them has sufficient information to determine the numbers, he may keep this quiet. Therefore nothing may be inferred from silence. The only information to be used are the explicit declarations in the dialogue.


The answer is 33.66.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Arjen Vreugdenhil
Dec 19, 2016

For each pair ( A , B ) (A,B) the sum-difference pair ( S , D ) (S,D) is unique, and we can easily recover the values ( A , B ) = ( 1 2 ( S + D ) , 1 2 ( S D ) (A,B) = (\tfrac12(S+D),\tfrac12(S-D) . Therefore my analysis is based purely on the sums and differences.

In the table below, I plotted the sums (Logician 1) vertically, and the differences (Logician 2) horizontally. The crosses mark the 283 possible ( S , D ) (S,D) pairs.

Each of the statements gives more information, thereby ruling out certain values for sum or difference. I did this ruling out by coloring columns and rows in the table.

Red : sums with only one cross. These sums are ruled out by statement 1.

Orange : differences with some crosses in red. These differences are ruled out by statement 2.

Yellow : sums with some crosses in orange. These sums are ruled out by statement 3.

Green : differences with no crosses in yellow. These differences satisfy (erroneous) statement 4.

Purple : sums with no crosses in green. In these situations, Logician 1 should now have realized that there are no solutions left, and he would have complained.

Blue : sums with one cross in green. In this situation, Logician 1 would have thought (incorrectly) that he knew the numbers; therefore, ruled out by statement 5.

White : Now that Logician 2 has replaced statement 4 by its opposite, all green columns are ruled out.

Only one cross in white remains , namely at S = 99 S = 99 and D = 33 D = 33 . Therefore the solution is A = 33 A = 33 and B = 66 B = 66 .


Here is computer code that generates the solution automatically:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
final int maxN = 500, nS = 150, nD = 98;

int A[] = new int[maxN];
int B[] = new int[maxN];
int S[] = new int[maxN];
int D[] = new int[maxN];
int x[] = new int[maxN];
int y[] = new int[maxN];

// generate possible pairs

int N = 0;
for (int a = 2; a <= 50; a++) 
    for (int b = 2*a; b <= 100; b += a, N++) {
        A[N] = a; B[N] = b; S[N] = a+b; D[N] = b-a; x[N] = 0; y[N] = 0; 
}

// Logician 1: "I don't know them."
// If a sum occurs more than once, promote x from 0 to 1.

for (int s = 1; s <= nS; s++) {
    int ct = 0;
    for (int i = 0; i < N; i++) if (S[i] == s) ct++;
    if (ct > 1)
        for (int i = 0; i < N; i++) if (S[i] == s) x[i] = 1;
}

// Logician 2: "I already knew that."
// If a difference is entirely marked x = 1, promote y from 0 to 2.

for (int d = 1; d <= nD; d++) {
    boolean pass = true;
    for (int i = 0; i < N; i++) if (D[i] == d)
        if (x[i] < 1) pass = false;
    if (pass)
        for (int i = 0; i < N; i++) if (D[i] == d) y[i] = 2;
}

// Logician 1: "I already know that you are supposed to know that."
// If a sum is entirely marked y = 2, promote x from 1 to 3.

for (int s = 1; s <= nS; s++) {
    boolean pass = true;
    for (int i = 0; i < N; i++) if (S[i] == s)
        if (y[i] < 2) pass = false;
    if (pass)
        for (int i = 0; i < N; i++) if (S[i] == s) x[i] = 3;
}

// Logician 2: "I think that you were about to say that!"
// If a difference is entirely marked x = 3, promote y from 2 to 4.

for (int d = 1; d <= nD; d++) {
    boolean pass = true;
    for (int i = 0; i < N; i++) if (D[i] == d)
        if (x[i] < 3) pass = false;
    if (pass)
        for (int i = 0; i < N; i++) if (D[i] == d) y[i] = 4;
}


// Logician 1: "I still can't find out what the numbers are."
// If a sum has no y = 4, set x = 5. This means no possible solutions.
// If a sum has more than one y = 4, set x = 6.

for (int s = 1; s <= nS; s++) {
    int ct = 0;
    for (int i = 0; i < N; i++) if (S[i] == s)
        if (y[i] == 4) ct++;
    if (ct < 1)
    { for (int i = 0; i < N; i++) if (S[i] == s) x[i] = 5; }
    if (ct > 1)
    { for (int i = 0; i < N; i++) if (S[i] == s) x[i] = 6; }
}

// Logician 2: "Oops, my last statement was wrong."
// Thus we must find an item with x = 6 and y = 2.

for (int i = 0; i < N; i++) if (x[i] == 6 && y[i] == 2) {
    System.out.println(""+A[i]+"."+B[i]);
}

Output: 33.66

By the way, @Abdou Abdou , I edited your problem slightly in an attempt to make it clearer / easier to understand. Hope you don't mind... I enjoyed this problem and would like to see others give it a try as well!

Arjen Vreugdenhil - 4 years, 5 months ago

@Arjen Vreugdenhil I've converted your comment in the reports section into this solution. Can you fill in the details? Thanks!

Calvin Lin Staff - 4 years, 5 months ago

you didnt reply to me about my proposition to put this conversation as a contest, have u already found any flaw ? or does the one you suggested as flaw count as a serious one ?

Abdou Abdou - 4 years, 5 months ago

Log in to reply

(Assuming this is addressed at me) I was following the conversation in reports, and I see that the problem was incorrect.

I would love a note/contest about solving these type of problems. There are a lot of interesting scenarios that could arise, base on the different types of information that is given.

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

yes, the first 4 steps can be more than enough to cherrypick a selection of narrow range of lines, that is open to more than one way to a a different unique solution, btw it snt incorrect, but rather can be accidentally misunderstood. or mistaken for the classic addition/multiplication puzzle.

Abdou Abdou - 4 years, 5 months ago

Log in to reply

@Abdou Abdou Sounds good. Give it a try!

Calvin Lin Staff - 4 years, 5 months ago

This was awesome! Yeah, I also used code to figure this out. Computers truly are, as Steve Jobs said, "bicycles for our brains" :D

Fabricio Kolberg - 3 years, 6 months ago

This is great but the statements were so confusing. I am looking for an explanation if them and what this means

Zoe Codrington - 2 years, 8 months ago
Abdou Abdou
Dec 17, 2016

In the following numbers are represented ike a-b/a since a divides b, exemple: 33-2 represents 33.66

From the conversation that shows, we could extract two lists containing all combinations that had summer and subtractor in mind, demonstrating what is discarded from all available sums in which stage for which reason... The bounded sum/difference by two brackets ex:[number] are discarded ones, the reason follows in same line.

Sums

Differences

from both lists we could extract such a selection:

valid sums: - after third declaration


16 \ \ 2-7 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4-3 \ \ \ \ \ \ \ \ \ \ \ \

28 \ \ 2-13 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4-6 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 7-3 \ \ \ \ \ \ \ \ \ \ \ \ \ \

32 \ \ 2-15 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4-7 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 8-3 \ \ \ \ \ \ \ \ \ \ \ \ \ \

76 \ \ 2-37 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4-18 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 19-3 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

78 \ \ 2-38 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3-25 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 6-12 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 13-5 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 26-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

88 \ \ 2-43 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4-21 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 8-10 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 11-7 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 22-3 \ \ \ \ \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 \ \ \ \ \ \ \ \ \ \ .

77 \ \ \ \ 7-12 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 11-8 \ \ \ .

11 \ \ \ \ 11-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .

13 \ \ \ \ 13-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .

19 \ \ \ \ 19-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .

23 \ \ \ \ 23-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .

29 \ \ \ \ 29-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .

31 \ \ \ \ 31-2

Now from both lists this is the figuration of patterns in summer's head, where each sum contains atleast one couple concerned from 4th declaration, that is hence tagged by a star. The starred sums are all where summer still doesnt know .

78 \ \ \ 2-38* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3-25 \ \ \ \ \ \ \ \ \ \ \ \ \ \ 6-12 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 13-5 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 26-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

15* \ \ 3-4* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

27 \ \ \ 3-8 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 9-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \

33 \ \ \ 3-10 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 11-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

39 \ \ \ 3-12 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 13-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

57 \ \ \ 3-18 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 19-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

69 \ \ \ 3-22 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 23-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

87* \ \ 3-28* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 29-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

93* \ \ 3-30* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 31-2* \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

99* \ \ 3-32* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 9-10* \ \ \ \ \ \ \ \ \ \ \ \ \ 11-8* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 33-2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

95 \ \ \ 5-18* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 19-4 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

91 \ \ \ 7-12* \ \ \ \ \ \ \ \ \ \ \ \ \ \ 13-6

Now, since subtractor has made a slip of his tongue, no one from the starred lines contains more than one starred couple, and atleast one couple not signified, except the sum=99 where the last disclaimer declared by subtractor is enough (but not easy) for any arbitrary witness from the audience to precise the numbers, those are 33-2 (twisted format of 33.66)

Thank you for your attention.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...