I. LOGIC
1. Two bears, one is black, one is white.
A. What is probability both are female?
B. One of the bears is female. What is probability the other
is female?
C. The bear on the left is female. What is probability the
other is
female?
Please express as a decimal, (i.e.
0.35)
ANSWER1A:
ANSWER1B:
ANSWER1C:
2. Three pancaces are in a hat. One is gold on both sides, one is
brown on
both sides,
and one is gold/brown. You pull one out, it is brown on
one side. What
is the
probability the other side is brown?
ANSWER2:
3. A hat has a coin, either black or white. A white coin is then
dropped
into the hat.
A coin is then pulled out of the hat. It is white.
What is the
probability the other
is white?
ANSWER3:
4. Given a circle. Find the probability that a chord chosen at random be
longer
than the side of an inscribed equilateral triangle.
ANSWER4:
5. Suppose you're on a game show, and you're given the choice of three
doors.
Behind one door is a car, behind the others, goats. You pick
a door, say
number 1, and the host, who knows what's behind the doors,
opens another
door, say number 3, which has a goat. He says to you,
"Do you want to
pick
door number 2?" Is it to your advantage to switch your
choice of doors
(y/n) ?
ANSWER5:
6. A town has two hospitals, one big and one small. Every day the
big
hospital delivers 1000 babies and the small hospital
delivers 100 babies. There's a 50/50 chance of male or
female on each
birth. Which hospital has a better chance of
having the same number of boys as girls (b)ig/(s)mall ?
ANSWER6:
7. You are in a game of Russian roulette, but this time the gun (a 6
shooter revolver) has three bullets in a row in
three of the chambers. The barrel is spun only once.
Each player then
points the gun at his (her) head and pulls
the trigger. If he (she) is still alive, the gun is
passed to the other
player who
then points it at his (her) own head and pulls the
trigger. The game
stops when one player dies.
Now to the point: would you rather be first or second
to shoot (1/2) ?
ANSWER7:
8. You come to a fork in a road. A person stands on each half.
One
always lies, one always tells the truth. With
just one question
find out where to go.
ANSWER8:
9. A stock price, let us call it X, follows a random walk.
Your assistant
came up with
the following strategy, which he claims will make
$1,000,000. Assume
zero transaction costs.
Let P be current stock price
Every day at 10:00, place the following limit orders:
If we have no position in X, Buy
10000 shares for P-$1.00
If we have a position in X, Sell
10000 shares for P+$1.00
At the end of each day, unifilled orders are cancelled.
Will this strategy make money?
ANSWER9A:
Why or why not?
ANSWER9B:
II. PROGRAMMING - USE PSEUDOCODE
1.
Input: arrays diff[1..n], value[1..n]
Write a program that sorts value by key in diff array (1) , then prints out
the results
in square boxes, 5 items per box ,
with data printed next to each
box like this:
**********
* 1.002 *
* 1.003 * AVG = 1.005
* 1.005 * MED = 1.005
* 1.008 *
* 1.009 *
**********
**********
* 1.012 *
* 1.013 * AVG = 1.015
* 1.015 * MED = 1.015
* 1.018 * STD = 0.011
* 1.019 *
**********
etc.
(1) Before sort diff [ 3 2 1 ] value [ 3 9 5]
After
sort diff [ 1 2 3 ] value [ 5 9 3 ] : order is
determined by the diff array
2. Write a program to simulate Logic Problem #2
1000 times, then print
the probability.
3. What does the following program output?
int rr(int x) {
int q;
static int zz;
static int zzz;
zzz++;
printf("%6d \n",zzz);
if (x<10) {
zz++;
if (zz<2) q=x/2; else q=x/3;
if (zz>1) q+=zz;
}
else {
q=rr(x-1)+rr(x/2);
}
return(q);
}
int main( int argc, char**argv) {
printf ("%d\n",rr(15));
printf ("%d\n",rr(15));
printf ("%d\n",rr(15));
}