CS2984: Introduction to Problem Solving
Homework Assignment 12
Due at 11:00pm on Tuesday, April 15
50 Points
See the General Guidelines for homework assignments.
This assignment may optionally be done with a partner. You are strongly advised to use a partner. If you do use a partner, then:
- The final submission should contain the name of both partners.
- Only one partner need actually make the submission to Web-CAT.
- Your submission should explain the contributions of each partner.
Suppose you throw a party and you invite 11 male friends and 10 female friends. Fifteen friends attend. What is the probability that there are more female friends than male friends?
Design and code a program to simulate this problem. The program should come up with the value for the probability. The program can be written in any programming language, such as C, C++, Java, Perl, Python, Matlab, Mathematica, etc. Your program needs to be sufficently well commented, with good style such as good variable names, indentation, etc., so that it is easy to understand.
Your homework submission will include the source code for the program (simply copy this into your homework submission document), along with the answer for probability. Please note that this is number is likely to vary considerably from trial to trial. So you will need to run many iterations of the simulation before you can get a reliable estimate. Explain in your homework submission how you determined how many iterations you need to get a good answer.