Question: please help as soon as possible. 1. A simple serial 'for loop' approach (10%) Using the algorithm given in the instructions, write a serial for-loop

please help as soon as possible.

please help as soon as possible. 1. A simple serial 'for loop'

approach (10%) Using the algorithm given in the instructions, write a serial

1. A simple serial 'for loop' approach (10%) Using the algorithm given in the instructions, write a serial for-loop approach to plot a graph of probability vs. number of people. Note: faste implementations are of course possible using MATLAB array syntax, but we are interested in examining principles of parallelisation so pleas implement the algorithm as provided. % Write your code here: Questions : Exercise 2 - 50% of the mark This task is a variant of the well documented 'birthday paradox' problem - you are required to calculate the probability of exactly two people (and only two people) sharing a birthday on any day. To do this, 1. 2. 3. For a given number of people (we shall refer to this number as N) Calculate N random numbers in the range 1-365 (we will ignore leap years). If two (and only two) of the numbers are the same, we consider our criteria has been met and add one to a counter C. Repeat (2) & (3) a sufficiently large number of times (R) to get a statistically valid answer The probability is calculated as P(N) = (C/R) * 100 4. 5. The above steps to be done for a range of N from 2 to 200 (inclusive), a graph of N vs P(N) is then to be plotted

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!