Vectors
Stephen Boyd
EE103
Stanford University
September 24, 2015
Outline
Notation
Addition and scalar multiplication
Inner product
Linear and ane functions
Complexity
Notation
2
Vectors
a vector is an ordered list of numbers
written as
1.1
0.0
3.6
7.
Handout #30
April 25, 2011
CS103
Robert Plummer
CS103-Midterm Solutions
1. Propositional Logic (16 points)
Give a formal proof for the following. The conclusion is written at the bottom to give
you room to fill in your steps. Use numbered steps and refer
Handout #29
April 25, 2011
CS103
Robert Plummer
Problem Set #5Due Monday, May 2 in class
1. Consider that following state diagram:
b
b
q0
a
q1
b
q2
a
a
b
q3
q5
a
q4
b
a, b
a
For each of the following, give the sequence of states that the machine goes thro
CS103
HO#28
Finite Automata II
4/22/11
Suppose L = cfw_w cfw_a, b* | no two consecutive characters are the same
Note:
last character a, only b OK
q2
It is important to do the reading in the Sipser text.
a
a
You should try to understand it line by line.
q1
CS103
HO#27
Slides-Trees, Intro to Automata
4/20/11
CS103
Mathematical Foundations of Computing
4/20/11
Graphs
An undirected graph is an ordered pair (V, E) where
(i)
V is a non-empty set of vertices, and
(ii)
E is an edge set consisting of unordered pair
Handout #26
April 19, 2011
CS103
Robert Plummer
CS103 Review Session Solutions
Logic
Give a formal proof for the following. Use numbered steps and refer to those numbers in
the justification you give for each step.
1. x (R(x) S(x)
2. y (S(y) M(y) L(y)
3.
Handout #25
April 19, 2011
CS103
Robert Plummer
CS103 Review Session Problems
Here are the problems from the review sessions on Tuesday. Solutions are also posted on
CourseWork.
Logic
Give a formal proof for the following. Use numbered steps and refer to
CS103
HO#24
Slides-Induction, Trees
CS103
Mathematical Foundations of Computing
4/18/11
Suppose b0, b1, b2,.is the sequence defined as follows:
b0 = 1,
b1 = 2,
b2 = 3,
bj = bj-3 + bj-2 + bj-1 for all integers j 3.
Let Pn be the assertion bn 3n.
Show that
Handout #23
April 18, 2011
CS103
Robert Plummer
Problem Set #4Due Monday, April 25 in class
1. Prove by induction that for any natural number n,
n
(i(i 1)
i 1
n(n 1)(n 2)
3
2. Let x be an integer. Show that for every integer n 2, xn is even if and only
1
Handout #22
April 18, 2011
CS103
Robert Plummer
Problem Set #3 Solutions
1. Suppose A and B are sets. Prove that (A B) - A = B - (A B).
PROOF: We will prove equality by showing that LHS RHS and RHS LHS.
[We'll put some whitespace in the first half of th
Handout #21
April 15, 2011
CS103
Robert Plummer
Problem Set #2Solutions
1. (Exercise 6, p. 72) Use rules of inference to show that the hypotheses If it does not rain or if it is not
foggy, then the sailing race will be held and the lifesaving demonstratio
CS103
HO#31
Slides-NFAs, Regular Expressions
4/25/11
without -transitions.
Theorem 1.39: Every nondeterministic finite automaton has an
equivalent deterministic finite automaton.
Theorem 1.39: Every nondeterministic finite automaton has an
equivalent dete
EE103/CME103: Introduction to Matrix Methods
October 22 2015
S. Boyd
Midterm Exam
This is an in-class 80 minute midterm.
You may not use any books, notes, or computer programs (e.g., Julia). Throughout this exam
we use standard mathematical notation; in p
EE103/CME103: Introduction to Matrix Methods
October 23 2014
S. Boyd
Midterm Exam
This is an in class 75 minute midterm.
You may not use any books, notes, or computer programs (e.g., Julia). Throughout this
exam we use standard mathematical notation; and
Matrix Multiplication
Stephen Boyd
EE103
Stanford University
October 8, 2015
Outline
Matrix multiplication
Composition of linear functions
Matrix powers
QR factorization
Matrix multiplication
2
Matrix multiplication
can multiply m p matrix A and p n matri
Norm and Distance
Stephen Boyd
EE103
Stanford University
September 19, 2015
Outline
Norm and distance
Distance
Angle
Norm and distance
2
Norm
the Euclidean norm (or just norm) of an n-vector x is
x =
x2 + x2 + + x2 =
n
2
1
xT x
used to measure the size of
Clustering
Stephen Boyd
(with thanks to Karanveer Mohan)
EE103
Stanford University
September 29, 2015
Outline
Clustering
Algorithm
Examples
Applications
Clustering
2
Clustering
given N n-vectors x1 , . . . , xN
goal: partition (divide, cluster) into k gro
Matrices
Stephen Boyd
EE103
Stanford University
October 1, 2015
Outline
Matrices
Matrix-vector multiplication
Examples
Matrices
2
Matrices
a matrix is a reactangular array of numbers, e.g.,
0
1 2.3 0.1
1.3 4 0.1 0
4.1 1
0
1.7
its size is given by (row d
Linear Independence
Stephen Boyd
EE103
Stanford University
September 29, 2015
Outline
Linear independence
Basis
Orthonormal vectors
Gram-Schmidt algorithm
Linear independence
2
Linear dependence
set of n-vectors cfw_a1 , . . . , ak (with k 1) is linearly
Linear Equations
Stephen Boyd
EE103
Stanford University
October 7, 2015
Outline
Linear functions
Linear function models
Linear equations
Linear functions
2
Superposition
f : Rn Rm means f is a function that maps n-vectors to
m-vectors
we write f (x) = (f1
Inverses
Stephen Boyd
EE103
Stanford University
October 27, 2015
Outline
Left and right inverses
Inverse
Solving linear equations
Examples
Pseudo-inverse
Left and right inverses
2
Left inverses
a number x that satises xa = 1 is called the inverse of a
inv
Least Squares
Stephen Boyd
EE103
Stanford University
November 4, 2015
Outline
Least squares problem
Solution of least squares problem
Least squares problem
2
Least squares problem
suppose m n matrix A is tall, so Ax = b is over-determined
for most choices
Introduction
Stephen Boyd
EE103
Stanford University
September 17, 2015
Technological developments
data is super plentiful
storage, transmission of data is easy
computers are super fast (and many are super cheap)
high level programming languages make it ea
EE103/CME103: Introduction to Matrix Methods
October 27 2016
S. Boyd
Midterm Exam
This is an in-class 80 minute midterm.
You may not use any books, notes, or computer programs (e.g., Julia). Throughout this exam
we use standard mathematical notation; in p
Handout #20
April 18, 2011
CS103
Robert Plummer
Practice Midterm Solutions
1. Propositional Logic (20 points)
1.
2.
(W P) I
I (C S)
3.
SU
4.
C U
5. U
6. S
7. C
8. C S
9. (C S)
10. I
11. (W P)
12. W P
13. W
Simplification, 4
Modus tollens, 3, 5
Simplificat
Handout #19
April 15, 2011
CS103
Robert Plummer
CS103 Practice Midterm
I acknowledge and accept the Stanford University Honor Code:
Signature: _
NAME (print): _
1) You have 2.0 hours to complete this exam.
2) Do not include your scratch work with your exa
CS103
HO#18
Slides-Induction
The Principle of Mathematical Induction
1
2
3
4
4/15/11
The Principle of Mathematical Induction
5
1
Suppose that:
-We have a numbered collection of dominos
-Each domino is standing
-The first domino is knocked over
-For any po
Handout #4
March 28, 2011
CS103
Robert Plummer
Problem Set #1 - Due Monday, April 4 in class
Here are the homework policies for this class:
1. All assignments are due in class.
2. Be sure to put your name on your paper and staple the pages together.
3. If
CS103
HO#3
Introduction
3/28/11
CS103
CS103
Mathematical Foundations of Computing
Logic
Mathematical Foundations of Computing
Induction
Sets, Relations, and Functions
Robert Plummer
Automata and Formal Languages
Computability Theory
3/28/11
Complexity The
Handout #1
March 28, 2011
CS103
Robert Plummer
CS103 Course InformationSpring 2011
Course Title: Mathematical Foundations of Computing
Units: 5 (graduate students may sign up for fewer units)
Lectures: MWF 2:15 3:30 P.m. in Braun Auditorium (Chemistry Bui