UofT-DSI | sampling - Assignment 1#1
Open
hayun120 wants to merge 2 commits into
Open
Conversation
|
Great work. Pass! |
namraschazil
approved these changes
May 26, 2026
namraschazil
left a comment
There was a problem hiding this comment.
Great work. Pass!
Overall a carefully executed assignment with adequate reasoning provided for the stages of sampling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
I completed assignment 1 by inspecting the script to answer questions re sampling, and also modified the code to make it reproducible by setting a fixed random seed before running the simulation.
What did you learn from the changes you have made?
I learned how to identify different sampling functions and underlying distributions. I also learned that reproducibility is sensitive to sample size - with only 10 or 100 repetitions, results varied more substantially across runs due to the high variability of smaller samples.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
N/A
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
The main challenge would have been deciphering where to place the 'np.random.seed'. Placing it inside the simulate_event() function resets the generator on every iteration, causing all 1000 simulations to produce identical results. Placing it once before the results = [...] ensured the full sequence of simulations was seeded correctly.
How were these changes tested?
The modified script was run multiple times, and the output histogram was inspected to confirm the changes. The simulation was also tested at 10, 100, and 1000 repetitions as instructed to verify consistent output at each level.
A reference to a related issue in your repository (if applicable)
N/A
Checklist