Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Give a scenario where the multiplicative rule applies. LO5

Answered: 1 week ago

Question

What is the principle of thermodynamics? Explain with examples

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago