Vectors - Computer Sciences - Lecture Slides, Slides of Operating Systems

These lecture slides are very easy to understand the computer operating system.The major points in these lecture slides are:Vectors, Common Variant, Important, Row, Never Swap, Interchange, Gaussian, Gaussian Elimination, Gauss-Jordan Elimination, Real Numbers

Typology: Slides

2012/2013

Uploaded on 04/25/2013

baidehi
baidehi 🇮🇳

4.4

(14)

101 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Gauss-Jordan - variants
äFirst: Pivoting can be implemented just like Gaussian
elimination.
Important: Never swap a row with a row above it! (de-
stroys structure) Always swap a row with a row below it
(when interchange is needed).
Common variant: After an elimination step is completed
divide the row by diagonal entry akk (at the end all
diagonal entries are ones) ..
-Redo the previous example with this variant.
-Question: is this more or less costly than original method?
NOTE: unless otherwise specified Gauss-Jordan will be the
standard one (no scaling by diagonal).
37
Linear systems summary of complexity results
äThe number of operations needed to solve a triangular
linear system with nunknowns is
CT(n) = n2
äThe number of operations required to solve a linear
system with nunknowns by Gaussian elimination is
CG(n)2
3n3
äThe number of operations required to solve a linear
system with nunknowns by Gauss-Jordan elimination is
CGJ (n)n3
äNote: remember that Gauss-Jordan costs 50% more
than Gauss.
38
VECTOR EQUATIONS [PARTS OF 1.3]
Vectors and the set Rn
äAvector of dimension nis an ordered list of nnumbers
Example:
v=
1
2
1
;w="0
1#;z=
0
1
1
4
.
ävis in R3,wis in R2and zis in R?
äIn R3the Rstands for the set of real numbers that appear
as entries in the vector, and the exponents 3, indicate that
each vector contains 3 entries.
äA vector can be viewed just as a matrix of dimension
m×1
C-2
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Vectors - Computer Sciences - Lecture Slides and more Slides Operating Systems in PDF only on Docsity!

Gauss-Jordan - variants

ä First: Pivoting can be implemented just like Gaussian elimination.

Important: Never swap a row with a row above it! (de- stroys structure) Always swap a row with a row below it (when interchange is needed).

Common variant: After an elimination step is completed divide the row by diagonal entry akk (→ at the end all diagonal entries are ones) ..

  • Redo the previous example with this variant.
  • Question: is this more or less costly than original method?

NOTE: unless otherwise specified Gauss-Jordan will be the standard one (no scaling by diagonal). 37

Linear systems – summary of complexity results

ä The number of operations needed to solve a triangular linear system with n unknowns is CT (n) = n^2

ä The number of operations required to solve a linear system with n unknowns by Gaussian elimination is CG(n) ≈ 23 n^3

ä The number of operations required to solve a linear system with n unknowns by Gauss-Jordan elimination is CGJ (n) ≈ n^3

ä Note: remember that Gauss-Jordan costs 50% more than Gauss.

38

VECTOR EQUATIONS [PARTS OF 1.3]

Vectors and the set Rn

ä A vector of dimension n is an ordered list of n numbers Example:

v =

 ;^ w^ =

[

]

; z =

ä v is in R^3 , w is in R^2 and z is in R? ä In R^3 the R stands for the set of real numbers that appear as entries in the vector, and the exponents 3, indicate that each vector contains 3 entries. ä A vector can be viewed just as a matrix of dimension m × 1

C-2 Docsity.com

ä Rn^ is the set of all vectors of dimension n. We will see later that this is a vector space, i.e., a set that has some special properties with respect to operations on vectors.

ä Two vectors in Rn^ are equal if and only if their corre- sponding entries are equal.

[Note: what does if and only if mean? – find out]

ä Given two vectors u and v in Rn^ , their sum is the vector u + v obtained by adding corresponding entries of u and v

ä Given a vector u and a real number α, the scalar multiple of u by α is the vector αu obtained by multiplying each entry in u by α

ä Let us look at this in detail

C-

Sum of two vectors ä (!) Note: the two vectors must be of the same dimen- sion

x =

x 1 x 2 x 3

 ;^ y^ =

y 1 y 2 y 3

 ;^ →^ x^ +^ y^ =

x 1 + y 1 y 2 + x 2 x 3 + y 3

with numbers:

x =

 ;^ y^ =

 ;^ →^ x^ +^ y^ =

C-

Multiplication by a scalar

ä Given: a number α (a ’scalar’) and a vector x:

α ∈ R, x ∈ R^3 , → αx =

αx 1 αx 2 αx 3

with numbers:

α = 4; x =

 →^ αx^ =

In the text vectors are represented by bold characters and scalars by light characters. We will often use Greek letters for scalars and regular latin symbols for vectors

Properties of + and α∗

ä The vector whose entries are all zero is called the zero vector and is denoted by 0.

  • (a) x + y = y + x (Addition is commutative)
  • (b) x + (y + z) = (x + y) + z (Addition is associative)
  • (c) 0 + x = x + 0 = x, ( 0 is the vector of all zeros)
  • (d) x + (−x) = −x + x = 0 (−x is the vector (−1)x)
  • (e) α(x + y) = αx + αy
  • (f) (α + β)x = αx + βx
  • (g) (αβ)x = α(βx)
  • (h) 1 x = x for any x

Geometric interpretation of addition of 2 vectors

First viewpoint:

Think of moving (“rigidly”) one of the vectors so its origin is at endpoint of the other vector. Then x + y is the vector from origin to the end point of the shifted vector.

y x shifted

origin

y with

x

x+y

C-

Second viewpoint:

x + y correponds to the fourth vertex of the parallelogram whose other three vertices are: O, x, and y

y x y

O

x

x+y

  • Using the first viewpoint, show geometrically how to add the vectors[ 1 1

]

[

]

; and

[

]

C-

Linear combinations

ä Very important concept ..

A linear combination of m vectors is a vector of the form: x = α 1 x 1 + α 2 x 2 + · · · + αmxm where α 1 , α 2 , · · · , αm, are scalars and x 1 , x 2 , · · · , xm, are vectors in Rn.

ä The scalars α 1 , α 2 , · · · , αm are called the weights of the linear combination

ä They can be any real numbers, including zero

Linear combinations

Example: Linear combinations of vectors in R^3 :

u = 2

 ;^ w^ = 2

And we have: u^ =

 ;^ w^ =

Note: for w the second weight is − 1 and the third is +1.

The linear span of a set of vectors

Definition: If v 1 , · · · , vp are in Rn, then the set of all linear combinations of v 1 , · · · , vp is denoted by span{v 1 , · · · , vp} and is called the subset of Rn^ spanned (or generated) by v 1 , · · · , vp. That is, span{v 1 , · · · , vp} is the collection of all vectors that can be written in the form α 1 v 1 + α 2 v 2 + · · · + αpvp with α 1 , α 2 , · · · , αp scalars.

  • What is span{u} in R^2 where u =

[

]

  • What is span{v} in R^2 where v =

[

]

  • What is span{u, v} in R^2 with u, v given above?

C-

  • Does the vector

[

]

belong to this span{u, v}?

  • Same question for the vector

[

]

  • What is span{u, v} in R^3 when:

u =

 ;^ v^ =

  • Do the vectors:

a =

 ;^ b^ =

belong to span{u, v} found in previous quest.?

  • Is span{u, v} the same as span{v, u}?
  • Is span{u, v} the same as span{ 2 u, − 3 v}? C-

Geometric interpretation of span{v}

ä Let v be a nonzero vector inR^3

ä Then span{v} is the set of all scalar multiples of v

ä This is also the set of points on the line in R^3 through v and 0.

(Figure 1.0 from text).

Geometric interpretation of span{u, v}

ä Let u, v be two nonzero vectors in R^3 with v not a multiple of u.

ä Then span{u, v} is the plane in R^3 that contains u, v, and 0. ä In particular, span{u, v} contains the two lines span{u} and span{v} (Figure 1.1 from text).