39
Welcome to Computer Science! COSC 1100 Freshman Seminar Fall 2017 Dr. Mircea Agapie Office: SCIENCE 213-C [email protected]

What does this algorithm print?

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: What does this algorithm print?

Welcome to

Computer Science!

COSC 1100 Freshman Seminar Fall 2017

Dr. Mircea Agapie Office: SCIENCE 213-C [email protected]

Page 2: What does this algorithm print?

Downloading documents from the course webpage

COSC 1100 Freshman Seminar Fall 2017

Right-click here and, from the drop-down menu, choose

Save Link As …

Then save on your T drive.

Page 3: What does this algorithm print?

QUIZ

• What is Computer Science?

COSC 1100 Freshman Seminar Fall 2017

• What is an algorithm?

The answers are in yesterday’s slides!

Page 4: What does this algorithm print?

QUIZ

Use numerical algorithms to quickly calculate in your head:

• 35 x 9 35 x 11

• 42 x 5 42 / 5

• 1.7 x 4 1.7 x 16

COSC 1100 Freshman Seminar Fall 2017

Page 5: What does this algorithm print?

QUIZ

Find an algorithm to solve the “heavy-medium-light” problem:

• There are 3 people, whom we shall call “heavy”, “medium”, and “light”, because they weigh 300, 200, and 100 lbs, respectively.

• They need to traverse a river with a boat that can only carry 300 lbs.

• (The boat cannot travel over the river empty.)

COSC 1100 Freshman Seminar Fall 2017

Page 6: What does this algorithm print?

A more difficult “river-crossing” algorithm

Solve the “missionaries and cannibals” problem:

https://en.wikipedia.org/wiki/Missionaries_and_cannibals_problem

COSC 1100 Freshman Seminar Fall 2017

Challenge: Don’t’ just read the solution, try finding it yourself!

Page 7: What does this algorithm print?

Problem from last time:Multiplication by 4

COSC 1100 Freshman Seminar Fall 2017

Build a circuit with one input a, that produces 4∙a at the output.

a 4·aBlack Box

Page 8: What does this algorithm print?

Solution 1

COSC 1100 Freshman Seminar Fall 2017

a 2·a3·a

4·a

Page 9: What does this algorithm print?

Solution 2

COSC 1100 Freshman Seminar Fall 2017

a 2·a

4·a

2·a

Page 10: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

Let’s compare the two implementations …Which one do you think is “better”?

Page 11: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

We just designed and analyzed algorithms!!

Page 12: What does this algorithm print?

Algorithm: Multiplication by 4

COSC 1100 Freshman Seminar Fall 2017

Build the circuit with only two adders!

a 4·aBlack Box

Page 13: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2016

Solution

a 2·a 4·a

Page 14: What does this algorithm print?

Another algorithm:

Adding positive numbers (algorithm ends when the first zero or negative number is encountered).

Do you see how this algorithm is different from all the previous ones?

COSC 1100 Freshman Seminar Fall 2017

Page 15: What does this algorithm print?

Another algorithm:

Adding positive numbers (algorithm ends when the first zero or negative number is encountered).

Do you see how this algorithm is different from all the previous ones?

COSC 1100 Freshman Seminar Fall 2017

A: We don’t know in advance how many steps will be performed!

Page 16: What does this algorithm print?

Adding positive numbers (algorithm ends when the first zero or negative number is encountered).

How would you describe this algorithm?

COSC 1100 Freshman Seminar Fall 2017

Page 17: What does this algorithm print?

Adding positive numbers (algorithm ends when the first zero or negative number is encountered).

How would you describe this algorithm?

COSC 1100 Freshman Seminar Fall 2017

A: There are two main ingredients:• We have to repeat the addition … loop

decision• Unless (or until) some condition becomes true (or false)

Page 18: What does this algorithm print?

OK, so how would we define an algorithm?

Algorithm = Sequence of simple steps, combined with decisions and loops

COSC 1100 Freshman Seminar Fall 2017

Page 19: What does this algorithm print?

Most algorithms are application-specific

• Playing chess• Planning elevator motion• Recognizing objects in digital images• Finding information in databases• Routing packets in the Internet• Moving robotic arms• Driving self-driving cars• Matching DNA sequences• Etc., etc., etc.

COSC 1100 Freshman Seminar Fall 2017

Page 20: What does this algorithm print?

… although there are also may algorithms with wide applicability over multiple domains

• Searching

• Sorting

• Hashing

• Finding shortest paths

• Genetic Algorithms

