We have a scale and 7 balls. 1 ball is heavier than all the
rest. How to determine the heaviest ball with only 3
possible weighing attempts?
Answer Posted / adub
12 vs 34
12 vs 56
1 vs 5
1) Establish a control group by weighing 12 vs 34. If they
are equal then 1234 are all control. If they are not equal
than 567 are all control.
2) Weigh two of the non-control group against two of the
control group. If they are equal than the other non-control
balls contain the outlier. If they are not equal than you
have determined heavier/lighter and narrowed it down to 2 balls.
3) Weight one of two balls against the control to find
which one is the outlier. example 1 vs 5. If equal then
you know it's the other ball.
note: There is one case where you would have to check
results from the first weighing to find out heavier/lighter.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
write a program to find 2 power of a 5digit number with out using big int and exponent ?
Why do we use oop?
What are constructors in oop?
What is solid in oops?
what type of questions
Why do we use polymorphism in oops?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
How to hide the base class functionality in Inheritance?
Why is there no multiple inheritance?
Why do we use polymorphism?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is difference between multiple inheritance and multilevel inheritance?
what is difference between class template and template class?
What is basic concept of oop?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.