Course Introduction

In-class notes

1 Today’s Information

1.1 Learning Goals for Today

  • Define Algorithms
  • Understand course structure
  • Brainstorm group and learning strategies

1.2 Announcements/Logistics

2 What is an algorithm?

Definition: An algorithms is a finite, clearly defined sequence of instructions for carrying out a task.

ABCD Question

Which of the following are algorithms?

  1. Go to Cambridge
  2. int i=1;
    while(i<5){
        i=i+1;
    }
  3. function Fib(\(i\))

    Input: integer \(i: i\geq 0\)

    Output: \(i^{\textrm{th}}\) Fibonacci number

    If \(i\in \{0,1\}\), then return \(i\)

    Return Fib(\(i-1\))+Fib(\(i-2\))

  4. public static void fun(int j){
        int k=1;
        k++;
    }

3 Plan for the Semester

We will look at 3 paradigms for designing algorithms:

  • Divide and Conquer
  • Greedy
  • Dynamic Programming

For each algorithm, we will do the following:

  • Describe using pseudocode and/or java
  • Prove correctness
  • Analyze the asymptotic runtime
  • Consider ethical implications of implementing in a particular domain

We will also study NP-completeness, which is a particular way of trying to understand and compare the difficulty of problems

3.1 Learning Goals

  • Describe, design, and implement algorithms using the following paradigms: Divide and Conquer, Dynamic Programming, and Greedy.
  • Prove correctness of algorithms using inductive proofs and exchange arguments.
  • Analyze the runtime of algorithms. Analyze expected runtime of randomized algorithms using linearity of expectation and indicator variables.
  • Describe ethical implications of algorithms.
  • Create reductions from one problem to another and explain why reductions are important.
  • Understand the importance of NP-completeness, and be able to prove a problem is NP-complete.
  • Develop strategies to become a better learner and collaborator

3.2 Learning and Collaborating

The last learning goal of the course has nothing to do with algorithms:

Develop strategies to become a better learner and collaborator.

3.2.1 Learning

Think of something you are good at. How did you get good at it? Did you ever make mistakes? What did you do when you made a mistake?

Because learning is a process, and mistakes are one of the best ways to learn, I give you lots of opportunities to make mistakes:

  • Problem sets are graded on effort, not correctness
  • Quizzes and assessments have unlimited revisions based on feedback and credit/no-credit grading

3.2.2 Group Work

We will do group problem solving in class almost every period. This will help you learn course content

  • by trying to explain your thinking to others
  • by asking questions
  • by making mistakes

It will also help you to learn to be a better team member and to meet lots of other cool CS students! I will always provide the solution in class after you’ve had a chance to work on it in groups.

Group Exercise

In groups we are going to brainstorm ways to manage challenges that arise in group work: