Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with writing the spmd version of this code. With four workers available Exercise 2 - 50% of the mark This task is
I need help with writing the spmd version of this code. With four workers available
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, UAWN 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 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 3. Using SPMD (25%) This section is for the version that uses SPMD. The code should use as many workers as there are physical cores on a machine and should be able to adapt appropriately when run on another machine. % Write your code here: I 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, UAWN 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 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 3. Using SPMD (25%) This section is for the version that uses SPMD. The code should use as many workers as there are physical cores on a machine and should be able to adapt appropriately when run on another machine. % Write your code here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started