Monte Carlo Club: Difference between revisions
Jump to navigation
Jump to search
imported>Weigang m (→Feb 10, 2017) |
imported>Weigang mNo edit summary |
||
Line 7: | Line 7: | ||
# Count the number of matching orders | # Count the number of matching orders | ||
# Repeat Steps 3-4 for a 1000 times | # Repeat Steps 3-4 for a 1000 times | ||
# Plot histogram or barplot to show distribution of matching counts | # Plot histogram or barplot (better) to show distribution of matching counts | ||
# Hint: For R, use the sample() function. For Perl, use the rand() function. | # Hint: For R, use the sample() function. For Perl, use the rand() function. | ||
==Feb 10, 2017 "Birthdays" (Due 2/ | ==Feb 10, 2017 "Dating" (Due 2/17/2017)== | ||
# Randomly select N individuals and record their B-days | * Problem: What is the optimal time point when one should stop dating more people and settle down a mate choice (and live with the decision) | ||
# The problem could be investigated by assuming that there is a pool of 10 potential mates, ranked by 1-10 (high being the most desirable; ranking hidden to you) | |||
# You may only date one individual at a time | |||
# For each date, you have to make decision either to accept and stop further search, or reject and move on to the next candidate | |||
# You cannot go back to reach previously rejected candidates | |||
# Simulate stoppage points of 1-10 | |||
# For each point, obtain the probability of finding the perfect mate from a simulated search for 100 times | |||
# Plot barplot of probability versus stoppage points. | |||
==Feb 17, 2017 "Birthdays" (Due 2/24/2017)== | |||
# Randomly select N individuals and record their B-days | |||
# Count the B-days shared by two or more individuals | # Count the B-days shared by two or more individuals | ||
# Repeat (for each N) 100 times | # Repeat (for each N) 100 times | ||
# Vary N from 10 to 100, increment by 10 | # Vary N from 10 to 100, increment by 10 | ||
# Plot matching counts (Y-axis) versus N (x-axis), with either a stripchart or boxplot, or both | # Plot matching counts (Y-axis) versus N (x-axis), with either a stripchart or boxplot, or both |
Revision as of 20:54, 8 February 2017
Feb 3, 2017 "US Presidents" (Due 2/10/2017)
- Download : 1st column is the order, 2nd column is the name, the 3rd column is the year of inauguration; tab-separated
- Your job is to create an R, Perl, or Python script called “us-presidents”, which will
- Read the table
- Store the original/correct order
- Shuffle/permute the rows and record the new order
- Count the number of matching orders
- Repeat Steps 3-4 for a 1000 times
- Plot histogram or barplot (better) to show distribution of matching counts
- Hint: For R, use the sample() function. For Perl, use the rand() function.
Feb 10, 2017 "Dating" (Due 2/17/2017)
- Problem: What is the optimal time point when one should stop dating more people and settle down a mate choice (and live with the decision)
- The problem could be investigated by assuming that there is a pool of 10 potential mates, ranked by 1-10 (high being the most desirable; ranking hidden to you)
- You may only date one individual at a time
- For each date, you have to make decision either to accept and stop further search, or reject and move on to the next candidate
- You cannot go back to reach previously rejected candidates
- Simulate stoppage points of 1-10
- For each point, obtain the probability of finding the perfect mate from a simulated search for 100 times
- Plot barplot of probability versus stoppage points.
Feb 17, 2017 "Birthdays" (Due 2/24/2017)
- Randomly select N individuals and record their B-days
- Count the B-days shared by two or more individuals
- Repeat (for each N) 100 times
- Vary N from 10 to 100, increment by 10
- Plot matching counts (Y-axis) versus N (x-axis), with either a stripchart or boxplot, or both