Friday, April 29, 2011

How To Prove It - Chapter 1 - 1.2

1.2 Sentential Logic

1.
(a)
P Q -P Q
T T F F F
T F F T T
F T T T F
F F T T T


(b)
S G (S G) (-S -G)
T T T T T T F F F
T F T T F T F T T
F T F T T T T T F
F F F F F T T T T


2.
(a)
P Q -[ P (Q -P)]
T T F T T T T F
T F T T F F F F
F T T F F T T T
F F T F F F T T


3.
(a)
P Q P+Q
T T F
T F T
F T T
F F F


(b)
P + Q = (P
¬Q) (¬P Q)
Truth table -
P Q P+Q (P ¬Q) (¬P Q)
T T F T F F F F F T
T F T T T T T F F F
F T T F F F T T T T
F F F F F T F T F F


4.
P ∨ Q
=
¬¬P ¬¬Q
=
¬ (¬ P ∧ ¬ Q) (De Morgan's Law)
Truth table -

P Q P Q ¬ ( ¬ P ¬ Q)
T T T T T T F T F F T
T F T T F T F T F T F
F T F T T T T F F F T
F F F F F F T F T T F


5.
(a)
P Q P ↓ Q
T T F
T F F
F T F
F F T

(b)
P ↓ Q = ¬ P ∧¬ Q
=
¬ (P ∨ Q)

Truth table verification -

P Q P ↓ Q ¬ (P Q)
T T F F T T T
T F F F T T F
F T F F F T T
F F T T F F F

(c)
(i) ¬P = ¬P ∧ ¬P
= P ↓ P

(ii)
P ↓ Q
= (from the previous ones)
¬ (P ∨ Q)

So, (P ∨ Q) = ¬ (P ↓ Q)
=
(P ↓ Q) (P ↓ Q) (from c(i))

(iii)
¬ (P ∧ Q)
= ¬ P ¬ Q

Hence,
(P ∧ Q) = ¬(¬ P ¬ Q)
= ¬ ((¬P ↓ ¬Q) P ↓ ¬Q)) (from the previous one)
= ¬ (¬ (¬P ↓ ¬Q)) (from c(i))
= ¬P ↓ ¬Q
= (P ↓ P) ↓ (Q ↓ Q)

6.
(a)
P Q P | Q
T T F
T F T
F T T
F F T

(b)
P | Q =
¬ P ¬ Q
Truth table -
P Q P | Q ¬ P ¬ Q
T T F F T F F T
T F T F T T T F
F T T T F T F T
F F T T F T T F

(c)
(i)
¬P = ¬ (P ∧ P)
= ¬ P ¬P
= P | P

(ii)
P ∨ Q
= ¬P | ¬ Q (from (b))
= (P | P) | (Q | Q) (from c(i)

(iii)
P ∧ Q
= ¬ (¬P ∨ ¬Q)
= ¬ ((P|P) ∨ (Q|Q))
= ¬ (((P|P) | (P|P)) | ((Q|Q) | (Q|Q)) ) (from ii)
= (((P|P) | (P|P)) | ((Q|Q) | (Q|Q)) ) | (((P|P) | (P|P)) | ((Q|Q) | (Q|Q)) ) (from i)

7. Boring stuff. Skipping.
8. Ditto!

9.
(a)
(P Q) P ¬ Q)
T T T F F T F F T
T T F T F T T T F
F T T T T F T F T
F F F F T F T T F

Neither.
(b)
(P Q) P ¬ Q)
T T T F F T F F T
T T F F F T F T F
F T T F T F F F T
F F F F T F T T F

A contradiction.

(c)
(P Q) P ¬ Q)
T T T T F T F F T
T T F T F T T T F
F T T T T F T F T
F F F T T F T T F

A tautology.

12.
(a) ¬(¬P ∨ Q) ∨ (P ∧ ¬R)
= (¬¬P ∧ ¬Q) ∨ (P ∧ ¬R)
= (P ∧ ¬Q) ∨ (P ∧ ¬R)
= P ∧ (¬Q ∨ ¬R)

(b) ¬(¬P ∧ Q) ∨ (P ∧ ¬R)
= ( ¬¬P ∨ ¬Q)) ∨ (P ∧ ¬R)
= (P ∨ ¬Q) ∨ (P ∧ ¬R)

(c) (P ∧ R) ∨ [¬R ∧ (P ∨ Q)]
= (P ∧ R) ∨ [(¬R ∧ P) ∨ (¬R ∧ Q)]
= (P ∧ R) ∨ (¬R ∧ P) ∨ (¬R ∧ Q)

13.
First DM law -> ¬(P ∧ Q) is equivalent to ¬P ∨ ¬Q
Double negation -> ¬¬P = P

¬(P ∨ Q)
= ¬ (¬ (¬ P ∧ ¬Q)) (First)
= (¬ P ∧ ¬Q)) (double neg)

which is the second law.

