Sunday, April 11, 2010

Sheet 6

Draw a flowchart to estimate the probability that out of 5 persons, 3 or more are born in the same month.

Hint:
There will be 3 functions:
First function:
Similar to the main function illustrated in fig. 3.3. (p.53).

Second function:
This function starts by calling the third function 5 times to generate: m1, m2, m3, m4, m5.
where: mj is the birth month of person j.
Then the function compares these 5 numbers and returns a boolean value.
value. '1' Indicates success; i.e. in this trial, we found three (or more numbers) that are equal.
value '0' indicates failure.

Third function:
Randomly generate the month of birth for a single person.
You can use this formula: 1+int(12*Rand)

N.B. Read this site to know how to draw flowcharts in word.

Or use SmartDraw SW or Visio SW.

1 comment: