Question

In: Statistics and Probability

Homework # 3: Note: Please circle your answers when appropriate! 1) You have a sample of...

Homework # 3: Note: Please circle your answers when appropriate! 1) You have a sample of 11 flowers from pea plants. (a) Suppose 7 of them are white, and 4 of them are purple. If you line them up in a row, how many different arrangements can you get? Note: WWWWWWWPPPP is one arrangement, WPWPWPWPWWW is another arrangement, and so on. You do NOT want to actually list all possible arrangements - instead, use what you learned in class to calculate this. (b) Now suppose 4 of them are white and 7 of them are purple. How many different arrangements can you get? (c) How many arrangements do you have for 1 white and 10 purple? (d) How many arrangements do you have for 0 white and 11 purple? 2) In the U.S., about 8.5% of people are B+ for blood type. You take a sample of size 9. You're interested in people who are B+. Figure out the following probabilities: a) Pr{Y = 3} b) Pr{Y = 1} c) Pr{Y < 1} d) Pr{Y > 0} (hint - use (c) to answer this and make sure you know why this works) 3) Mendelian genetics predict that in Labrador retrievers (a type of dog), 75% should have black coat color if both parents are heterozygous (the rest are brown). You mate two parents and get a litter of 6 puppies. Calculate the following: a) The probability of 4 black puppies. b) The probability of 4 brown puppies. c) The probability that 50% of the puppies will be brown. (Comment: You do not need to know anything about genetics to solve this problem. If you're trying to do things like use punnet squares, you're doing things wrong) 4) Refer to problem 3. Calculate the probability of every possible outcome (hint: you need to make seven calculations (you already made three of them in problem 3)). 5) Let's do some R.... Suppose you have the following situation: You have a large jar of beans, 29% black, 71% white. You take a sample of 11 beans. a) Use R to figure out the probability for every single possible outcome. In other words, you need to calculate: Pr{0 black beans in 11 trials} Pr{1 black bean in 11 trials} . . etc. . Pr{11 black beans in 11 trials} b) Once you have this information, you need to plot a barplot that shows you what this distribution looks like. As you might guess, you'll need to use the binomial (in R - see below) to solve this problem. Make sure you present all your results (you should have a list of probabilities and the barplot). _________________________________________________________________________________________ Some R instructions to help you are on the next page. Instructions for copying graphs in/from R are also included at the end. For R problems: be prepared to sketch or list your results. You may be asked to show graphs to the class using the document camera at the front of the room (your recitation instructor will set this up for you). Note the following: NEVER, NEVER, hand in just an R printout: Clean it up and clearly label your answers. Make it obvious where everything is and what/where your conclusions/answers are. You will not do well if all you do is hand in a printout. Due in recitation the week of February 17th . R commands: Caution: Be careful copying and pasting commands into R. Some characters may not copy correctly and give you error messages. This is particularly true for quotes. R does not recognize quotes that look like “, only quotes that are straight like this: " . I tried to fix this below, but can’t guarantee I caught everything. Bean problem: Here's an example using a sample of 8 beans from a jar with 32% black beans. You should be able to modify the following as needed to answer question 6: For probabilities: You want probabilities for 0 through 8 beans. First we need to create y with 8 numbers: y <- c(0:8) This command says to give “y” the numbers 0 - 8 in sequence; technically “0:8” tells R it's a sequence of numbers, and the “c” out front means to combine all the numbers. The “c” isn't really needed (try it!) this time, but it is required in many similar situations so it's a good habit to get into to. Now we just “feed” our y into the binomial function to get our answers: p <- dbinom( y, size = 8, prob = .32) This should give you “p” with all the binomial probabilities (they'll be in order from 0 to 8; type “p” to get/see the probabilities) If you want to make it look nice, you can do: pr <- data.frame(y,p) pr to make it look even better, follow this with: print(pr,row.names = FALSE) The data.frame command combines the variables you list (in this case, y and p) into a single data set. Unfortunately if you then type “pr” R will insist on printing row names as well. If you want to get rid of the row names (they’re not needed), you need to use the print statement as given above. To get a barplot: To get a barplot, you simply do (see also the homework instructions from last week): barplot(p) This won't look very nice, so you should try to improve it: barplot(p,names.arg = y) Here “names.arg” is the variable that holds the labels you want to put on the x axis (remember we put the numbers 0 - 8 into y). Just try it - you'll see how it works. If you want to improve your graph even more, you can do (review the caution statement above if you have trouble copying and pasting this): barplot(p,names.arg = y, ylab = "frequency", xlab = "number of dark beans") Or even fancier: barplot(p,names.arg = y, ylab = "frequency", xlab = "number of dark beans", col = "blue") To copy/save graphs generated in R or RStudio: You're going to want to save your graphs or copy them into a word processor so that you can hand them in or refer to them during presentations. If you are using RStudio: (If you're given a choice of format to use as you follow these instructions (usually under Windows), choose “metafile”) Make sure the graph you want is visible in the graphics window. Click on “export” near the top of the plot window. Select “Copy Plot to Clipboard” The click on “Copy Plot” Open your favorite word processor and paste the graph into your document. Comment: copying graphs this way doesn't always give you the best looking graphs (particularly if you're using Linux). Saving the plot as a high resolution image and then inserting this into your document often gives better results. The details on how to do this are provided below - the following instructions work both with and without Rstudio. If for some strange reason you're not using RStudio or you want to do this just from the command line: Windows: In R, right click the graph, select “copy as metafile” (don't use bitmap), then open your favorite word processor and paste the graph. Mac OS: You should be able to copy the graph (make sure the graph window is active) from the menu, and then simply paste the graph into Word (or whatever word processor you use). If this doesn't work for some reason, the Linux instructions will work (they'll work with Windows as well). Linux: This is a bit complicated. A simple way to do it is to use the print screen key, but it'll look horrible. Here’s one example of getting good looking graphs: 1) generate the graph on-screen (just as usual) to make sure it looks right. 2) type “jpeg()” in the command line. There are actually several formats you can pick but jpeg is probably the easiest. 3) generate the graph again (make the graph again). You'll notice that nothing seems to happen. That's okay. It's writing the graph to a jpeg file. 4) now type “dev.off()” on the command line. 5) the graphics file should now be in your home directory. It'll have a name like “Rplotxxx.jpeg”, where xxx is some number. You can always sort by modification date in your file browser to find it quickly. 6) You should now be able to insert or copy the file into your text document (e.g. Word, LibreOffice, or whatever you're using). 7) The jpeg may not look terrific (it'll look a lot better than “print-screen”. You can increase the resolution by doing (in step 2 above)): jpeg(width = 1000,height = 1000) The jpeg command defaults 480 x 480, which isn't that great. You can also use the jpeg command to give it a filename that makes sense, if you want: jpeg(filename = "your-file-name",width = xxx, height = xxx)