14.
[P ∧ (Q ∧ R)] ∧ S
= [P ∧ (Q ∧ R)] ∧ S
= P ∧ [(Q ∧ R) ∧ S]
= P ∧ [Q ∧ (R ∧ S)]
= (P ∧ Q) ∧ [(R ∧ S)

15.
2^n

16.
It's true if either both are false or both are true, or P is true.
Can be expressed as
[(P ∧ Q) ∨ (¬P ∧ ¬Q)] ∨ P
Truth table -
P Q Desired [(P ∧ Q) (¬P ∧ ¬Q)] P
F F T F T T T F
F T F F F F F F
T F T F F F T T
T T T T T F T T

17.
True when they have different values.
Can be expressed as (P ∧ ¬Q) ∨ (¬P ∧ Q)
Truth table -
(P ¬ Q) P Q)
F F T F F T F F F
F F F T T T F T T
T T T F T F T F F
T F F T F F T F T

Saturday, April 23, 2011

How To Prove It - Chapter 1 - 1.1

1.1. Deductive Reasoning and Logical Connectives

1.
(a) A = We will have a reading assignment
B = We will have a test
C = We will have homework problems

(A ∨ C) ∧ ¬ (C ∧ B)

(b) A = you will go skiiing
B = There will be snow

¬ A ∨ (A ∧ ¬B)

(c) ¬ [(√ 7 < 2) ∨ (√ 7 = 2)]

2.
(a) A = Bill is telling the truth
B = John is telling the truth

[(A ∧ B) ∨ ¬(A ∧ B)]

(b) F = I'll have fish
C = I'll have chicken
P = I'll have mashed potatoes

(F ∧ C) ∨ (F ∧ P)

(c) S = 3 is a divisor of 6
N = 3 is a divisor of 9
F = 3 is a divisor of 15

S ∧ N ∧ F

3.
A = Alice is in the room
B = Bob is in the room
(a) (A ∧ ¬B) ∨ (¬A ∧ B)
(b) ¬(A ∧ B)
(c) ¬A ∨ ¬B
(d) ¬A ∧ ¬B

4.
(a) Yes
(b) No
(c) Yes
(d) No

5.
P = I will buy the pants
S = I will buy the shirt

(a) I will not buy the pants without the shirt
(b) I will buy neither the pants nor the shirt
(c) Either I will not buy the pants or I'll not buy the shirt

6.
S = Steve is happy
G = George is happy

(a) (S ∨ G) ∧ (¬S ∨ ¬G) - One of S and G is happy, and one of S and G is unhappy.
Simplified, One of S and G is happy and the other is unhappy.

(b) [S ∨ (G ∧ ¬S)] ∨ ¬G -
Either G is unhappy, or either G is happy but S is not or S is happy.
Another form (multisentence) -
Either G is unhappy, or one of the following is true -
a) G is happy but S is not
b) S is happy.

(c) S ∨ [G ∧ (¬S ∨ ¬G)]
Either S is happy, or G is happy and one of them is unhappy.

Note:
I'm not satisfied with my answers here.

7.
(a) JC = Jane will win the chem prize
PC = Pete will win the chem prize
JM = Jane will win the math prize
PM = Pete will win the math prize

(JM ∧ ¬PM) ∨ (¬JM ∧ PM)
PM ∨ PC
JM
Conclusion : PC

Reasoning is valid.

(b) B = beef main course
F = fish main course
P = peas
C = corn

B ∨ F
P ∨ C
¬(F ¬(B ∧ P) C)
Conclusion : ¬(B ∧ P)

Reasoning is invalid. For P = B = true, C = F = false, the arguments are true but ¬(B ∧ P) is false.

(c)
J ∨ B
¬S ∨ ¬B

Conclusion : J ∨ ¬S

Reasoning is valid.

(d) (S ∧ B) ∨ (E ∧ ¬B)

Conclusion : ¬(E ∧ S)

For S = B = E = true, the argument is valid, but the conclusion is not. Hence, reasoning is not valid.

How To Prove It - Introduction

Chapter : Intro

1.
(a) 2^15 - 1 = 32767
4681×7 is a possible answer, trying out divisors from 3 onwards.

2.
n Is n prime? 3^n – 1 Prime? 3^n – 2^n Prime?
2 Yes 8 No 5 Yes
3 Yes 28 No 19 Yes
4 No 80 No 65 No
5 Yes 242 No 211 Yes
6 No 728 No 665 No
7 Yes 2186 No 2059 No
8 No 6560 No 6305 No
9 No 19682 No 19171 No

Conjectures -
(a) 3^n - 1 is not a prime irrespective of what n is
(b) If n is a prime, so is 3^n - 2^n, and if n is not, neither is 3^n - 2^n

3.
(a) m = 2 * 3 * 5 * 7 = 210
From the above table, we know 211 (m + 1) is a prime!

(b) m = 2 * 5 * 11 = 110
m + 1 = 111, which is divisible by 3 (as the sum of the digits is divisible by 3)
m + 1 = 37 * 3, both of which are primes.


4.
For n = 5,
x = (n + 1)! + 2 = 6! + 2 = 722
Non primes are - 722, 723, 724, 725, 726

5.
If 2^n − 1 is prime, then 2^(n−1) (2^n − 1) is perfect (Euclid).

Using the table in the book, 2^n - 1 is prime for n = 5, 7

P1 = 16 * 31 = 496
P2 = 64 * 127 = 8128

6. There are no more such triplets - http://en.wikipedia.org/wiki/Prime_triplet

And next...

Finished the Ross book's intro probability chapter today. I've decided not to do the next chapters yet (random variables, etc), but start with a book on mathematical proofs instead. Post that, I might do the remaining chapters, or do the Bertsekas book

Now I think this blog should have been named "math stuff". directly.

Friday, April 22, 2011

Sheldon Ross Introductory Statistics - Probability Chapter Review Problems

Review Problems

1.
(a) P(first is good) = 9/12 = 3/4 = 0.75

(b) G1 = first is good
B1 = first is bad
G2 = second is good
P(G2) = P(G2|G1) + P(G2|B1)
= 9/12 * 8/11 + 3/12 * 9/11
= 0.75

(c) P(both are good) = P(G2|G1)
= 9 / 12 * 8/11
= 6/11

(d) P(both are bad) = P(not G2 | not G1)
= P(first is bad) * P(second is bad | first is bad)
= 3/12 * 2/11 = 1/22

(e) P(one is good and one is bad)
= P(G1 ∩ B2) + P(B1 ∩ G2)
= P(B2|G1). P(G1) + P(G2|B1).P(B1)
= 3/11 * 9/12 + 9/11 * 3/12
= 0.409090909

2.
(a) 0.64
(b) 0.04
(c) 0.04

3.
F1 = makes the first shot
F2 = makes the second shot

(a) P(F1 ∩ F2) = P(F2|F1) * P(F1)
= 0.85 * 0.8 = 0.68

(b) P(not F1 ∩ not F2) = P(not F2|not F1) * P(not F1)
= 0.3 * 0.2 = 0.06

(c) P(F1 ∩ not F2) = P(not F2|F1) * P(F1)
= 0.15 * 0.8 = 0.12

4.
M = person is a man
W = person is a woman
L = voted in the last election

(a) P(W ∩ L) = P(L|W) * P(W)
= 0.68 * 0.54
= 0.3672

(b) P(M ∩ not L) = P(not L|M) * P(M)
= 0.38 * 0.46
= 0.1748

(c) P(M|L) = P(M ∩ L) / P(L)
= 0.62 / (0.68 * 0.54 + 0.62 * 0.46)
= 0.950337216 (seems too high!)

5.
(a) P(first is a boy) = 11/24

(b) P(second is a girl ∩ first is a boy)
= 13/23

6.
(a) P(both aces)
= P(first is ace ∩ second is ace)
= P(second is an ace| first is an ace) * P(first is an ace)
= 3/52 * 4/52 = 0.00443787

(b) P(both are spades) = same as above = 0.00443787

(c) Once the first card is chosen, there are 51 - 12 = 39 cards of other suits.
P(choosing another suit) = 39/52

(d) Once the first card is chosen, there are 51 - 3 = 48 cards of other denominations.
P(choosing another card) = 48/52

7.
(a) 1/2 * 1/2 * 1/2 * 1/2 * 1/2 * 1/2 = 1/64

(b) 1/64 (independent events)

(c) 1/64 (independent events)

8.
(a) 1/2 * 1/2 = 1/4

(b) 1/2 * 1/2 * 1/2 = 1/8

(c) (1/2) ^ 10 = 1/1024

9. Repeat question from one of the earlier sections.

10.
Total pop = 48.8 + 50.4 + 74.5 + 66.6 = 240.3 (million)

(a) P(A) = (50.4 + 66.6) / 240.3 = 0.486891386
P(not A) = 1 - P(A) = 0.513108614

(b) P(B) = (48.8 + 50.4 ) / 240.3 = 0.412817312

P(not B) = 0.587182688

(c) P(A ∩ B) = P(A).P(B) = 0.200997193

(d) P(A ∩ not B) = P(A). P(not B) = 0.301288495

(e) P(A|B) = P(A ∩ B) / P (B) = 0.200997193 / 0.412817312 = 0.486891386

(f) P(B|A) = P(B ∩ A) / P(A) = 0.200997193/0.486891386 = 0.412817312

11.
(a)P(The successful key is the first one tried) = 1/3
(b)P(The successful key is the second one tried) = 1/3
(c)P(The successful key is the third one tried) = 1/3
(d)P(The second key works given that the first one did not) = 1/2

13.
P(neither is faulty)
= P(first is not faulty) * P(second is not faulty|first is not faulty)
= 8/12 * 7 /11
= 14/33

14.
Note : P(B) = 0.6 and P(not A) = 0.2

(a) P(A ∩ B) = 0.8 * 0.6 = 0.48

(b) P(A ∪ B) = 0.8 + 0.6 - 0.48 = 0.92

(c) P(B) = 0.6

(d) P(not A ∩ B)

We have, P(not A) = P(not A ∩ B) + P(not A ∩ not B )
=> P(not A ∩ B) = P(not A) - P(not A ∩ not B ) (the second exp's two events are independent, so it's equal to the product of the probabilities of the events)

