DATA605 Homework 6

1.

A box contains 54 red marbles, 9 white marbles, and 75 blue marbles. If a marble is randomly selected from the box, what is the probability that it is red or blue? Express your answer as a fraction or a decimal number rounded to four decimal places.

\[\frac{(54+75)}{(54+9+75)} = 0.9348\]

2.

You are going to play mini golf. A ball machine that contains 19 green golf balls, 20 red golf balls, 24 blue golf balls, and 17 yellow golf balls, randomly gives you your ball. What is the probability that you end up with a red golf ball? Express your answer as a simplified fraction or a decimal rounded to four decimal places.

\[ \frac{20}{(19+20+24+17)} = \frac{20}{80} = \frac{1}{4} = 0.2500\]

3.

A pizza delivery company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of 1399 customers. The data is summarized in the table below.

Gender and Residence of Customers Males Females Apartment 81 228 Dorm 116 79 With Parent(s) 215 252 Sorority/Fraternity House 130 97 Other 129 72

What is the probability that a customer is not male or does not live with parents? Write your answer as a fraction or a decimal number rounded to four decimal places.

P(not male or does not live with parents) = P(is female) + P(does not live with parents) - P(female and does not live with parents) / N \[\frac{(228+79+252+97+72)+(1399-215-252)-(228+79+252+97+72-252)}{1399}\] \[=0.8463\]

4.

Determine if the following events are independent. Going to the gym. Losing weight.

Answer: A) Dependent

5.

A veggie wrap at City Subs is composed of 3 different vegetables and 3 different condiments wrapped up in a tortilla. If there are 8 vegetables, 7 condiments, and 3 types of tortilla available, how many different veggie wraps can be made?

\[\binom{8}{3} \binom{7}{3} \binom{3}{1} = 5880\]

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

A total of \(5880\) different veggie wraps can be made from the number of choices above.

6.

Determine if the following events are independent. Jeff runs out of gas on the way to work. Liz watches the evening news.

Answer: B) Independent

7.

The newly elected president needs to decide the remaining 8 spots available in the cabinet he/she is appointing. If there are 14 eligible candidates for these positions (where rank matters), how many different ways can the members of the cabinet be appointed?

choose(14,8)
## [1] 3003

\[ \binom{14}{8} = 3003\]

There are \(3003\) different ways the members of the cabinet can be appointed.

8.

A bag contains 9 red, 4 orange, and 9 green jellybeans. What is the probability of reaching into the bag and randomly withdrawing 4 jellybeans such that the number of red ones is 0, the number of orange ones is 1, and the number of green ones is 3? Write your answer as a fraction or a decimal number rounded to four decimal places.

There are a total of \(9+4+9 = 22\) jellybeans. 4 jellybeans can be drawn at random in \(\binom{22}{4}\) ways. Now we need to select 4 jelly beans in a way that there are 0 red, 1 orange, and 3 green.

0 out of 9 red can be chosen in \(\binom{9}{0}\) ways. This is zero so we won’t move forward in considering this option. 1 out of 4 orange can be chosen in \(\binom{4}{1}\) ways. 3 out of 9 green can be chosen in \(\binom{9}{3}\) ways.

\(\frac{\binom{4}{1} \binom{9}{3}}{\binom{22}{4}}\)

jellybeans <- (choose(4,1)*choose(9,3))/choose(22,4)
jellybeans
## [1] 0.04593301

The probability of reaching into the bag and randomly withdrawing 4 jellybeans such that the number of red ones is 0, the number of orange ones is 1, and the number of green ones is 3 is \(0.0459\).

9.

Evaluate the following expression. \[\binom {11}{7}\] \[\binom{n}{k} = \frac{n!}{k!(n-k)!}\] \[=330\]

choose(11,7)
## [1] 330

10.

Describe the complement of the given event. 67% of subscribers to a fitness magazine are over the age of 34.

The complement of this event would be subscribers who are age 34 and under since the above assumption includes 34 is not included.

11.

If you throw exactly three heads in four tosses of a coin you win 97. If not, you pay me 30.

Step 1. Find the expected value of the proposition. Round your answer to two decimal places.

4 coins tossed, all possibilities: HHHH TTTT HTTT HHTT HHHT THHH TTHH TTTH THTH HTHT THHT HTTH TTHT THTT HTHH HHTH

*italic text indicates a combination with 3 heads

Probability of three heads in four tosses is \(\frac{4}{16}= \frac{1}{4}=0.25\) The probability of winning 97 dollars is 0.25. The probability of losing 30 dollars is 0.75. Therefore, the expected value of this proposition is: \[E(X) = 97*0.25 - 30*0.75 = 46.75\]

Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.)

If we played this game 559 times, we would expect to win \(46.75*559 = 26133.25\)

12.

Flip a coin 9 times. If you get 4 tails or less, I will pay you 23. Otherwise you pay me 26.

Step 1. Find the expected value of the proposition. Round your answer to two decimal places.

\[P(win) = \frac{9!}{4!(9-4)!}(0.5)^4(1-0.5)^{9-4}\]

win = (factorial(9)/(factorial(4)*factorial(5))*(0.5)^4*(0.5)^5)
win
## [1] 0.2460938
lose = 1-win
lose
## [1] 0.7539062
ex_w <- win*23
ex_w
## [1] 5.660156
ex_l <- lose*-26
ex_l
## [1] -19.60156
ex_tot <- ex_w + ex_l

ex_994 <- ex_tot*994

The expected value of this proposition is \(5.66\).

Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)

If you played this game 994 times, you would expect to lose \(19.60\).

13.

The sensitivity and specificity of the polygraph has been a subject of study and debate for years. A 2001 study of the use of polygraph for screening purposes suggested that the probability of detecting a liar was .59 (sensitivity) and that the probability of detecting a “truth teller” was .90 (specificity). We estimate that about 20% of individuals selected for the screening polygraph will lie.

X = liar + = detected as a liar

  1. What is the probability that an individual is actually a liar given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.)

\[P(X | +) = \frac{P(+ \cap X)}{P(+)} = \frac{P(+|X)P(X)}{P(+|X)P(X)+P(+|X')P(X')}\] \[\frac{0.59*0.2}{0.59*0.2+0.1*0.8} = 0.5960\] The probability that an individual is actually a liar given that the polygraph detected him/her as such is \(0.5960\).

  1. What is the probability that an individual is actually a truth-teller given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.)

\[P(X' | +') = \frac{P(+' \cap X')}{P(+')} = \frac{P(+'|X')P(X')}{P(+'|X)P(X)+P(+'|X')P(X')}\] \[\frac{0.9*0.8}{(1-0.59)*0.2+0.9*0.8} = 0.8978\]

The probability that an individual is actually a truth-teller given that that polygraph detected him/her as such is \(0.8978\).

  1. What is the probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph? Be sure to write the probability statement.

\[P(X' | +) = \frac{P(+ \cap X')}{P(+)} = \frac{P(+|X')P(X')}{P(+|X)P(X)+P(+|X')P(X')}\] \[\frac{0.1*0.8}{0.59*0.2+0.1*0.8} = 0.4040\] \[P(X \cap X' | +) = 0.2 + 0.4040 = 0.6040\]

The probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph is \(0.6040\).