CSE301 · Homework 2 · Problem 3 · Algorithm 3
n toads, strictly more than n/2 of them trustworthy.
The expert checks one toad in Θ(1) time.
t = the number of trustworthy toads (t > n/2), and p = t/n is their share. Gold line: in a random order the average stays under the bound 1/p = n/t asks; in the worst order (every tricky toad first) every run needs n − t + 1 asks.
Space play / pause · Enter one run · A keep playing · Q +100 runs · R reset · F full screen · the sliders change the number of toads and tricky toads