= P(not A) - P(notA).P(not B)
= 0.2 - 0.2 * 0.4
= 0.12

15.
(a) 1/52

(b)
A = 1st card is not ace of spades
B = 2nd card is ace of spades

P(A∩B) = P(A). P(B|A)
= (1 - 1/52) * (1/51)
= 1/52

(c) equally

(d) 1/52 - see (c)

16.
M = manual check detects
E = electronic check detects

P(not M ∩ not E) = P(not E| not M) * P(not M)
= 0.20 * 0.30 = 0.06

So, 6 % of defective disks are not detected.

17.
TG = this year is good
NG = next year is good

(a) Business conditions both this year and next will be good.
P = (TG ∩ NG) = P(NG | TG) * P(TG)
= 0.7 * 0.6 = 0.42

(b) Business conditions will be good this year and bad next year.
P = P(TG ∩ not NG) = P(not NG|TG) * P(TG)
= 0.3 * 0.6 = 0.18

(c) Business conditions will be bad both years.
P = P(not TG ∩ not NG) = P(not NG|not TG) * P(not TG)
= 0.6 * 0.4 = 0.24

(d) Business conditions will be good next year.
P(NG) = P(NG|TG)P(TG) + P(NG|not TG )P(not TG ) (Form. 4.1 on page 185)
= 0.7 * 0.6 + 0.4 * 0.4
= 0.58

(e) Given that business conditions are good next year, what is the
conditional probability that they were good this year?
P(TG|NG) = P(TG ∩ NG) / P(NG)
= 0.42 / 0.58
= 0.724137931

18.
J = child receives a blue gene from John
M = child receives a blue gene from Maureen

From the questions, it looks like once a gene is given to a child, it cannot be given again to another from that parent. But is that how it really works?

19.
A = person is above ideal weight
B = person has high BP

P(A∩B) = P(A) + P(B) - P(A B)
= 0.55 + 0.20 - 0.60
= 0.15

P(A) * P(B)
= 0.55 * 0.20
= 0.11

Since the values are different, they are not independent.

21.
(a) What is the probability that the husband earns less than $75,000?
P = (212 + 36)/500 = 0.496

(b) What is the conditional probability that the wife earns more than
$75,000 given that the husband earns more than this amount?
P = P(w> | h>) = P(h> w>) / P(h>)
= (54/500) / ((198 + 54)/500) = 0.214285714

(c) What is the conditional probability that the wife earns more than
$75,000 given that the husband earns less than this amount?
P = P(w> | h<) = P(w> ∩ h<) / P(h<)
= (36/500) / (248/500) = 0.14516129

(d) Are the salaries of the wife and husband independent?
P(h> w>) = 54/500 = 0.108
P(h>) = ((198 + 54)/500) = 0.504
P(w>) = 90/500 = 0.18

P(h>) * P(w>) = 0.09072 != 0.108
Hence, the salaries are not independent.

23.
G = purchases gasoline
O = purchases oil

(a) P(G O) = P(G) + P(O) - P(G O)
= 0.86 + 0.08 - 0.9
= 0.04
= 4%

(b)
(i) P(O | G) = P(O G) / P(G)
= 0.04 / 0.86 = 0.046511628

(ii) P(G | O) = P(O G) / P(O)
= 0.04 / 0.08 = 0.5

(iii) P(O G) = 0.04
P(O) * P(G) = 0.86 * 0.08 = 0.0688
Hence, not independent.

24.
(a) P(18-24jazz 35-44jazz)
= P(18-24jazz) * P(35-44jazz)
= 0.14 * 0.10
= 0.014

(b) P(18-24jazz) + P(35-44jazz)
= 0.24

25.
(a) P(M ∩ not W) + P(W ∩ not M)
= P(M)*P(not W) + P(W)*P(not M)
= 3/100 * 95/100 + 97/100 * 5/100
= 0.077

(b) P(M ∪ W)
= P(M) + P(W) - P (M
W)
= P(M) + P(W) - P(M)*P(W)
= (2 + 3)/100 - 2*3/10000
= 0.0494

(c) P(M) * P(W) = 15 * 19/10000 = 0.0285

26.
No, it's not enough as we don't know the overlaps.

27.
(a) P(A
∪ B)
=
P(A) + P(B) - P (A B)
= P(A) + P(B) - P(B|A)*P(A)

and,
P(B) = P(B|A)P(A) + P(B|not A)P(not A) (Form. 4.1 on page 185)
Combining,
P(A ∪ B)
= P(A) +
P(B|A)P(A) + P(B|not A)P(not A) - P(B|A)*P(A)
= P(A) + P(B|not A)P(not A)
= 0.6 + 0.1 * 0.4
= 0.64

(b) Assumption being that they are independent,
P(A ∩ B) = P(A) * P(B)
= 0.06

29.
(a) P(A
B)
= P(A) + P(B) - 0 (mut. excl.)
= 0.5

(b) P(A B)
= P(A) + P(B) - P(A).P(B)
= 0.2 + 0.3 - 0.06
= 0.44

