Minimizing total number of comparisons on a set of numbers

40 Views Asked by At

Suppose $S=\{a_1,a_2,\dots,a_{50}\}$ is a set of distinct integers that $1\le a_i\le200$ $(\forall i$ $1\le i\le 50)$

Let $D\subset S^3$ be the subset that doesn't contain any repetitive element in 3-tuples. There is a function $F:D\to\{0,1\}$ that each time we call $F(x,y,z)$ it returns $1$ iff $x+y\gt z$ and o.w it returns $0$.

(We don't know the values for $a_i$s, they're just labels. So we can't sort them for instance)

What is the minimum number of times of calling $F$ so we can be sure either $F$ is a constant function equaling $1$ or there's an input for which $F$ gives us $0$?

1

There are 1 best solutions below

5
On BEST ANSWER

In the worst case it takes $3\binom{50}{3}$ invocations. This worst case is when the sum of the two smallest elements equals the largest element. Then there is only one invocation that fails, and the ones that succeed don't give you any information to help you find it.