This week's book giveaway is in the Java in General forum.We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!

Workout

Helen Thomas
Ranch Hand
Posts: 1759
1. If it were two hours later, it would be half as long until midnight as it would be if it were an hour later. What time is it now?

2. Each number shown below follows a certain rule. Figure out the rule and fill in the missing number.

January 20
April 10
May 5
November 15
July ?

3. Sally likes 225 but not 224; she likes 900 but not 800; she likes 144 but not 145. Which does she like: 1600 or 1700 ?

4. Which number comes next in this series of numbers?
2 3 5 7 11 13 ?

5. Which letter comes next in this series of letters?
B A C B D C E D F ?

6. Only one other word can be entirely made from INSATIABLE. What is it ?
[ January 30, 2005: Message edited by: Helen Thomas ]

Peter van de Riet
Ranch Hand
Posts: 112
These questions are not too difficult, only the 6th is for non-native english speaking people a little puzzle.

1. 9 PM
2. 10
3. 1600
4. 17
5. E
6. BANALITIES

Another question in return:

You have four snooker-balls, all looking equal. You know that at most one ball has a different weight, but you are not sure if there is such a ball, and you also don't know if the weigth is less or more, and you don't know which one it is.
You own a accurate digital balance which can be used to exactly measure the weigth of one or some of the balls.
You have to find out if one of the balls has a different weigth, if that is true, which ball it is and the exact weigth of each of the balls.
You may use the balance three times and all the balls have to stay in one piece....

Helen Thomas
Ranch Hand
Posts: 1759
I took those questions from the Mensa workout.

Answer 30 questions in half an hour.
I got 21 out of 30 and they said I "could" qualify for Mensa.
These posted here were some of the questions I couldn't fathom. Well done!

Helen Thomas
Ranch Hand
Posts: 1759
Originally posted by Peter van de Riet:

Another question in return:

You have four snooker-balls, all looking equal. You know that at most one ball has a different weight, but you are not sure if there is such a ball, and you also don't know if the weigth is less or more, and you don't know which one it is.
You own a accurate digital balance which can be used to exactly measure the weigth of one or some of the balls.
You have to find out if one of the balls has a different weigth, if that is true, which ball it is and the exact weigth of each of the balls.
You may use the balance three times and all the balls have to stay in one piece....

First weigh two balls

then the other two balls

If the weights are equal , then given only one ball could have a different weight, all balls weigh the same weight.

If not equal, add the two weighings.

Remove one ball's weight from the equation by weighing just one ball from the heavier side.(Third weighing)

Multiply that weight by 2. If it's equal to the weight of the other side
then the other ball is the odd ball, if it's not equal the removed ball is the odd ball.
[ January 31, 2005: Message edited by: Helen Thomas ]

Peter van de Riet
Ranch Hand
Posts: 112
Helen,
This works only if one of the balls is heavier, if one ball weights less then your solution won't work.

Helen Thomas
Ranch Hand
Posts: 1759
Oh well, kiss goodbye to Mensa

I think I know where it's wrong

"If it's equal to the weight of the other side
then the other ball is the odd ball, if it's not equal the removed ball is the odd ball."

Change that to
Remove one ball's weight from the equation by weighing just one ball from weighing 1 or weighing 2 picked randomly (Third weighing)

Multiply that weight by 2.
If the weight x 2 is equal to the weight of the other side or it's weight is half the weight of it's side ( calculated from weighing 1 and weighing 2) , you can determine which three balls have the same weight.

( That's removed the problem with too many if's)

Still NOT right!!

Weigh three balls. If they have the same weight ......
Monday morning
[ January 31, 2005: Message edited by: Helen Thomas ]

Peter van de Riet
Ranch Hand
Posts: 112
This solution still works only if one ball is heavier:

First example (one ball heavier)
A 36
B 30
C 30
D 30

weighing 1: A+B = 66
weighing 2: C+D = 60

weighing 1 more then weighing 2 ->

weighing 3: A = 36

C+D / 2 = 30

A > (C+D)/2

A: 36
B: 30
C: 30
D: 30

Right

Second example, one ball ligther:
A 30
B 30
C 30
D 24

weighing 1: A+B = 60
weighing 2: C+D = 54

weighing 1 more then weighing 2 ->

weighing 3: A = 30

C+D / 2 = 27

A > (C+D)/2

A: 30
B: 30
C or D: 30
the other D or C: 24

Helen Thomas
Ranch Hand
Posts: 1759
I think you missed this final submission

