L1intro - Introduction to Computing Using Matlab CS1112...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computing Using Matlab CS1112 Fall 2011 (CIS1121) Dr. K.-Y. Daisy Fan http://www.cs.cornell.edu/courses/cs1112/
Background image of page 1

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

View Full DocumentRight Arrow Icon
Lecture 1 3 Today’s lecture ± An illuminating problem ± ± What is computer programming? ± Choosing between CS111 2 & CS111 0 ± Course logistics/policies (highlights)
Background image of page 2
Lecture 1 5 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
Lecture 1 6 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
Background image of page 4
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.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Lecture 1 8 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. ..
Background image of page 6
The progression of rectangles with area 10 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
Background image of page 7

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

View Full DocumentRight Arrow Icon
Lecture 1 10 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)
Background image of page 8
Lecture 1 11 Course Goals ± Develop your “ computational senses ,” senses that you need in computer problem-solving ± Develop a facility with the Matlab programming environment
Background image of page 9

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

View Full DocumentRight Arrow Icon
Lecture 1 12 A sense of geometry
Background image of page 10
Lecture 1 13 A sense of complexity What is the best itinerary to visit Boston, Miami, LA, Dallas ? 3! = 6 possibilities
Background image of page 11

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

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/05/2011 for the course CS 101 at Cornell University (Engineering School).

Page1 / 35

L1intro - Introduction to Computing Using Matlab CS1112...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online