APR

2015

Primitive Data – 3 Types (Numbers, Strings, Booleans).

No matter how complex a data structure you create, fundementally at there

basis you will find some combination of NUMBERS, STRINGS, and BOOLEANS.

Associated with every primitive value is a type.

Strings: Strings

Numbers: Integers, Floats

Booleans: True, False

Operands and Operators are combined in ...

Read more →
17

MAY

2011

MAY

2011

Instructors: Prof. Eric Grimson, Prof. John Guttag

View the complete course at: http://ocw.mit.edu/6-00F08

License: Creative Commons BY-NC-SA

More information at http://ocw.mit.edu/terms

More courses at http://ocw.mit.edu

Computational Thinking (Write Code)

Understand Code (Read Code)

Map Problems Into Computation (Analysis & Design)

What is Computation? To better answer this question let me first ask you:

Read more →

17

MAY

2011

MAY

2011

View the complete course at: http://ocw.mit.edu/6-00F08

to efficiency

Lesson 6 we discussed lists. Lists are mutable.

**Ivys [ 1 ] = -15 **The object 1 within the

Ivys list is now given a value of -15

**Ivys = [ 'Yale', '-1', 'Princeton' ...**

17

MAY

2011

MAY

2011

Lecture 4: Decomposition and abstraction through functions; introduction to recursion

Instructors: Prof. Eric Grimson, Prof. John Guttag

View the complete course at: http://ocw.mit.edu/6-00F08

In the previous 3 lessons we learned the following in our language:

– Assignment

– Conditionals

– Input/Output

– Looping Constructs (For, While)

**Touring Complete: **The above fundamentals are enough to ...

17

MAY

2011

MAY

2011

Lecture 5: Floating point numbers, successive refinement, finding roots

Instructors: Prof. Eric Grimson, Prof. John Guttag

View the complete course at: http://ocw.mit.edu/6-00F08

Floating point numbers, successive refinement, finding roots

Python has 2 types of numbers:

int (integers – whole numbers)

Arbitrary precision (Long Integer)

The following code displays arbitrary precision:

**a = 2**1000
**Type ...

17

MAY

2011

MAY

2011

View the complete course at: http://ocw.mit.edu/6-00F08

Data |
Operations |
Commands |

Numbers | + – * / | Assignment (Bind a name to a value) |

Strings | input/output (Print) | |

Booleans | and, or | Conditionals (Branches) |

Loop Mechanisms (While) |

**Good Programming Style: **Use comments. Type discipline (check

types of operands to properly apply correct operations). Descriptive use of good

variable names as a way of documenting code. Testing all possible branches

Read more →

13

MAY

2011

MAY

2011

View the complete course at: http://ocw.mit.edu/6-00F08

Bisection methods, Newton/Raphson, introduction to lists

Speed of Convergence

**sqrt(x)
f(guess = guess2 -x
f(guess) = 0**

As discussed in lesson 5, the best method to find the answer for

differentiable functions is the Netwon/Ralphson Method.

**guess i = guess i – f (guess i) / 2 ...**

13

MAY

2011

MAY

2011