Weigh three balls. If they have the same weight ......
Monday morning

If they all have the same weight the fourth ball is the odd one out.
If two have the same weight the third has to be the odd ball.

That's assuming there IS one ball with a different weight.
[ January 31, 2005: Message edited by: Helen Thomas ]

Peter van de Riet
Ranch Hand
Posts: 112
In the original question:

and the exact weigth of each of the balls.

If they all have the same weight the fourth ball is the odd one out.

You still don't know the exact weigth of the fourth ball

Helen Thomas
Ranch Hand
Posts: 1759
Start again.

Split balls into two sets.

Weigh one ball from each set. That's two weighings

Then weigh the other two balls that haven't been weighed yet . That's the third and final weighing.

At least one of the weights of the singular balls has to be the most common weight,x.

Subtract x from the weight of the two balls. That should get you x again if all balls weigh the same or the weight of the odd ball,y.

ball 1 = 5
ball 2 = 6

ball 3 + ball 4 = 10 OR 12 which will indicate which is the most common weight

ball 1 = 5
ball 2 = 5

ball 3 + ball 4 = 11

11 - 5 = 6 , the weight of the oddball.
[ January 31, 2005: Message edited by: Helen Thomas ]

Peter van de Riet
Ranch Hand
Posts: 112

ball 3 + ball 4 = 11
11 - 5 = 6 , the weight of the oddball.

You still don't know which of the 2 is 5!!

Helen Thomas
Ranch Hand
Posts: 1759
ball 1 = 5
ball 2 = 6

ball 3 + ball 2 = 10 (weight of ball 3 = 5 and ball 4 = 5)

OR 12 (weight of ball 3 = 6 and ball 4 = 6)

IF :

ball 1 = 5
ball 2 = 5

ball 3 + ball 2 = 11 (weight of ball 3 = 6 and ball 4 = 5)

Peter van de Riet
Ranch Hand
Posts: 112
ball 3 + ball 2 = 11 (weight of ball 3 = 6 and ball 4 = 5)

or weight of ball 3 = 5 and ball 4 = 6
and you still don't know

Helen Thomas
Ranch Hand
Posts: 1759
Originally posted by Peter van de Riet:

or weight of ball 3 = 5 and ball 4 = 6
and you still don't know

I do so know because ball 3 and ball 2 were weighed together.

ball 2 + ball 3 = 11 ; ball 2 = 5

so ball 3 must be 6 and by default ball 4 is 5 as at most one ball is different.

But I do accept if the first three balls have the same weight you aren't sure what's the weight of the fourth ball.

You cannot believe how many tasks I've done in between . Drove 20 miles too.
This is my final answer. Someone else have a go.
[ February 01, 2005: Message edited by: Helen Thomas ]

Peter van de Riet
Ranch Hand
Posts: 112
ball 1 = 5
ball 2 = 6

ball 3 + ball 2 = 10 (weight of ball 3 = 5 and ball 4 = 5)

OR 12 (weight of ball 3 = 6 and ball 4 = 6)

IF :

ball 1 = 5
ball 2 = 5

ball 3 + ball 2 = 11 (weight of ball 3 = 6 and ball 4 = 5)

OR
ball 1 = 5
ball 2 = 5

ball 3 + ball 2 = 10 (weight of ball 3 = 5 and ball 4 = UNKNOWN)

[ February 01, 2005: Message edited by: Peter van de Riet ]

Helen Thomas
Ranch Hand
Posts: 1759
This has something to do with snooker, right.

If all the balls are the same colour they weigh the same.
The one with a different colour weighs different.

Peter van de Riet
Ranch Hand
Posts: 112
I guess you give up?
Here is my solution:

weighing 1 : ball a
weighing 2 : ball a + ball b + ball c

situation 1: (weighing 1) equals (weighing 2 divided by 3)
situation 2: (weighing 1) not equals (weighing 2 divided by 3)

weighing 3: situation 1 -> ball d
situation 2 -> ball b

Results:
ball a: result of weighing 1
ball b: situation 1 -> result of weighing 1
situation 2 -> result of weighing 3
ball c: weighing 2 minus (ball a) minus (ball b)
ball d: situation 1 -> weighing 3
situation 2 -> if (ball a) equals (ball b or ball c) -> (ball a)
else (ball b)

Helen Thomas
Ranch Hand
Posts: 1759

That looks correct. That was a good problem. Thanks for posting it Peter.