CS139 – Algorithm Development Aug 23, 2004 WELCOME!

12
CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Transcript of CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Page 1: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

CS139 – Algorithm Development

Aug 23, 2004

WELCOME!

Page 2: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

In Class Exercise

Take out a clean blank 8 ½ by 11 inch piece of paper.

In the top right hand corner of the paper, write your name and your section (lab meets at 9:30 – 1, 11:00 – 2, 12:30 - 3).

Page 3: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

On the paper, write the following numbers.

12 17 20 18

Page 4: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Now, average the four numbers

Page 5: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Result should be 16.75

Let’s do a second one.

Write down the following numbers:

13 15 20

Page 6: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Now average the three numbers.

Page 7: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

The result should be 16.

Page 8: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Next, work with a group

Get into groups of 3 or 4 people.Put your group member’s names below

your name on the page.The person with the last name closer to

the end of the alphabet will be the recorder for this exercise. All answers will go on her/his paper.

Page 9: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

Final Exercise

Write down, in detail, the steps that you went through to compute the averages.

Note that in one case we had 4 numbers, in the other 3. Make sure that your steps include the possibility for n numbers where n is the count of the numbers to average.

You should have no more than 3 or 4 steps.

Page 10: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

What did you come up with?

Have the person whose first name is closest to the letter “M” (blank follows) be the reporter for this exercise.

Have the reporter write the directions for your group up on the whiteboard.

Page 11: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

What did we just build?

Algorithm – An unambiguous (and precise) set of steps for solving a problem (or sub-problem) in a finite amount of time using a finite amount of data. (Dale and Lewis definition).

Algorithm – A step by step process for solving a problem. (Lewis and Loftus definition).

Page 12: CS139 – Algorithm Development Aug 23, 2004 WELCOME!

This course is all about algorithms

We will learn how to think in terms of step by step solutions and implement those solutions on the computer.

We will use the Java programming language for implementation of the algorithms.

Let’s look at the syllabus.