we have to run a song on a Walkman,for that we need 2 full batteries.Let s say we have a mixed set of 30 batteries (15 are emtpy and and 15 are full) and then only way to test if the battery full or empty is to put them in the Walkman and try it out.we can not tell which one is empty or full (one we put inside one full and one empty).
The question is to find the maxmium needed step to run the walkman (to find 2 full batteries)
I modelled the problem like that : let s that the Walkman is a function f which take two argumments and it return 1 it the walkman works ,and 0 otherwise. $$ f: \{b_1,b_2 \dots b_{30}\} \times \{b_1,b_2 \dots b_{30}\} \rightarrow\{0,1\}$$
The answer for the question was at most 18 steps , but somehow i could not figure it out. Any good suggestion how to proceed ?