1

  • \[ P_{red} | P_{blue}= P_{red} + P_{blue} \]

Answer :.9348

red <- 54
white <- 9
blue <- 75
total <- red+white+blue
red/total+blue/total
## [1] 0.9347826

2

  • \[ P_{red}= Comb_{Red}/Comb_{Red,Green,Blue,Yellow}\]

Answer :.25

green <- 19
red <- 20
blue <- 24
yellow <- 17

red/(green+red+blue+yellow)
## [1] 0.25

3

  • \[P_{(notmale)}|P_{(notliveparents)}== 1-P_{(male)}\& P_{(liveparents)}\]

Answer : .8463

# probability is male and lives with parents is the category male lives with parents= 215
male_w_parents <- 215
total <- 1399
1-(male_w_parents/total)
## [1] 0.8463188

4

  • \[ if: P_{(losingweight|going gym)}\neq P_{(losingweight)} \]
    • than this outcome is dependent

5

\[{{8}\choose{3}}\cdot{{7}\choose{3}}*{{3}\choose{1}} \]

Answer : 5880

choose(8,3)*choose(7,3)*choose(3,1)
## [1] 5880

6

  • \[ Assuming P_{(Runsoutofgas)}= P_{Runsoutofgas|WatchesNews} \]
    • independent

7

  • find permuations
    • equation for function taken from link

Answer : 121080960

perm <- function(n,k){choose(n,k) * factorial(k)}
perm(14,8)
## [1] 121080960

8

\[ P_{(red)}+P_{(orange)}+P_{(green)} \]

\[ ({{9}\choose{0}}*{{4}\choose{1}}*{{9}\choose{3}})/{{22}\choose{4}}\]

Answer : .046

(choose(9,0)*choose(4,1)*choose(9,3))/choose(22,4)
## [1] 0.04593301

9

Answer : 7920

factorial(11)/factorial(7)
## [1] 7920

10

  • \[ \bar{P}_{(event)}=1-P_{(event)} \]
  • 33% of subscribers are not over the age of 34

11

choose(4,3)*.5**3*.5**1
## [1] 0.25
  • the probability of getting exactly 3 heads in 4 tosses is .25
  • Now calculating EV
prob <- .25
prob_comp <- .75
wage_won <- 97
wage_lost <- 30
total_earned <- prob*wage_won -(prob_comp*wage_lost)
total_earned
## [1] 1.75

Answer : My expected value is 1.75

step 2

  • total won or lost is simply ev* count

Answer : 978.25

559*total_earned
## [1] 978.25

12

  • using the same binomial concept as above
probablity_count <- c()
n=9
j=0
while (j<5){
new_count <- choose(n,j)*.5**(j)*.5**(n-j)
probablity_count <- append(probablity_count,new_count)
j=j+1

}
print(sum(probablity_count))
## [1] 0.5
prob_win <- sum(probablity_count)
  • now to get expected value

Answer : -1.5

my_ev <- prob_win*23-((1-prob_win)*26)
print(my_ev)
## [1] -1.5

step 2

  • \[ev * count\]

Answer :-1491

my_ev*994
## [1] -1491

13

A. Find PPV

link

PPV

PPV

liars <- .2
truth <- .8
sensitivity <- .59
# therefore FP
FP<- .41
specificity <- .9
FN <- .1
falsey_identified_liar <- truth*F
P_Liar_given_positive_test <- (liars * sensitivity) / ( liars * sensitivity+ (1 -liars)*(1-specificity))
P_Liar_given_positive_test
## [1] 0.5959596

Answer : PPV=0.5959596

B. Find NPV

link

NPV

NPV

NPV <- specificity*(.8) / (specificity*(.8)+ (FP*liars))

C.

\[\begin{equation} P(Liar \cup detectedLiar) = P(Liar) + P(detectedLiar) - P(liar \cap detectedLiar) = .28 \end{equation}\]
  • going back to question 1
    • the numerator is (liars * sensitivity)=.118
    • denominator is ( liars * sensitivity+ (1 -liars)*(1-specificity))=.198
    • Therefore:
liars+ (liars * sensitivity+ (1 -liars)*(1-specificity))-(liars * sensitivity)
## [1] 0.28

Answer .28