This repository contains scripts related to the course Introduction to Computational Thinking and Data Science by MITx on edX. In all projects, MITx provides the skeleton code (function wrappers) and some helper functions (functionality outside the scope of the course).
I completed this course in September 2018. View my certificate!
This program implements a brute force algorithm to find the minimum number of trips needed to take all cows across the universe in the function brute_force_cow_transport. The function returns a list of lists, where each inner list represents a trip and contains the names of cows taken on that trip.
- The ps1.py script contains the brute force algorithm.
- The ps1_cow_data.txt file contains cow names and weights in tons.
- The ps1_partition.py script is a helper function provided by MITx that fetches all of the available partitions to use for the brute force algorithm.
The files in this folder are power set generators. The power set aspect means the code generates all possible combinations of a list of items. The generator aspect means the codes generates the lists as you go along - it does not generate and store all of the combinations. This is helpful because all combinations of a large list is extremely large - 2^n where n is the number of items in the original list.
- The brute_force_generator.py script contains a generator that returns every arrangement of items from a list such that each is in one or none of two different bags. Each combination is given as a tuple of two lists, the first being the items in bag1, and the second being the items in bag2.
- The wk1_powerSet.py script contains two power set generators that each generate all combinations of N items.
This program simulates the time it takes a group of vacuum cleaner robots to clean the floor of a room. Two different strategies are developed and compared: 1) a standard robot with a standard movement strategy and 2) a random walk robot with a stochastic movement strategy.
- The ps2.py script contains the class assignments and simulation code for the program.
- The ps2_visualize.py file contains a helper function provided by MITx for visualizing the robots vacuuming.
- The ps2_verify_movement35.pyc and ps2_verify_movement36.pyc files provided by MITx contain supporting code for the visualization.
This program uses pylab to implement a stochastic simulation of patient and virus population dynamics. Two scenarios are developed: 1) patient and simple virus and 2) treated patient and resistant virus. Finally, conclusions are drawn about treatment regimens based on the simulation results.
- The ps3b.py script contains the class assignments and simulation code for the program.
- The ps3b_precompiled_35.pyc and ps3b_precompiled_36.pyc files provided by MITx contain supporting code for the simulation.
This program models the climate of different areas with regression and tries to find evidence of global warming. Models are created to analyze and visualize climate change in terms of temperature.
- The ps4.py file contains the source code.
- The data.csv file contains the data used in the regression analysis.
This folder contains miscellaneous exercises.
- The wk1_student_swaps_graphs.py file contains a WeightedEdge class extends Edge (povided by MITx). The WeightedEdge constructor requires a weight parameter, as well as the parameters from Edge. It also includes a getWeight method.
- The wk3_problems_strings.py file contains string manipulation exercises.