Homework 0

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

ELEC505/ELEC405 Handout #2

Linear System Theory Friday, October 16 , 2020

Homework Set #0
Due: Monday, October 26, 2020.

1. An Application of Matrix Mutlitplication


The graph in Figure below shows the possible connections among the nodes. At each
step you can move from one node to another connected node and you can not remain
in a node if there is no self loop.

According to this graph, for example, one can go from node-1 to node-2 and node-1
to node-4 in one step and node-1 to node-3 in two steps. We define the connectivity
matrix C as follows:

(
1 if you can go from node i to node j in one step
Cij =
0 otherwise

(a) Provide the connectivity matrix C for the figure above.


(b) Find C2 . What does the i, j entry of C2 correspond to?
(c) What does i, j entry of the Ck correspond to where k ≥ 1 is an integer?

2. simple plane geometry ....


We can represent a 2-vector with a point on a plane. (Similarly we can represent a
3-vector with a point in 3 dimensional space). This fact is useful in both directions:
we can convert an algebraic problem involving our vectors into a geometrical problem
or we can convert a geometrical problem into an algebraic problem...

1
2 2

1 1

0 1 0 1

(a) (b)

Figure 1: Graphical Representation of 2-vectors

For example,
" we# can use a point on plane as shown in Figure 1-(a) to represent the 2-
1
vector x = , where the first component of the vector x is the horizontal coordinate
2
and the second component of the vector x is the vertical coordinate of the point.
Alternatively, we can represent the same vector with an arrow as shown in Figure 1-
(b). "The length
# of the arrow is called the norm of the vector. Therefore, for a 2-vector
x1
x= , the length of the arrow, i.e. the norm of the vector, is
x2
q
kxk = x21 + x22
" #
1
(a) What is the norm of the x = vector?
2
(b) The distance between two points on the plane is the norm of the difference of
the 2-vectors corresponding to these points. Therefore, if these two points are
represented with vectors y and z respectively, then the distance between these
two points is given by
dist(y, z) = ky − zk

2
" # " #
4 7
What is the distance between the points a = ,b= ?
−3 −1
(c) The inner product that we defined in class can be used to find the angle between
two vectors!. This is based on the fact that inner product of two 2-vectors can be
written as

hx, yi = xT y = x1 y1 + x2 y2
= kxkkyk cos(θ)

where θ is the angle between the vectors. As a result, given the vectors, the angle
between them can be found using

hx, yi
θ = acos( )
kxkkyk
x1 y 1 + x2 y 2
= acos( q q )
x21 + x22 y12 + y22

0 1 2 3

Figure 2: Inner product example

Given the vectors in Figure 2, find the angle between them.


(d) We define the following matrix
" #
cos(θ) sin(θ)
R(θ) = .
− sin(θ) cos(θ)
" # " #
a1 b1
Given the 2-vectors a = and b = , we have the relation
a2 b2

b = R(θ)a.

Based on this relation, find b1 , b2 in terms of a1 , a2 and θ. What is the norm of


b, i.e., kbk? What is the angle between a and b?
For an example 2-vector a that you pick, find b for θ = π4 and 2π 3
. Draw these
vectors on plane. What is the geometrical meaning of multiplication with R(θ)?

3
3. Hperplane in a 2D-World
" #
1
(a) Given a vector a = define the set A = {x|aT x = 0, x ∈ <2 }. Draw this set
1
on <2 . Please show your vector a as an arrow on the same plot.
" #
2
(b) Given the vector b = define the set B = {x|aT (x − b) = 0, x ∈ <2 }. Draw
1
this set on <2 . Please show your vector a as an arrow placed on b on the same
plot.
(c) For a and b defined in previous parts, we define the set H− = {x|aT (x − b) ≤
0, x ∈ <2 }. Draw H− .
(d) Please write a MATLAB/Python/Julia function drawhyperplane2D(a,b) which
will generate the plot in part b. An example execution result of drawhyperplane2D([-
1;-1],[2,1]) is shown below. (You can choose a reasonable range for x1 ). Use axis
equal command in your code. You area allowed to use line drawing functions
available such as MATLAB command line.

Figure 3: Sample execution drawhyperplane2D([-1;-1],[2,1])

Submit your MATLAB/Python/Julia


" # "code# (with clear comments) and the pdf/png
1 1
of your plot for a = and b = .
−1 2

4. Hperplane in 3D-World
As a change to part b of previous problem, we define the hyperplane in 3-dimensions as,
B = {x|aT (x − b) = 0, x ∈ <3 }, for a given normal vector a and shift vector b. Write
a matlab function drawhyperplane3D to display such an hyperplane together with its
normal vector similar to the figure shown below. Illustrate your code execution by

4
h i h i
providing the plot for a = 2; −1; 2 and b = 1; 2; 1 . Please use an appropriate
view angle (by view). Please provide your code (with comments).

Figure 4: Sample execution drawhyperplane3D([1;1;1],[2;1;0])

5. A Reminder on Solving Linear Systems of Equations


Given Ax = b, provide solutions for the following A, b pairs

(a)
   
2 13 5 6 16
A =  0.5 3.25 5.25 2.5  , b =  7 
   

1.0 10.5 −0.5 9 3

(b)
   
2 13 5 6 16
A =  0.5 3.25 1.25 1.5  , b =  7 
   

1.0 10.5 −0.5 9 3

6. Convolution Operator and Corresponding Matrices...


Suppose {xk ; k ∈ Z} and {yk ; k ∈ Z} are the input and the corresponding output
sequences respectively of a causal linear time invariant system with impulse response
{hk ; k ∈ Z+ }, such that,

X
yk = hi xk−i k ∈ Z.
i=0

5
(a) Suppose that xk is a causal sequence, i.e.,

xk = 0 for k < 0.

We define the vectors,


   
x(0) y(0)

 x(1) 


 y(1) 

x=  .. , y=  .. 
. .
   
   
x(N ) y(N )

Find the matrix, T such that y = Tx. The matrix T describes a mapping from
a chunk of input samples to to a chunk of output samples and it is a Toeplitz
matrix.
(b) Suppose that xk is a sequence, such that

xk = 0 for k > 0and for k < −N.

We define the vectors,


   
x(0) y(0)

 x(−1) 


 y(1) 

x=  .. , y=  ..  (1)
. .
   
   
x(−N ) y(N )

Find the matrix, H such that y = Hx. The matrix H describes a mapping from
a chunk of past input samples to to a chunk of output samples and it is a Hankel
matrix.

You might also like