(c) P(A B ∩ C)
= P(A).P(B).P(C)
= 0.024

(d) P(A B ∩ C)
= 0 (mutually excl, so they cannot occur together).

30.
B = has breast cancer
M = has positive mammography

P(B|M) = P(M|B)*P(B) / ( P(M|B)*P(B) + P(M|not B)*P(not B) )

= (0.9 * 0.02) / ((0.9 * 0.02) + (0.1 * 0.98) )
= 0.155172414

31.
Note: Identical does not mean it has to be monozygotic. Did not realize this simple fact at first! Also, same sex != identical

Struggled with this for half an hour, and then got the pointer from here - http://www.math.wustl.edu/~feres/Math450Lect02.pdf

BB, GG, BG -> events that the pair has only boys, only girls and mixed.
M, D -> zygoticness

For a given pair,
P(BB|M) = P(GG|M) = 1/2 (equally likely that the pair has both boys, or both girls)
P(GB|M) = 0 (always same sex)
P(GB|D) = 1/2 (sample space - BB, GG, GB, BG, fulfilling events = 2)
P(GG|D) = 1/4 = P(BB|D)

P(GG) = P(GG|M). P(M) + P(GG|D).P(D) (M = !D)
= 1/2 * P(M) + 1/4 * (1 - P(M))
=> 4P(GG) = 2P(M) + 1 - P(M)
=> P(M) = 4P(GG) - 1

Given P(GG) + P(BB) = 0.64
Also, P(M) = 4P(BB) - 1 (assuming equal number of boys and girls)

2P(M) = 4 (P(GG) + P(BB) ) -2
=> P(M) = 2 * 0.64 - 1
= 0.28

Thursday, April 14, 2011

Sheldon Ross Introductory Statistics - Probability Section 4.6

Bayes' Theorem

1.
F-> event that the fair coin is selected
B-> event that the biased coin is selected

(a) P(Heads) = P(H|F).P(F) + P(H|B).P(B)
= 0.5 * 0.5 + 0.6 * 0.5
= 0.55

(b) P(F|T) = P(F∩T)/P(T) = P(T|F)P(F)/P(T)

= P(T|F).P(F) / (P(T|F).P(F) + P(T|not F).P(not F))

= (0.5 * 0.5) / (0.5 * 0.5 + 0.4 * 0.5) = 0.555555556

2.
K-> event that the student knew the answer
C-> event that the student answered it correctly

P(K|C) = P(C|K). P(K) / (P(C|K). P(K) + P(C|not K). P(not K))

= (1 * 0.6) / (1 * 0.6 + 0.2 * 0.4 ) = 0.882352941

3.
L -> event that the suspect is left handed
G -> event that the suspect is guilty

(a) P(L) = P(L|G). P(G) + P(L|not G).P(not G)
= 1 * 0.6 + 0.18 * 0.4 = 0.672

(b) P(G|L) = P(L|G).P(G) / (P(L|G).P(G) + P(L|not G).P(not G))

= (1 * 0.6 ) / ( 1 * 0.6 + 0.18 * 0.4 ) = 0.892857143

4.
U1 - 4R 3B
U2 - 2R 2B
R1 -> event that the ball drawn from urn 1 was red
B1 -> event that the ball drawn from urn 1 was blue
R2 -> event that the ball drawn from urn 2 is red
B2 -> event that the ball drawn from urn 2 is blue

If R1 happened, there are 3R 2B in U2. Note that, R1 = not B1

(a) P(R2) = P(R2|R1).P(R1) + P(R2|not R1).P(not R1)
= (3/5)*(4/7) + (2/5)*(3/7)
= 0.514285714

(b) P(R1|B2) = (B2|R1) . P(R1) / ((B2|R1) . P(R1) + P(B2|not R1) . P(not R1) )
= (2/5)* (4/7) / ( (2/5)* (4/7) + (3/5) * (3/7) )
= 0.470588235

5.
P-> person's diagnosis is positive
D-> person has the disease

P(D|P) = P(P|D).P(D)/( P(P|D).P(D) + P(P|not D).P(not D) )

= (0.97 * 0.02) / (0.97 * 0.02 + 0.03 * 0.98)
= 0.397540984

6.
R -> this side of the card is red
M -> this is the mixed card (bi coloured)

P(M|R) = P(R|M).P(M) / (P(R|M).P(M) + P(R|not M).P(not M))

= (0.5 * 1/3) / ( (0.5 * 1/3) + (0.5 * 2/3) )
= 0.333333333

7.
(a) P(in favour) = P(A|D) + P(A|R) (A, D, R self explanatory)

= 0.42 * 0.48 + 0.64 * 0.52 = 0.5344

(b) P(R|not A) = P(not A|R) * P(R)/( P(not A|R) * P(R) + P(not A|not R) * P(not R) )

= (0.36 * 0.52) / (0.36 * 0.52 + 0.58 * 0.48)
= 0.402061856

9.
C-> it's a California household
T-> earns over 250k/year

(a) Let x be the total no of households in the US

