Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.

M3
Lv 7
M3 fragte in Science & MathematicsMathematics · vor 9 Jahren

Weighing on my mind puzzle?

There are 5 coins, each with a slightly different weight (differences unknown).

You have a 2 pan balance scale, and no weights (ie you can only compare weights).

In just 7 weighings, arrange the coins in order of weight.

2 Antworten

Relevanz
  • vor 9 Jahren
    Beste Antwort

    The 5 coins might be in any one of 120 different orders.

    7 uses of the scale = 7 bits = enough to distinguish 128 different cases.

    In Volume 3 of Knuth, "Sorting and Searching", he describes a process

    first discovered by H. B. Demuth (Stanford PhD Thesis, 1956).

    He starts by saying,

    "Can five elements be sorted using only seven comparisons?

    The answer is yes, but it is not especially easy to find."

    (And don't forget, this is Knuth speaking, so "not especially easy" means "very difficult".)

    It works as follows:

    1) Compare two coins, call the lighter one A, the heavier one B.

    2) Compare two others, call those two C and D (in order).

    3) Then compare B vs D.

    Suppose D is heavier.

    Then you have A < B < D and C < D.

    4) and 5)

    Next by comparing the last coin to B and then either A or D

    depending on how it compared to B, we know the ordering

    of those 4.

    Which is one of these:

    c1) E A B D

    c2) A E B D

    c3) A B E D

    c4) A B D E

    5 comparisons used.

    Now it's known already that C < D,

    so it takes just two more to determine where C goes.

    c1) E A B D ... C v A and C v E or B

    c2) A E B D ... C v E and C v A or B

    c3) A B E D ... C v B and C v A or E

    c4) A B D E ... C v B and C v A

    Quelle(n): http://citeseerx.ist.psu.edu/viewdoc/download?doi=... gave me the reference to Knuth
  • KevinM
    Lv 7
    vor 9 Jahren

    First of all, this could easily be done in (5C2) = 10 weighings - weigh each coin against each other coin. So we need to get rid of 3 weighings. That doesn't seem too hard.

    1) First, weigh coins 1-3 against each other and put them in order.

    2) Next, weigh coins 4-5 against each other. That's 4 weighings so far.

    3) Next, weigh coin 4 against 2.

    a) If 4 weighs more than 2, then weigh 4v3 and 5v3, and you're done.

    b) If 4 weighs less than 2, weigh 5v2. If it weighs less, then... not quite.... thinking

Haben Sie noch Fragen? Jetzt beantworten lassen.