Name:

Follow the prompts and complete the questions on this document.  Be sure to do all 5 parts.

Part 1

What makes two pieces of code “the same”?

If they're copied word by word or if they accomplish the same task. They can also have the same output.

Could there ever be two pieces of code that you consider to be “the same” even if they aren’t identical?

Yes, two pieces of code could output the same answer but in a different way.

Go around the room and write down your answers to these problems (Complete for both partners):

Problems

  1. Find a person whose birthday is before yours

  1. Find a person whose birthday is after yours

Eric Kontos birthday is after mine

  1. Find the person whose birthday is the closest before yours
  2. Mia Pearlman's birthday is before mine
  3. Find the person whose birthday is the closest after yours
  4. Mia Perez's birthday is after mine
  5. Find the person whose birthday is closest to yours

Aidens bday is in the middle of mine and Mias

  1. Find the person with an equal number of birthdays before and after theirs
  2. Find the two people with the closest birthdays in the room

Nov 1 and 2 or Feb 14 and Feb 15

  1. Find the shortest period of time in which three people have birthdays

Nov 1st Julia and Dylan and Nov 2nd Billy

  1. Find the shortest period of time in which four people have birthdays

  1. Find the longest period of time in which no one has a birthday


Part 3

Which problems in Part 2 do you need to do something similar in order to solve them?

Mostly all of them, we needed to compare and contrast everyone's birthday in order to solve them.

Part 4

Decide which of these programs are “the same” as one another.
Be sure to check out Algorithm 6 on the next page

3,4 are the same!


Part 5

Problem: a general description of a task that can (or cannot) be solved with an algorithm

Algorithm: a finite set of instructions that accomplish a task.  

There are usually many algorithms to solve the same problem, and many ways to write or express one algorithm including natural language, psuedocode, diagrams, and are implemented using programming code. All algorithms can be created by combining steps in three different ways.

How did today’s activities change the way you think about algorithms and problems?