No of households in Cal = 0.12x
No of households in Cal earning over 250k/year = 3.3 % of 0.12x
= 0.00396x

No of households in the US earning over 250k/year = 0.013x

Hence, no of households in non-Cal earning over 250k/year = 0.013x - 0.00396x
= 0.00904x

The same thing as a percentage = 0.00904x/total non-Cal households
= 0.00904x/0.88x
= 0.010272727
~ 0.0103

(b) P(C|T) = P(T|C). P(C) / (P(T|C). P(C) + P(T|not C). P(not C))

= 0.033 * 0.12 / (0.033 * 0.12 + 0.0103 * 0.88)

= 0.304054054
~ 0.3046

Tuesday, April 5, 2011

Sheldon Ross Introductory Statistics - Probability Section 4.5

Conditional Probability and Independence

1.
(a) A -> obese
B -> diabetes

P(B|A) = P(A ∩ B) / P(A)
= 0.02/0.3 = 0.067

(b) P(A|B) = P(A ∩ B) / P(B)
= 0.02/0.03 = 0.67

2.
A -> first flip is heads
B -> second flip is heads

P(B|A) = P(A ∩ B) / P(A) = 1/4 / 2/4 = 1/2 = 0.5

3.
Mistake in q? There's no bracket for >25k

5.
Total = 28900
(a) Less than 10 years old = 4200/28900 = 0.14532872
(b) Between 10 and 20 years old = 5100 / 28900 = 0.176470588
(c) Between 20 and 30 years old = 6200/28900 = 0.214532872
(d) Between 30 and 40 years old = 4400 / 28900 = 0.152249135

6.
(a) Between 10 and 20 years old, given that the resident is less than 30 years old
A -> between 10 and 20
B -> less than 30

P(A|B) = P(A ∩ B) / P(B) = (5100/28900) / (15500/28900) = 0.329032258

(b) Between 30 and 40 years old, given that the resident is older than 30

A -> between 30 and 40
B -> older than 30

P(A|B) = P(A ∩ B) / P(B) = (4400/28900)/(13400/28900) = 0.328358209

7.
(a)
A -> plays chess
B -> plays bridge

P(A|B) = P(A ∩ B) / P(B) = (26/120) / (56/120) = 0.464285714

(b)
A -> plays bridge
B -> plays chess

P(A|B) = P(A ∩ B) / P(B) = (26/120)/(40/120) = 0.65

Most problems after this are copies with the situations changed. Skipping till I find something interesting.

27.
(a) S = {(U, D), (D, U), (U, U), (D,D)} (move up, then down, or the reverse, over two days)

P(reach original after 2 days) = 2/4 = 1/2

(b) S = {(u,u,u), (u,u,d), (u,d,d), (d,d,d), (d,d,u), (d, u, u), (d,u,d), (u,d,u)}
Risen by 1 after 3 = {(u,u,d), (d, u, u), (u,d,u)}
P(rise by 1 after 3 days) = 3/8

(c) P (went up on first | risen by 1 after 3 days) = P (went up on first ∩ risen by 1 after 3 days) / P (risen by 1 after 3 days)
= (2/8) / (3/8) = 2/3

28.
(a) Independent
(b) Ind
(c) Ind

33.
A = ace
B = spade

P(A) = 4/52
P(B) = 13/52

P(A).P(B) = 1/52

P(A ∩ B) = P(A|B). P(B) = (1/13).(13/52) = 1/52

The probabilities are the same - hence, they are independent.

34.
A = {(1,6),(2,5),(3,4),(4,3),(5,2),(6,1)}
P(A) = 6/36 = 1/6
------------------------------------
B(first die on 1) = {(1,1),(1,2),(1,3),(1,4),(1,5),(1,6)}
P(B) = 6/36 = 1/6

P(A∩B) = 1/36

P(A).P(B) = P(A∩B). Hence A is independent of the fact that the first die lands on 1.
------------------------------------
C(first die on 2) = {(2,1),(2,2),(2,3),(2,4),(2,5),(2,6)}
P(C) = 1/6

P(A∩C) = 1/36

Independent
------------------------------------
D(first die on 4) = {(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)}
P(D) = 1/6

P(A∩D) = 1/36

Independent
------------------------------------
E(first die on 5) = {(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)}
Same. Ind

------------------------------------
F(first die on 6) = {(6,1),(6,2),(6,3),(6,4),(6,5),(6,6)}
Same.

Actually, because the sum is constant in all these cases, there is only one possibility for the second die to make the sum 7. Hence, the prob of that and A is always 1/36. And the prob of that _one_ event is of course 1/6. Hence, they are all independent

35.
Let's say the first person has a birthday on day 1. For the other person to have the same birthday, he has only one choice - day 1. 1 out of 365 possible days - 1/365

37.
(a) P(current flowing) = P(both relays closing) = P(A). P(B) = 0.8 * 0.8 = 0.64

(b) P(current flowing) = P(first relay closing) or P(second relay closing) = P(A) + P(B) + P(A∩B) = 0.8 + 0.8 - 0.64 = 0.96

(c) P(current flowing) = P(both upper relays close) or P(both lower relays close)
= (P(upper1).P(upper2)) or (P(upper1).P(upper2))
= 0.8 * 0.8 + 0.8 * 0.8 - (0.8 * 0.8 * 0.8 * 0.8) = 0.8704

38.
No, they are not independent.
Intuitively, P(B) changes once A has happened.


39.
Yes, they will be. In this case, P(A) is alway 1/2, and so is P(B)
P(A∩B) = 1/4 = P(A).P(B)

40.
(a) P(all 4 yes or all 4 no) = 0.7 * 0.7 * 0.7 * 0.7 + 0.3 * 0.3 * 0.3 * 0.3 = 0.2401 + 0.0081 = 0.2482

(b) P(first 2 no, last 2 yes) = 0.9 * 0.49 = 0.441

(c) P(atleast one no) = 1 - P(no nos) = 1 - (all yes) = 1 - 0.2482 = 0.7518

(d) 4 cases where exactly three answer yes.
P(3 yes) = (0.7 cubed * 0.3) quadrupled = 0.000112114

41.
(a) Rain on all 3 = 4/31 * 3/30 * 16/31 = 0.006659729
(b) Dry on all 3 = (1-4/31) * (1-3/30) * (1-16/31) = 0.379292404
(c) P(Ph, Mo, not LA) = 4/31 * (1-3/30) * 16/31 = 0.059937565
(d) ... same stuff.
(f) Sum of c,d,e

42.
(a) P(both are defective) = P(A).P(B) = 0.005
(b) P(both are not defective) = (1-P(A)). P(1-P(B)) = 0.0855
(c) P(exactly one) = P(A).P(not B) + P(not A).P(B) = 0.1 * 0.95 + 0.9 * 0.05 = 0.14
(d) P(A|defective) = P(A and defective) / P(defective)
= 0.10/(0.10 + 0.05) = 0.666666667
(e) P(B|defective) = P(B and defective) / P(defective)
= 0.05/(0.10 + 0.05) = 0.333333333

43.
(a) P(CF) = 1/2 + 1/2 = 1/4 (one from each parent)
(b) Q Not clear.

Sunday, April 3, 2011

Sheldon Ross Introductory Statistics - Probability Section 4.4

1. P(did not sleep) = (216-128)/216 = 0.407

2.
(a) Gained weight = 5/32 = 0.15625
(b) Lost weight = 18/32 = 0.5625
(c) Neither lost nor gained weight = 9/32 = 0.28125

3.
(a) An ace = 4/52 = 0.076923077
(b) Not an ace = 0.923076923
(c) A spade = 13/52 = 0.25
(d) The ace of spades = 1/52 = 0.019230769

4.
(a) Exceeds 10,000 = 3/10 = 0.33
(b) Is under 3500 = 5/10 = 0.2
(c) Is between 4000 and 6000 = 0
(d) Is less than 2000 = 0

5.
TBD

6.
4/5

7.
(a) P (not in the program) = 56/100 = 0.56
(b) Addition rule - P(A B) = (26 + 28 - 44)/100 = 0.1

8. P(either dog or cat) = 20+32 -12 = 40
So P (neither) = 60/100 = 0.6

9.
(a) Either ring or necklace=40%, 0.4
(b) P(ring and necklace) = 20+30 - 40 = 10, 0.1

10.
(a) Does not play tennis = 120 - 44 = 76
(b) Does not play squash = 120 - 30 = 90
(c) Plays neither tennis nor squash - 0.64

11. Addition rule = 44 + 30 - 18 = 56

12.
(a) Either 7 or 11 = {(1,6), (6,1), (2,5), (5,2), (3,4), (4,3), (5,6), (6,5)}
P(Either 7 or 11) = 8/36 = 0.22

(b) One of the values 2, 3, or 12 = {(1,1), (1,2), (2,1), (6,6)}
P(One of the values 2, 3, or 12) = 4/36 = 0.11

(c) An even number = {(1,1), (1,3), (1,5), (3,1), (5,1), (2,2), (2,4), (2,6), (3,3), (3,5), ( 4,2), (6,2), (5,3)}
P(an even number) = 0.36

13. 1/19

14.
(a) Earns under $15,000 = 3936 / 81018 = 0.048581797
(b) Is a woman who earns between $20,000 and $40,000 = P(woman). P(range) = 0.386827619 x 0.300093806 = 0.116084573
(c) Earns under $50,000 = (22138(w) + 21364(m))/81018 = 0.54

15.
(a) The first key opens the door = 0.1
(b) All 10 keys are tried = 1/10
Here, prob that 1st key is not = 9/10
Once this is out of the way, prob that 2nd key is not = 8/9 (total 9 left)
And so on....
So P = 9/10 x 8/9 x 7/8 x .... 1/2 = 1/10 = 0.1

16.
(a) P(2nd) = 4/9 (position does not matter)
(b) P(charles is second) = P(second is boy). P(boy is charles) = 4/9 x 1/4 = 1/9

17.
(a) January 5 - 10/31
(b) August 12 - 9/31
(c) April 15 - 10/30
(d) May 15 - 11/31
(e) October 12 - 7/31