Solutions

Expert Solution

1)

You have a sample of 11 flowers from pea plants.

(a) Suppose 7 of them are white, and 4 of them are purple

If you line them up in a row, The number of different arrangements can you get will be given by-

Here in a sample of 11 flowers there are 7 white(W) and 4 are purple(P)

Total Number of ways 7 white(W) flowers can be arrange - 11P7 = 11! / (11-7 )! = 39916800 / 24 =1663200

Total Number of ways 7 purple(P) flowers can be arrange - 11P4 = 11! / (11-4 )! = 39916800 / 5040 = 7920

Hence number of different arrangements can you get will be given by -11P7 * 11P4 = 1663200*7920 = 13172544000

(b) Now suppose 4 of them are white and 7 of them are purple. How many different arrangements can you get.

Here Number of possible ways will be same to that of case where 7 of them are white and 4 of them are purple.

Different arrangements can you get. - 13172544000

(c) How many arrangements do you have for 1 white and 10 purple

Total Number of ways 1 white(W) flowers can be arrange - 11P1 = 11! / (11-1 )! = 39916800 / 3628800 = 11

Total Number of ways 10 purple(P) flowers can be arrange - 11P10 = 11! / (11-10 )! = 39916800 / 1 = 39916800

Hence number of different arrangements can you get will be -11P1 * 11P10 = 11*39916800 = 439084800

(d) How many arrangements do you have for 0 white and 11 purple

Total Number of ways 0 white(W) flowers can be arrange - 11P0 = 11! / (11-0)! = 39916800 / 39916800 = 1

Total Number of ways 11 purple(P) flowers can be arrange - 11P11 = 11! / (11-11 )! = 39916800 / 1 = 39916800

Hence number of different arrangements can you get will be -11P0 * 11P11 = 1*39916800 = 39916800

But if we assume every 11 purple flowers to be same then there will be only 1 possible arrangements

                                                                                                                                       - PPPPPPPPPPP

2) In the U.S., about 8.5% of people are B+ for blood type. You take a sample of size 9.

Thus p = 0.085 , n = 9

You're interested in people who are B+.

It will be binomial process with probability of success p = 0.085

