{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L1intro

# L1intro - Introduction to Computing Using Matlab CS1112...

This preview shows pages 1–15. Sign up to view the full content.

Introduction to Computing Using Matlab CS1112 Fall 2009 (CIS1121) Professors C. Van Loan & D. Fan http://www.cs.cornell.edu/courses/cs1112/

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009 Lecture 1 2 Today’s lecture An illuminating problem CS1112 philosophies & syllabus What is computer programming? Choosing between CS111 2 & CS111 0 Course logistics/policies (highlights)
August 27, 2009 Lecture 1 3 An illuminating problem: computing square roots Suppose A > 0 Observation: If A is the area of a square, then I can just measure the side length—that is Idea: Make a square with area A Real task: Make a sequence of increasingly square rectangles, each with area A A

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009 Lecture 1 4 How to make a rectangle “more square”? If a square and a rectangle both have area A then is between the length and width of the rectangle A
A/L Recipe: L new = (L + A/L) / 2 Current: Next: L L new A/L new An improvement strategy The average of the length and width.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009 Lecture 1 6 A Matlab program to make “increasingly square” rectangles % The first rectangle... L1 = A; W1 = 1; % The second rectangle... L2 = (L1+W1)/2; W2 = A/L2; % The third rectangle... L3 = (L2+W2)/2; W3 = A/L3; % and so on...
The progression of rectangles Length Width 9.000000000000000 1.000000000000000 5.000000000000000 1.800000000000000 3.400000000000000 2.647058823529412 3.023529411764706 2.976653696498055 3.000091554131380 2.999908448662588 3.000000001396984 2.999999998603016

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009 Lecture 1 8 Some conclusions from square root finding problem It paid to have a geometric sense A complicated computation was reduced to a sequence of elementary calculations A program is like a formula (or sequence of formulas)
August 27, 2009 Lecture 1 9 Course Goals Develop your “ computational senses ,” senses that you need in computer problem-solving Develop a facility with the Matlab programming environment

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009 Lecture 1 10 A sense of geometry
A sense of complexity What is the best itinerary to visit Boston, Miami, LA, Dallas ? 3! = 6 possibilities Add Seattle, NYC Austin, Denver 7! = 5040 If a computer can process 1 billion itineraries a second, how long does it take to solve a 100-city problem?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009 Lecture 1 13 A sense of randomness and probability Random walk Brownian motion in water
August 27, 2009 Lecture 1 14 A sense of approximation & error 1/3 = .33333…

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
August 27, 2009
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern