1. LON-CAPA Logo
  2. Help
  3. Log In
 

Browsing resource, all submissions are temporary.


Correlation

Type the following R commands:

set.seed(2042486)
x <- rnorm(100,mean=-2, sd=1.5) 
y <- 2*x + 3*rnorm(100)

What is the correlation coefficient between the variables x and y? Give your answer to at least 4 decimal places.

Correlation =

 Tries 0/3


Generalized Birthday Problem

The seed number in the previous question was generated randomly between 1 and 10000000 (107).

a. What is the probability that at least two students get the same seed number in a class of 350 students? Give your answer to 4 significant figures. (Hint: use the prod() function. You can also use the pbirthday() function, but you will need to type ?pbirthday to find out the correct arguments to pass to the function.)

P(at least one) =

 Tries 0/3

b. Suppose the number of students increases to 1400 (about the size of Stat 100 classes per semester). What is the probability now?

P(at least one) =

 Tries 0/3

c. Suppose I made a mistake in the setup. I missed one 0 and ended up choosing the seed numbers between 1 and 1000000 (106). What would be the probability that at least two students get the same seed number in a class of 1400 students in this case?

P(at least one) =

 Tries 0/3