P(Y = y ) =

Figure out the following probabilities:

a) Pr{Y = 3}

Substituting n = 9 , p = 0.085 , y =3 we get

Required probability -

                                - 0.0302735

b) Pr{Y = 1}

Substituting n = 9 , p = 0.085 , y =1 we get

Required probability -

                                - 0.3758635

c) Pr{Y < 1}

Pr(Y < 1)   = P ( Y = 0 )                   

{ Note - Since we are not given Y , we cant take P ( Y = 1 ) }

Required probability   - 0.4495623

d) Pr(Y > 0)

Pr(Y > 0) = 1 - P ( Y 0 )   = 1 - 0.4495623 = 0.5504377

3) Mendelian genetics predict that in Labrador retrievers (a type of dog),

75% should have black coat color if both parents are heterozygous (the rest are brown).

Let p be probability of success ; here success will be represent as getting black puppies

Hence p = 0.75

    1 - p = 0.25

You mate two parents and get a litter of 6 puppies.   hence n = 6

P(Y = y ) =                   ; where p =0.75 and x represent number of black puppies.

Calculate the following:

a) The probability of 4 black puppies. ( y= 4 )

Substituting n = 6 , p = 0.75 , y =4 we get

Required probability -

                                - 0.2966309

b) The probability of 4 brown puppies.

       then number of black puppies = 6 -4 = 2

hence y =2     

Required probability -

                                - 0.03295898

c) The probability that 50% of the puppies will be brown

You mate two parents and get a litter of 6 puppies , Thus 50 % of 6 is 3

50% of the puppies will be brown mean 3 puppies will be brown

then number of black puppies = 6 -3 = 3

                        hence y =3

Required probability -            ; p = 0.75

                                -  0.1318359

3. Calculate the probability of every possible outcome (hint: you need to make seven calculations (you already made three of them in problem

i.e y= 0,1,2,3,4,5,6,           , where y represent number of black puppies

Required Probabilities

for P(Y = 0)   =   0.0002441406

for P(Y = 1)   =   0.0043945312

for P(Y = 2)   =   0.0329589844

for P(Y = 3)   =   0.1318359375

for P(Y = 4)   =   0.2966308594

for P(Y = 5)   =   0.3559570313

for P(Y = 6)   =   0.1779785156

We will draw bar-plot using R

R-Code

p=0.75
n=6
x=0:6
P=1.0
for(i in 1:7)
{P[i]=dbinom(x[i],n,p)}
data.frame(P)
data.frame(P)
             P
1 0.0002441406
2 0.0043945312
3 0.0329589844
4 0.1318359375
5 0.2966308594
6 0.3559570313
7 0.1779785156

barplot(P,names.arg = c(0:6),col=5)

You have a large jar of beans, 29% black, 71% white.

You take a sample of 11 beans. Hence n = 11

Let p be probability of success ; here success will be represent as getting black beans

Hence p = 0.29

q =1 - p = 0.71            { Prob of getting white beans }

a) Use R to figure out the probability for every single possible outcome. In other words, you need to calculate:

Pr{0 black beans in 11 trials} Pr{1 black bean in 11 trials} . . etc. . Pr{11 black beans in 11 trials}

We will write R -Code for getting Probability .It is binomial process with n = 11 and p = 0.29

We need to calculate Probability for every y = 0,1,2,3,...,10,11

R - Code

p=0.29             #    probability of success
n=11                #    total number of trails
y=0:11             #   creating variable for y = 0 ,1,2,3,....,10,11
P=1.0             
for(i in 1:12)              #   Loop
{P[i]=dbinom(y[i],n,p)}

> data.frame(P)                #Requires Probabilities

      y            P
1   0   2.311223e-02
2   1   1.038423e-01
3   2 2.120722e-01
4   3   2.598632e-01
5   4 2.122826e-01
6   5   1.213898e-01
7   6   4.958173e-02
8   7   1.446550e-02
9   8   2.954221e-03
10 9   4.022179e-04
11 10 3.285723e-05
12 11   1.220051e-06

Sr no.

y

Probabilities

1

0

2.311223e-02

2

1

1.038423e-01

3

2

2.120722e-01

4

3

2.598632e-01

5

4

2.122826e-01

6

5

1.213898e-01

7

6

4.958173e-02

8

7

1.446550e-02

9

8

2.954221e-03

10

9

4.022179e-04

11

10

3.285723e-05

12

11

1.220051e-06

b) Once you have this information, you need to plot a barplot that shows you what this distribution looks like

