Systematic Program Design: Week 8 - Abstraction

Abstraction Module In this module we look another techniques for improving the structure of code. Most of the problems in this module involve refactoring existing programs -- so there's relatively little new coding to do. But that doesn't mean you won't be designing programs! One of the things that separates good …



Math for CS: Problem Set 3 Thoughts

Problem 1: I was able to get the base cases, but couldn’t make the jump to the induction step. I ended up looking at the solution. Problem 2: This was a little complicated, I didn’t even know where to start. So I looked up solution as well. Problem …



Intro to CS: Problem Set 2

I was able to complete this problem set in just under an hour. It was good practice. Will show my code then the result of running the unit tests. My solution: import random import string # ----------------------------------- # HELPER CODE # ----------------------------------- WORDLIST_FILENAME = "words.txt" VOWELS = 'aeiou' def load_words(): """ returns: list, a list of valid …



Systematic Program Design: Week 7b - Local

In this module we look at a new technique for improving the structure of code. Most of the problems in this module involve refactoring existing programs -- so there's relatively little new coding to do. But that doesn't mean you won't be designing programs! One of the things that separates good …



Systematic Program Design: Week 7a - Two One-of Types

Module Overview Two One-Of Types In this module we will learn to design functions consuming two arguments that have one-of types. In order to do this, we will develop a new model of our code, the cross product of the types comment table. The cross product of the types comment …



Math for CS: Induction

Induction is a powerful method for showing a property is true for all non-negative integers. Induction plays a central role in discrete mathematics and computer science. In fact, its use is a defining characteristic of discrete—as opposed to continuous—mathematics. This chapter introduces two versions of induction, Ordinary and …



Intro to CS: Lecture 10 - Lists, Mutability

Topics: List Operations, Mutability: mutation, aliasing, tricky examples with loops over L Lists are mutable. Strings are not. We covered the append function on lists. Convert string to list using list(s), and convert list to string using join. This is all review for me. Functions with side effects can …



Math for CS: Binary Relations

We start by going over Functions. Its definition, what domains, codomains and images are, examples, and function composition. I was surprised to see some of the creative ways we can define a function. For example let f(y) be the length of a left to right search of the bits …



Intro to CS: Lecture 9 - Lambda functions, Tuples, and Lists

Topics: Tuples and lists Lambda creates a procedure/function object, but does not bind a name to it. I’ve come across lambda functions throughout my experience so I am familiar with them. Another name for them is anonymous functions. Going over tuples, and variable number of arguments. Came across …



Intro to CS: Lecture 8 - Functions as Objects

Topics: Functions: environments, scope, functions as objects This is also review for me. Another thing I noticed about this course is that a lot of math examples are used. Math and CS/Programming go hand in hand so I’m not surprised by this. Also, this is MIT, so students …