• Neural Networks

• Etc., etc., etc.

COSC 1100 Freshman Seminar Fall 2017

Page 21: What does this algorithm print?

Break

COSC 1100 Freshman Seminar Fall 2017

Page 22: What does this algorithm print?

Robots!

ABB Fanta challenge:

• http://www.youtube.com/watch?v=PSKdHsqtok0&feature=related

• http://www.youtube.com/watch?v=SOESSCXGhFo&feature=related

BMW i3 factory:

• https://www.youtube.com/watch?v=pa5_tudyAF8

COSC 1100 Freshman Seminar Fall 2017

Page 23: What does this algorithm print?

Robots!

Big Dog: http://www.youtube.com/watch?v=cNZPRsrwumQ

Ping Pong: http://www.youtube.com/watch?v=t_qN3dgYGqE (2011)

https://www.youtube.com/watch?v=2k6Sx3tPUc4 (2014)

Surprise: https://www.youtube.com/watch?v=ub4s984sL0A☺

COSC 1100 Freshman Seminar Fall 2017

Page 24: What does this algorithm print?

Robots at Tarleton:Autonomous and mobile

COSC 1100 Freshman Seminar Fall 2017

Jerry Barnett(graduated in

2014)

Page 25: What does this algorithm print?

Robots at Tarleton

COSC 1100 Freshman Seminar Fall 2017

Robotics Summer Camp for

high-school students (2014)

Page 26: What does this algorithm print?

Robots at Tarleton

COSC 1100 Freshman Seminar Fall 2017

Jaguar 4x4

Amigobot

Scribbler

Page 27: What does this algorithm print?

Robots at Tarleton

COSC 1100 Freshman Seminar Fall 2017

Colby Larue worked on the Jaguar in the Summer of 2015 and presented this poster at the TAMUS student research symposium:

Page 28: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

Page 29: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

Page 30: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

Page 31: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

Page 32: What does this algorithm print?

What Michael Osei did last summer

Michael is a CS sophomore who joined Tarleton in the Spring 2015 semester.

http://healthcare.tarleton.edu/public/

He built this website for the College of Business and Administration (COBA) as a summer project.

COSC 1100 Freshman Seminar Fall 2017

Page 33: What does this algorithm print?

Top 10 Reasons to Major in CS

1. Computing is part of everything we do!

2. Expertise in CS enables us to solve complex,

challenging problems.

3. Computing enables us to make a positive

difference in the world.

4. CS graduates can pursue many types of lucrative

careers.

5. Computing jobs are here to stay, regardless of

where you are located.COSC 1100 Freshman Seminar Fall 2017Source: http://computingcareers.acm.org/

Page 34: What does this algorithm print?

Top 10 Reasons to Major in CS

6. Expertise in CS helps even if our primary career choice is something else.

7. Computing offers great opportunities for creativity and innovation.

8. Computing has space for both collaborative and individual work.

9. CS is an essential part of well-rounded academic preparation.

10. Future opportunities in computing are without boundaries.

COSC 1100 Freshman Seminar Fall 2017Source: http://computingcareers.acm.org/

Page 35: What does this algorithm print?

Mythbusting:

Two misconceptionsabout Computer Science …

COSC 1100 Freshman Seminar Fall 2017

Page 36: What does this algorithm print?

Salaries for CS professionals fall as companies turn to cheaper labor

overseasThe truth:

• Offshoring does not halt the growth of CS jobs in the US because companies seek to maximize return rather than to minimize cost.

• CS developers generate far more value for their companies than they cost, even at the high salaries that such positions command in the US.

Check out the Bureau of Labor Statistics:http://www.bls.gov/ooh/computer-and-information-technology/home.htm

COSC 1100 Freshman Seminar Fall 2017

Page 37: What does this algorithm print?

COSC 1100 Freshman Seminar Fall 2017

Page 38: What does this algorithm print?

CS jobs are solitary and boring

The truth:

• Computing professionals hardly ever work alone. Today, building any computer system (robots, databases, networks, etc.) requires the coordinated efforts of many people with a wide variety of skills.

• Designing a successful product requires effective communication not only among the members of the development team but also with the users. Employers routinely cite good communication skills as an essential requirement for success in the field.

• CS is also a highly creative activity. There is very little that is mechanical about software development—if there were, those aspects would have been automated long ago.

COSC 1100 Freshman Seminar Fall 2017

Page 39: What does this algorithm print?

Where to now?

COSC 1100 Freshman Seminar Fall 2017

See you Monday at noon!