R-Code: -

barplot(P,names.arg =c(0:11),col=5,
              main ="BarPlot", xlab="y" )


Related Solutions

Please circle the answers and please make sure that it is true answer. Thank you. A...
Please circle the answers and please make sure that it is true answer. Thank you. A particle executes linear SHM with frequency 0.11 Hz about the point x = 0. At t = 0, it has displacement x = 0.33 cm and zero velocity. For the motion, determine the (a) displacement at t = 2.2 s, and (b) velocity at t = 2.2 s.
*Be sure to show work that supports your answers. *Include appropriate units in your answers. 3....
*Be sure to show work that supports your answers. *Include appropriate units in your answers. 3. (10 points) Pass rates for Math 355 at ARC have been 61.5%. In an effort to improve pass rates in the course, faculty piloted a mastery-based learning model where course content was delivered in a lab through a computer program. Students could either voluntarily enroll in the pilot program or they could take one of the other traditional classes. Of the 120 students who...
Please note that the previous answers were blurred, so can you please make the answers readable....
Please note that the previous answers were blurred, so can you please make the answers readable. Thanks so much, i really appreciate your help. God bless. Question: Elliot Karlin is a 35-year-old bank executive who has just inherited a large sum of money. Having spent several years in the bank's investments department, he's well aware of the concept of duration and decides to apply it to his bond portfolio. In particular, Elliot intends to use $1million of his inheritance to...
Answer 2 of the following questions and relate your answers with other students’ answers when appropriate:...
Answer 2 of the following questions and relate your answers with other students’ answers when appropriate: 1. In California, farmers pay a lower price for water than do city residents. What is this method of allocation of water resources? Is this allocation of water efficient? Is this use of scarce water fair? Why or why not? 2. If farmers were charged the same price as city residents pay, how would the price of agricultural produce, the quantity of produce grown,...
For your homework assignment for week 1 prepare an essay that answers the following questions: 1....
For your homework assignment for week 1 prepare an essay that answers the following questions: 1. A decade ago the idea that medical procedures might move offshore was unthinkable. Today it is a reality. What trends have facilitated this process? Is the globalization of health care good or bad for the American economy? 2. Is the globalization of health care good or bad for patients? Who might benefit from the globalization of health care? Who might lose? 3. How might...
Note : the Answers should be computerized and in your own words please Case Study This...
Note : the Answers should be computerized and in your own words please Case Study This is from an old story, back in the ’30s, in the days when an ice cream sundae cost much less. A 10 year-old boy entered a hotel coffee shop and sat at a table. A waitress put a glass of water in front of him. “How much is an ice cream sundae?” the little boy asked. “Fifty cents,” replied the waitress. The little boy...
Please provide accurate answers to the followings with appropriate graphs: Please write your responses clearly and...
Please provide accurate answers to the followings with appropriate graphs: Please write your responses clearly and elaborate your answers with graphs and equations to get full credit. PART A Q.1 The following table gives the short-run and long-run total costs for various levels of output of Consolidated National Acme, Inc. Q 0 1 2 3 4 5 6 7 TC 1 0 300 400 465 495 540 600 700 TC 2 350 400 435 465 505 560 635 735 Which...
Note- can you please rewrite the code in C++ Write a class declaration named Circle with...
Note- can you please rewrite the code in C++ Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the radius variable, and a function named getArea that returns the area of the circle. The area is calculated as 3.14159 * radius * radius
Which of the breathing patterns would you expect to have the following results? Circle the appropriate...
Which of the breathing patterns would you expect to have the following results? Circle the appropriate answer. - Increased systemic artery PCO2 Hypernea/ Hyperventilation/ Hypoventilation      - Decreased systemic artery PCO2 Hypernea/ Hyperventilation/ Hypoventilation - Increased systemic artery pH Hypernea/ Hyperventilation/ Hypoventilation - Decreased systemic artery pH Hypernea/ Hyperventilation/ Hypoventilation - Increased systemic artery PO2 Hypernea/ Hyperventilation/ Hypoventilation - Decreased systemic artery PO2 Hypernea/ Hyperventilation/ Hypoventilation
Ans In Java Please Homework 6-1 So far in this course, all of your programs have...
Ans In Java Please Homework 6-1 So far in this course, all of your programs have been written to be fully contained inside a single method named main. The main method is where Java begins execution of your program. In this assignment, you will coding other methods in addition to the main method. These additional methods will perform specific functions and, in most cases, return results. Write all your methods in a class named Homework6Methods.java Write a public static method...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT