Re: On the complexity of determining whether n numbers are distinct



eKo1 wrote:
eKo1 wrote:
eKo1 wrote:
Suppose you have n coins, all of which look exactly the same. You are
given a balance scale and are asked to determine if the coins are all
distinct, i.e. they all weigh differently. What is the minimum amount
of times the balance will be used to solve the problem?

If I weigh two coins at a time, the decision tree for this problem will
have a height h = C(n, 2) so in the worse case, the balance would be
used C(n, 2) times which is proportional to n^2. This is certainly not
n lg n. Hmm....

Nevermind. Every time I weigh two coins, say a and b, either a > b, a <
b or a = b. That means each internal node in the decision tree has 3
children.

I drew a decision tree for n = 3 for this problem and a decision tree
for sorting n = 3 numbers and they look exactly the same except that
the internal nodes on the sorting decision tree only have two children
as opposed to three. I must figure out a way to show that both trees
have the same height. Perhaps a proof by induction is in order. I'll
think about this a bit and post some results tomorrow.

Let T be the decision tree used to solve the sorting problem. Form T'
from T by doing the following: for each internal vertex, add an extra
child in the middle that represents a weighing were the two coins
weighed the same. T' is the decision tree for the distinct-coin problem
where the terminal vertices that are left or right children represent
that the coins are distinct and the terminal vertices that are middle
children represent that the coins are not distinct. Hence, sorting and
element-distinctness have the same lower-bound time complexity.

Is this a valid argument?

.



Relevant Pages

  • Re: On the complexity of determining whether n numbers are distinct
    ... given a balance scale and are asked to determine if the coins are all ... If I weigh two coins at a time, the decision tree for this problem will ...
    (comp.theory)
  • Re: 10 coin puzzle
    ... Given a pan balance and three ... weighings, determine whether or not they all weigh the same. ... First, note that if we are weighing two equal amounts of coins, and the ... Either they all have the same weight, ...
    (rec.puzzles)
  • Re: 10 coin puzzle
    ... Given a pan balance and three ... weighings, determine whether or not they all weigh the same. ... First, note that if we are weighing two equal amounts of coins, and the ... Either they all have the same weight, ...
    (rec.puzzles)
  • Re: Believe it or not...
    ... daughter, last year, learned about half dollars and dollar coins in her ... They were amazed (these are high school ... I was taught how to balance books ... going up a few cents and down a few ...
    (rec.collecting.coins)
  • Re: For Sale- 40 Pounds of US/Philippine Coins
    ... are one of those little nit pickers that fit that bill. ... Weigh the coins.... ... The "weigh the coins" admonition is rather odd. ... Get Credit Where Credit Is Due ...
    (rec.collecting.coins)