1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# Lecture 1 - What is computation ?
Computers does 2 things only:
- Calculate
- Remember Calculations
Computational problem solving & Computational complexities
From Ambigous problem statement to computational formulation of a method
Declarative vs Imperative Knowledge
Declarative: Like an axiom - Statement of Facts
Imperative: Like an algorithm - Sequence & Flow control - Computations
John Von Newmann & Alan Turing
Fixed program computer(Arithmetic logic Unit) - 1941 - Atanasoff & Berry
Manchester Mark 1 - University of Manchester
Stored program computer
Interpreter for instrutions - Now computers can program themselves
Flow control, Flowcharts
Programming Langs
Church-Turing Thesis - Defines the concept of Computability - The Nature of Computation
Lambda calculus - Computable and effectivelly calculable
if solvable by algo solvable by turing machine and vice versa
Universality of Computation
Halting problem - if you can prove a program will run forever or not ? no said Turing
Low lvl vs High lvl
Interpreted vs Compiled
Syntax, Static sementics (syntatical validity), Sementics(meaning)
Turing: We can compute anything using 6 primitives
Read, Write, Move Left, Move Right, Scan, Do nothing
Using Tape he showed can compute anything
modern langs evolved from primitives
primitives -> expressions -> values -> meaning
Primitve constructs:
- English: Words
- Prog langs: Numbers, Strings, Simple operators
Static Sementics (Invalidity):
- English: I are hungry
- Prog langs: 3+"hi"
Sementics
- English: more than one meaning
- Prog langs: only one meaning
Everything in Python is an object:
- Scalar(int,float,bool(true/false),None)
- non-scalar(type())
<expr> = <var>
x % y = Remainder when x/y
x ** y = x to power of y
# Lecture 2 - Branching and Iteration
|