Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome COSC 145: Algorithmic Thinking Dr. Donald Simon

Similar presentations


Presentation on theme: "Welcome COSC 145: Algorithmic Thinking Dr. Donald Simon"— Presentation transcript:

1 Welcome COSC 145: Algorithmic Thinking Dr. Donald Simon simon@mathcs.duq.edu simond@duq.edu

2 Algorithms From Wikipedia.org:  Effective method for solving a problem  Expressed as a finite sequence of steps  List of well-defined instructions for completing a task  Describes a computation that proceeds through a well-defined series of successive states  Terminates in a final ending state

3 Enchiladas Preheat oven to 350 ° F. In a heavy saucepan – Heat 2 tablespoons of olive oil. – Saute ½ cup chopped onion 1 minced garlic clove until golden – Add 1 tablespoon chili powder 1 cup tomato puree ½ cup chicken stock

4 Enchiladas (cont'd) – Season with Salt and pepper 1 teaspoon cumin Spread sauce over tortillas Fill centers with equal quantities of Chopped raw onion Chopped mozzarella cheese Roll tortillas Place in ovenproof dish Pour more sauce over tops Sprinkle with chopped mozzarella cheese Heat thoroughly in oven about 15 minutes

5 Shampoo Instructions Apply shampoo to wet hair Lather Rinse Repeat

6 Exercise 1 Computers are very good at following directions to the letter. How are people? Shake hands with everybody in the room and tell them your name. Question 1: How many hands did you shake? Question 2: How many total handshakes were there?

7 Exercise 2 Stand in line by order by height. Question: How did you determine where to stand?

8 Exercise 3 Stand in line by order of birthday. Question: How did you determine where to stand?

9 Exercise 4 Sort one suit of cards into numerical order. Assume that aces are high. Question: Can you systematically describe how you sorted the cards?

10 Exercise 5  Break up into pairs  Person 1 in each pair will have a suit of cards  Person 1 should scramble the cards  Only Person 1 may look at the faces of the cards  Person 2 will lead Person 1 in sorting the cards:  Person 2 may not touch or look at the faces of the cards  Person 2 may ask Person 1 to compare two cards and state which is smaller/larger  Person 2 may ask Person 1 to move a card to a different place

11 Exercise 5 (cont'd) Question: Can Person 1 systematically describe how to sort the cards, i.e., give an algorithm for sorting a suit of cards?


Download ppt "Welcome COSC 145: Algorithmic Thinking Dr. Donald Simon"

Similar presentations


Ads by Google