Question: ***Using a nested for loop in R***** Let x be the vector 1:366. Use a nested for loop to estimate, for each value of the
***Using a nested for loop in R*****
Let x be the vector 1:366. Use a nested for loop to estimate, for each value of the vector x[i] = i, the corresponding probability y[i] that there will be at least one common birthday if there are i people in a room (ignore leap years, as usual). Your for loop should create a vector y of the same size as x. Now use the plot command plot(x,y) to draw the graph.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
