Corps des ingénieurs RNistes est une organisation Socio-professionnelle parallèle du parti RNI – Parti RNI, Parti Politique Marocain

]]>/*count the numbers of ones */

int i=0,count=0;

while(i!=31){

if(num&(1<<i)){

count++;

}

if(!(count%2 == 0)){

printf("Pow of 2");

}

else {

printf("Nah not power of 2");

}

}

/*not optimized but easy to understand*/

]]>int i =0,count=0;

while(i!=31){

if(num&(1<<i){

count ++;

}

i++;

}

return count;

}

Label your 12 balls with the letters “THE KP FORMULA”

Weigh:

TAKE against FOUR

Weigh:

PARK against THEM

Weigh:

HALF against MORE

Tabulate your results, and you will find that for any set of three results, there is only one ball which can be the fake (and whether it is heavier or lighter) which will give you the observed results.

We have three weighings, each of which can give 3 possible results: Right pan goes down, Left pan goes down:, Pans balance.

This gives us 3*3*3 possibilities (27 results)

We only need to identify 24 possibilities, (one of 12 balls is lighter/heavier than the others). ]]>

because you’ve got hi quality content. If you want to know how to make extra $$$, search for:

Boorfe’s tips best adsense alternative ]]>

(Of course, the game theory of this situation might get complicated on the last day, since the work is complete and the employer no longer has incentive to pay, and if both employer and worker are rational then the worker should refuse to work on the last day, and by backwards induction the worker should refuse to work on the first day so no work gets done and no payment is given.)

]]>