This repository has materials and work from Introduction to Algorithms, Computational Mathematics and Computational Modeling class taken in Spring 2018
---------------------------- 4.2 ----------------------------
HAT CHECK
An attendant at a party of N people receives everyone’s hats. However he forgets whose hat belongs to whom. Rather than admit his mistake, he simply gives random hats back to everyone. This code is a simulation that checks how many hats he returned correctly
HIRE ASSISTANT
You need to hire a new assistant. Every day an agency sends a new assistant for you to interview. If the assistant is better than your current assistant then you hire them. (Assistant quality is uniformly distributed between 0 and 1.) This code is a simulation that calculates how many hires there will happen given the conditions.
---------------------------- merge sort ----------------------------
The code implements 2-way merge sort, 3-way merge sort and augmented merge sort, that also has insertion sort implemented within it
---------------------------- worse-shuffle ----------------------------
This file contains an implementation of a worse shuffler on earth, that keeps shuffling randomly until it gets a sorted list.
---------------------------- median finder ----------------------------
This is a function that finds an approximation of a median of a function by selecting numbers from a list at random that fall in the percentile range