Monte Carlo Club: Difference between revisions
Jump to navigation
Jump to search
imported>Weigang |
imported>Weigang |
||
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 of the | # Plot histogram or barplot to show distribution of matching counts | ||
# Hint: For R, use the sample() function. For Perl, use the rand() function. | |||
==Feb 10, 2017== | ==Feb 10, 2017== |
Revision as of 19:09, 6 February 2017
Feb 3, 2017 (Posted on Friday lab meeting)
- 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 to show distribution of matching counts
- Hint: For R, use the sample() function. For Perl, use the rand() function.