Sheldon Ross Introductory Statistics - Probability Section 4.3

1.
(a) P(E) = 0.35 P(F) = 0.65 P(G) = 0.55
(b) P (E∪F) = 1
(c) P(E ∪ G) = 0.80
(d) P(F ∪ G) = 0.75
(e) P(E ∪ F ∪ G) = 1
(f) P(E ∩ F) = 0
(g) P(F ∩ G) = 0.45
(h) P(E ∩ G) = 0.1
(i) P(E ∩ F ∩ G) = 0.45

2.
(a) P(A) c = 0.8
(b) P(A ∪ B) = 0.7
(c) P(A ∩ B) = 0 (disjoint events)
(d) P(Ac ∩ B) = 0.5

3. 0.0001

4.
(a) P1+P2+P3 = 0.86
(b) 0.16

5.
(a) No
(b) Yes (they have overlap)

6. 1/3

7.
(a) 1100 trees - 1.0 (demand is never less than 1100!)
(b) 1400 trees - 0.8
(c) 1600 trees - 0.5
(d) 2000 trees - 0.1

8.
(a) 2 or fewer defects - 0.55
(b) 4 or more defects - 0.25
(c) Between (inclusive) 1 and 3 defects - 0.63
(d) 0.9
(e) 0.55

9.
(a) 3 or fewer errors - 0.95
(b) 2 or fewer errors - 0.80
(c) 0 errors - 0.20

10.
(a) 0.099
(b) 0.131
(c) P(80s + 90s + 100s) = 0.467

11. 0.7 (using addition rule)

12. 34%

13. 30 + 3 - 2 = 31 %

14.
(a) 0.082
(b) 0.918

15. 0.6

16.
(a) 14
(b) Both Stats and Phys - 14

17.
(a) I - A Bc
(b) II - A ∩ B
(c) III - B A c
(d) P(A ∪ B) = P(1) + P (3) - P(2)
(e) P(A) - P(1) + P(2)
(f) P(B) - P(2) + P(3)
(g) P(A ∩ B) = P(2)

Saturday, April 2, 2011

Sheldon Ross Introductory Statistics - Probability Section 4

Have been supplementing this with Khan Academy's probability lectures - they do a good job of starting from basics (needed for someone like me who last did math in school - 15 years back) and deriving the concepts from scratch. At some point I do have to read Bertsekas and follow/work through MIT's lectures.

Ch 4 Problems

1.
(a) S = {(R,R),(R,B),(R,Y),(B,B),(B,R),(B,Y),(Y,Y),(Y, R),(Y,B)}
(b) S = {(Y,Y),(Y, R),(Y,B)}
(b) S = {(R,R),(B,B),(Y,Y)}

2.
(a) S = {(R,B),(R,Y),(B,R),(B,Y),((Y, R),(Y,B)}
(b) S = {(Y, R),(Y,B)}
(c) S = {}

4.
(a) S = {(H, H, H),(H, H, T),(H, T, T),(T,T, T),(T , T, H),(T, H, T),(H, T, H), (T, H,H) }
(b) S = {(H, T, T),(T,T, T),(T , T, H),(T, H, T)}

5.
S = {(F, boat), (F, fly), (C, drive), (C, train), (C, fly)}
A = {( (F, fly), (C, fly)}

7.

(a) A ∪ B = Φ
(b) B
∪ C = {1,4,6}
(c) A ∪ (B C) = {1,3,4,5}
(d) (A
B) c = {2}

8.
(a) S = {(C, P, IC), (C, P, G), (C, P, AP), (RB, P, IC), (RB, P, G), (RB, P, AP),
(C, R, IC), (C, R, G), (C, R, AP), (RB, R, IC), (RB, R, G), (RB, R, AP),
(C, Po, IC), (C, Po, G), (C, Po, AP), (RB, Po, IC), (RB, Po, G), (RB, Po, AP)}

(b) A = {(C, P, IC), (RB, P, IC), (C, R, IC), (RB, R, IC), (C, Po, IC), (RB, Po, IC)}

(c) B = {(C, P, IC), (C, P, G), (C, P, AP), (C, R, IC), (C, R, G), (C, R, AP), (C, Po, IC), (C, Po, G), (C, Po, AP) }

(d) A ∩ B = {(C, P, IC), (C, R, IC), (C, Po, IC) }

(e) C = {(C, R, IC), (C, R, G), (C, R, AP), (RB, R, IC), (RB, R, G), (RB, R, AP) }

(f) A ∩ B ∩ C = {(C, R, IC) }

10.
(a) Yes
(b) Yes
(c) No
(d) No
(e) Yes

11.
(a) Die lands on an odd number
(b) Die lands on an even number
(c) The event itself

12.

(a) Second dice lands on 1, 3, 5
(b) A
∪ B = A
(c) Second dice lands on 5
(d) First dice lands on 2,3,4,5,6
(e) Sum of dice is odd
∩ sum of dice is 6 = Ø
(f) Event = {(5,1),(3,3),(5, 1)}