Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Don't read this (unless you are a masochist)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thorsten Seelend  
View profile  
 More options Nov 17 1998, 3:00 am
Newsgroups: de.comp.lang.java, comp.lang.java.help, comp.lang.java.programmer, comp.lang.prolog, comp.lang.c++
From: Thorsten Seelend <thors...@pixel.de>
Date: 1998/11/17
Subject: Re: Don't read this (unless you are a masochist)

Thorsten Seelend wrote:

> I'd like to  get advices how to  solve a specific  programming task in
> procedural languages like Java, Pascal/Modula and C/C++.
> ...
>     Mister X thinks about two integers between 1 and 100 excluding. He
>     tells Susan the SUM of them and Peter their  PRODUCT. The task for
>     both is to get the two  original values without telling each other
>     the numbers, that Mister X told them.

>     After some  time Peter says:  "I can't  say definitively which are
>     the original  numbers."    (It  means  there   is more   than  one
>     solution.)  Then Susan  responds: "I  can't  neither.  But  I knew
>     that you couldn't  know it."  Peter:  "Really?  So now I  know the
>     original numbers". And finally Susan: "Now I know them too".

>     Question: What are the two numbers, Mister X thought of.
> ...

Here's an  attempt to explain why the  (one and only) solution (4, 13)
fullfills the given facts.

Susan knows 17 = 4 + 13
Peter knows 52 = 4 * 13

Peter(1) : "I don't know the numbers"
    From his view there are two possibilities:
    52 = 4*13  and
    52 = 2*26

Susan(1) : "I don't know either, but I knew that you couldn't know"
    First part:
        There are 7 possibilities to  get a sum  of 17, so Susan can't
        know.
    Second part:
        For all these  possibilities  Peter(1)  is true, i.e.    there
        exists no solution so  that Peter could exactly factorize  his
        product.

        x   y   product  possible factorizations
        ======================================================
        2   15  30       (2,15), (3,10), ...
        3   14  42       (2,21), (3,14), ...
        4   13  52       (2,26), (4,13), ...
        5   12  60       (2,30), (3,20), ...
        6   11  66       (2,33), (3,22), ...
        7   10  70       (2,35), (5,14), ...
        8    9  72       (2,36), (3,24), ...

Peter(2) : "So now I know the numbers"
    Checking  both  possibilities --   (4,13)   and (2,26) --  and  do
    thinking the way Susan did, he  realizes that only the pair (4,13)
    lets  Susan knew that he can't  know it.  Assuming the pair (2,26)
    and creating the according table like for (4,13) above, this table
    starts with

        x   y   product  possible factorizations
        ======================================================
        2  26    52       (2,26), (4,13), ...
        3  25    75       (3,25), (5,15), ...
        4  24    96       (2,48), (3,32), ...
        5  23   115       (5,23). !!!!!!!
        ...

    As you can see, if (2,26) would  have been the solution, then from
    the view of Susan there would have been  at least one way to split
    the sum 28 (=2+26, what Susan would have been told by Mister X) --
    the pair(5,23) -- for those product -- 115 -- there exist only one
    factorization (5 and 23 are prime). Hence Susan than couldn't have
    knew  that Peter   too couldn't  knew   the original   pair (a bit
    difficult  to write it down  in english). So therefore Peter "now"
    knows that (4,13) has to be the solution.

Susan(2) : "Now I know them too"
    I better don't try to explain this ;-)

The problem is that  neither  the sum   nor  the product are  told  to
us. So, really all given  facts are necessary (especially Susan(2)) to
compute the solution, i.e. find the one and only solution.

Thorsten Seelend


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.