Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
19 views

Tutorial 5 Solution

Uploaded by

26YiJie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Tutorial 5 Solution

Uploaded by

26YiJie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

NATIONAL UNIVERSITY OF SINGAPORE

Department of Mathematics

MA1522 Linear Algebra for Computing Tutorial 5

1. For each of the following sets of vectors S,

(i) Determine if S is linearly independent.


(ii) If S is linearly dependent, express one of the vectors in S as a linear combination
of the others.
        
 2 0 2 3 
(a) S =  −1 , 3 , 4 , 6 .
     
0 2 3 6
 

Solution: The set S is linearly dependent since it contains 4 vectors from R3 .

0 29
   
2 0 2 3 1 0
−1 3 4 6 −→ 0 1 0 152
.
0 2 3 6 0 0 1 −3

Thus        
3 2 0 2
6 = 9 −1 + 15 3 − 3 4 .
2 2
6 0 2 3
    
 1 3 
(b) S = 1 , 4 .
0 2
 

Solution: The set S is linearly independent since S has only two vectors which
are not multiples of each other.
     
 1 3 0 
(c) S = 1 , 4 , 0 .
0 2 0
 

Solution: Any set containing the zero vector is linearly dependent. Indeed we
have      
0 1 3
0 = 0 1 + 0 4 .
0 0 2
      
 1 0 1 
(d) S = 0 , 1 ,  2  .
0 1 −1
 
       
1 0 1 0
Solution: Solving a 0 + b 1 + c  2  = 0,
0 1 −1 0
   
1 0 1 0 1 0 0 0
 0 1 2 0  −→  0 1 0 0  .
0 1 −1 0 0 0 1 0
       
1 0 1 0
So a 0 + b 1 + c  2  = 0 has only the trivial solution and S is a
0 1 −1 0
linearly independent set.

2. Suppose u, v, w are linearly independent vectors in Rn . Determine which of the sets S1


to S5 are linearly independent.

(a) S1 = {u, v},

Solution: Any subset of a linearly independent set is linearly independent. Indeed


we have
au + bv = 0 ⇔ au + bv + 0w = 0.

(b) S2 = {u − v, v − w, w − u},

Solution: Observe that (u − v) + (v − w) + (w − u) = 0. So, S2 is linearly de-


pendent.

(c) S3 = {u − v, v − w, u + w},

Solution: We have

a(u − v) + b(v − w) + c(w + u) = 0 ⇔ (a + c)u + (−a + b)v + (−b + c)w = 0.

Since u, v, w are linearly independent, we have



 a + c = 0
−a + b = 0
− b + c = 0

The system has only the trivial solution a = 0, b = 0, c = 0. Thus S3 is linearly


independent.

(d) S4 = {u, u + v, u + v + w}.

Solution: We have

au + b(u + v) + c(u + v + w) = 0 ⇔ (a + b + c)u + (b + c)v + cw = 0.


Since u, v, w are linearly independent, we have a+b+c = b+c = c = 0. Solving for
a, b, c gives the trivial solution a = 0, b = 0, c = 0. Thus S4 is linearly independent.

(e) S5 = {u + v, v + w, u + w, u + v + w}.

Solution: We have

(u + v) + (v + w) + (u + w) − 2(u + v + w) = 0.

So, S5 is linearly dependent.

3. For each of the following subspaces V , write down a basis for V .


   

 a + b 

  a + c 
(a) V = c + d a, b, c, d ∈ R .
 

 
b+d
 

Solution:
   

 a+b 

a + c
   
V =  a, b, c, d ∈ R 
 
 c+d
 

b+d
 
         

 1 1 0 0 

1 0 1 0
   
= 0 + b 0 + c 1 + d 1 a, b, c, d ∈ R
a       

 

0 1 0 1
 
       

 1 1 0 0 
       
1 0 1 0

= span   ,   ,   ,   .


 0 0 1 1 

0 1 0 1
 

   
1 1 0 0 0 1 0 0 −1 0
 1 0 1 0 0   0 1 0 1 0 
  −→  .
 0 0 1 1 0   0 0 1 1 0 
0 1 0 1 0 0 0 0 0 0
This means that the fourth vector is redundant. Notice that the last vector linearly
depend on the first 3. After throwing this vector out, one can check that
     

 1 1 0 
     
  ,   , 1
1 0

 0 0 1
 
0 1 0
 

is a basis for V .
        
 1 −1 0 1 
(b) V = span  0 , 2 , 3 , −1 .
     
−1 3 0 1
 

Solution: Since the set


contains
  4 vectors
   R3 , it cannot be linearly independent.
in
 1 −1 0 
One can check that  0  ,  2  , 3 is linearly independent. Hence it is
−1 3 0
 
a basis for V = R3 .
(c) V is the solution space of the following homogeneous linear system

 a1 + a3 + a4 − a5 = 0
a2 + a3 + 2a4 + a5 = 0
a1 + a2 + 2a3 + a4 − 2a5 = 0

Solution: Solving the homogeneous system:


   
1 0 1 1 −1 0 1 0 1 0 −2 0
 0 1 1 2 1 0  −→  0 1 1 0 −1 0 
1 1 2 1 −2 0 0 0 0 1 1 0

Thus the solution set is


     

 −1 2 



 −1 1 


   
V = s  1  + t  0  s, t ∈ R .
   


 0 −1 


 
0 1
 

    

 −1 2 
−1  1 

    


It is easy to see that  1  ,  0  is linearly independent, and is thus a basis
  
0  −1

 

 

0 1
 
for V .
     
a −1 1
4. For what values of a will u1 =  1  , u2 =  a  , u3 = −1 form a basis for R3 ?
−1 1 a
Solution:
   
a −1 1 0 1 a −1 0 R2 − aR1
R ↔ R2 
 1 a −1 0  1 a −1 1 0  −→
−→
−1 1 a 0 −1 1 a 0 R3 + R1
   
1 a −1 0 1 a −1 0 1+a
 0 −1 − a2 1 + a 0  −R2  0 1 + a2 −1 − a 0  R3 − 1+a2 R2
−→ −→
0 1+a a−1 0 0 1+a a−1 0
−1
 
1 a 0
 0 1 + a2 −1 − a 0 
a(a2 +3)
0 0 1+a2
0
So u1 , u2 , u3 will form a basis for R3 if and only if a ̸= 0.
 
a −1 1
Alternatively, the determinant of  1 a −1 is a(a2 + 3), which is 0 if and only if
−1 1 a
a = 0.

5. Let U and V be subspaces of Rn . We define the sum U + V to be the set of vectors


{ u + v u ∈ U and v ∈ V }.
         

 1 1   1 1 
     
    
1 2 0
 ,   , V = span   ,  0  .
 
Suppose U = span  1 2 1  2 

  
 
1 1 0 −1
   
       
1 1 1 1
1 2 0 0
Solution: Let u1 = 
1, u2 = 2, v1 = 1, and v2 =  2 .
      

1 1 0 −1

(a) Is U ∪ V a subspace of R4 ?
Solution: No. We will show that it is not closed under linear combinations. We
have u1 ∈ U ∪ V and v1 ∈ U ∪ V . The sum is
     
1 1 2
1 0 1
u1 + v1 = 
1 + 1 = 2 .
    

1 0 1
We will check that this is neither in U nor in V , and thus it cannot be in the union
U ∪V.    
1 1 2 1 0 0
 1 2 1   0 1 0 
 1 2 2  −→  0 0 1 
   

1 1 1 0 0 0
shows that u1 + v1 ̸∈ U , and
   
1 1 2 1 0 0
 0 0 1 
 −→  0 1 0 
 

 1 2 2   0 0 1 
0 1 1 0 0 0
shows that u1 + v1 ̸∈ V . So u1 + v1 ̸∈ U ∪ V .
(b) Show that U + V a subspace by showing that it can be written as a span of a set.
What is the dimension?
Solution: A vector is in U if and only if it can be written as α1 u1 + α2 u2 , and
a vector is in V if and only if it can be written as β1 v1 + β2 v2 . So a vector in
U + V if and only if it has the form α1 u1 + α2 u2 + β1 v1 + β2 v2 . This shows that
U + V = span{u1 , u2 , v1 , v2 }, and hence, U + V is a subspace.

We will also give a general proof that for any subspaces U and V , U + V is a
subspace. Indeed clearly 0 ∈ U + V . Suppose now w1 , w2 ∈ U + V . Then by
definition of U + V , we can find u1 , u2 ∈ U and v1 , v2 ∈ V such that w1 = u1 + v1
and w2 = u2 + v2 . Then for any α, β ∈ R,

αw1 + βw2 = α(u1 + v1 ) + β(u2 + v2 ) = (αu1 + βu2 ) + (αv1 + βv2 ).

Since U and V are subspaces, (αu1 + βu2 ) ∈ U and (αv1 + βv2 ) ∈ V . So αw1 +
βw2 ∈ U + V .
In general, if U = span{u1 , ..., uk } and V = span{v1 , ..., vl }, then U + V =
span{u1 , ..., uk , v1 , ..., vl }.

Since {u1 , u2 , v1 , v2 } is a spanning set, it suffices to find a linearly independent


subset of it to form a basis.
   
1 1 1 1 1 0 0 −2
1 2 0 0  0 1 0 1
1 2 1 2  −→ 0 0
   .
1 2
1 1 0 −1 0 0 0 0

This shows that {u1 , u2 , v1 } is a basis for U + V , and hence dim(U + V ) = 3.

(c) Show that U +V contains U and V . This shows that U +V is a subspace containing
U ∪V.
Solution: This is clear from (a) since span{u1 , u2 } and span{v1 , v2 } are subsets
of span{u1 , u2 , v1 , v2 }. In fact, U + V is the smallest subspace that contains U ∪ V .

(d) What are the dimensions of U and V ?


Solution:    
1 1 1 0
1 2 0 1
  −→  .
1 2 0 0
1 1 0 0
Hence, dim(U ) = 2.    
1 1 1 0
0 0  0 1
1 2  −→ 0
   .
0
0 −1 0 0
Hence, dim(V ) = 2.

(e) Show that U ∩ V a subspace by showing that it can be written as a span of a set.
What is the dimension?

Solution: A vector in w ∈ U ∩V must be able to be written as a linear combination


of u1 , u2 , and as a linear combination of v1 and v2 . In other words, we must be
able to find α1 , α2 , β1 , β2 ∈ R such that
       
1 1 1 1
1 2 0 0
w = α1  1 + α2 2 = β1 1 + β2  2  ,
      

1 1 0 −1

in other words, we are solving the homogeneous linear system


         
1 1 1 1 0
1 2 0  0  0
1 + α2 2 − β1 1 − β2  2  = 0 .
α1          

1 1 0 −1 0
   
1 1 −1 −1 0 1 0 0 2 0
 1
 2 0 0 0   0 1
 −→  0 −1 0 

 1 2 −1 −2 0   0 0 1 2 0 
1 1 0 1 0 0 0 0 0 0
So for any choice of s ∈ R, α1 = −2s and α2 = s, or β1 = −2s and β2 = s will work,
that is, w = −s(2u1 − u2 ) = −s(2v1 − v2 ). Hence, U ∩ V = span{2u1 − u2 } =
span{2v1 − v2 }, and this shows that U ∩ V is a subspace, with dim(U ∩ V ) = 1.

In fact, we can show in general that for any subspaces U and V in Rn , U ∩ V


is a subspace of Rn . Indeed clearly 0 ∈ U ∩ V , so it is nonempty. Suppose now
w1 , w2 ∈ U ∩ V and α, β ∈ R. Then since U and V are subspace, αw1 + βw2
belongs to U and V . Hence, it is in the intersection, αw1 + βw2 ∈ U ∩ V .

(f) Verify that dim(U + V ) = dim(U ) + dim(V ) − dim(U ∩ V ).

Solution: Indeed, 3 = 2 + 2 − 1.
Extra problems
1. Let u1 , u2 , ..., uk be vectors in Rn and P a square matrix of order n.

(a) Show that if Pu1 , Pu2 , ..., Puk are linearly independent, then u1 , u2 , ..., uk are
linearly independent.

Solution: Note that

c1 u1 + c2 u2 + · · · + ck uk = 0
⇒ P(c1 u1 + c2 u2 + · · · + ck uk ) = P0
⇒ c1 Pu1 + c2 Pu2 + · · · + ck Puk = 0.

Since Pu1 , Pu2 , ..., Puk are linearly independent, we conclude that c1 = c2 = · · · =
ck = 0. Thus, u1 , u2 , ..., uk are linearly independent.

(b) Suppose u1 , u2 , ..., uk are linearly independent.


(i) Show that if P is invertible, then Pu1 , Pu2 , ..., Puk are linearly independent.
Solution: Note that

c1 Pu1 + c2 Pu2 + · · · + ck Puk = 0


⇒ P(c1 u1 + c2 u2 + · · · + ck uk ) = 0
⇒ c1 u1 + c2 u2 + · · · + ck uk = 0

where the last implication follows from the fact that P is invertible. Since
u1 , u2 , ..., uk are linearly independent, we conclude that c1 = c2 = · · · = ck = 0.
Thus, Pu1 , Pu2 , ..., Puk are linearly independent.
(ii) If P is not invertible, are Pu1 , Pu2 , ..., Puk are linearly independent?
   
1 0
Solution: No conclusion. For example, let u1 = 0 and u2 = 1. It is
0 0
clear that
 1u and
2u are linearly independent.
1 0 0
If P = 0 1 0, then Pu1 = u1 and Pu2 = u2 are linearly independent.
0 0 0  
0
If P = 03×3 , then Pu1 = Pu2 = 0 are linearly dependent.
0

2. Prove the theorem that V ⊆ Rn is a subspace if and only if V = span{u1 , ..., uk } for
some ui ∈ Rn , i = 1, ..., k.
Solution:

(⇐) A spanning set contains the origin and is closed under linear combination.

(⇒) Suppose V = {0}. Then V = span{0}. Hence, we may assume V ̸= {0}. Since
V is a non-trivial subspace, we may pick a nonzero vector u1 ̸= 0 in V . If V =
span{u1 }, we are done. Otherwise, pick a u2 ∈ V \ span{u1 }. Now {u1 , u2 } is
necessarily linearly independent since u2 ̸∈ span{u1 }. Suppose the vectors u1 , ..., ui
has been chosen such that they are linearly independent. If span{u1 , ..., ui } =
V , we are done. Otherwise, pick a ui+1 ∈ V \ span{u1 , ..., ui }. We claim that
u1 , ..., ui , ui+1 are linearly independent. Suppose

c1 u1 + · · · + ci ui + ci+1 ui+1 = 0.

If ci+1 ̸= 0, then
−c1 −ci
u1 + · · · + ui = ui+1 ,
ci+1 ci+1
a contradiction to ui+1 ∈ V \ span{u1 , ..., ui }. This mean that

c1 u1 + · · · + ci ui = 0,

which shows that c1 = · · · = ci = 0 too since u1 , ..., ui are linearly independent.


This proves the claim. The process must stop since there can be at most n linearly
independent vectors in Rn . Hence there must be a k such that span{u1 , ..., uk } =
V.

Remark. The proof of (⇒) yields a useful result for a subspace V of Rn . Let S =
{u1 , ..., uk } be a set of linearly independent vectors in V . If S is not a basis of V , then
we could add vectors into the set S so that

{u1 , ..., uk , uk+1 , ..., ul }

is a basis of V .

3. (a) Let U and V be subspaces of Rn . Prove that U ∪ V is a subspace if and only if


U ⊆ V or V ⊆ U .

Solution:

(⇐) Suppose U ⊆ V . Then U ∪ V = V is a subspace. The prove for V ⊆ U is


analogous.

(⇒) Suppose U ⊈ V nor V ⊈ U . We will show that U ∪ V is not a subspace. Since


U ⊈ V , find a u ∈ U \V . Similarly, we can find a v ∈ V \U . It is clear that
u, v ∈ U ∪ V . We claim that u + v ̸∈ U ∪ V . For otherwise, then it must be
either u + v ∈ U or u + v ∈ V . Suppose u + v ∈ U , then since U is closed
under linear combination,

v = u − (u + v) ∈ U, a contradiction to the choice of v.

Similarly, if u + v ∈ V , then

u = v − (u + v) ∈ V, a contradiction to the choice of u.

Hence u + v ̸∈ U ∪ V , which shows that U ∪ V cannot be a subspace.

(b) Let U and V be subspaces of Rn . Show that dim(U + V ) = dim(U ) + dim(V ) −


dim(U ∩ V ).
Solution: Note that in the remark to Question 2, we have shown that given a
linearly independent subset {u1 , ..., ui } of a subspace V , we can always extend the
set into a basis {u1 , ..., ui , ..., uk } for V .

Let {w1 , ..., wr } be a basis for U ∩ V . Then dim(U ∩ V ) = r. Note that {w1 , ..., wr }
is a linearly independent subset of U . Thus we may extend it to be a basis
{w1 , ..., wr , u1 , ..., uk } of U . Then dim(U ) = r + k. Similarly, {w1 , ..., wr } is a lin-
early independent subset of V . So, we may extend it to be a basis {w1 , ..., wr , v1 , ..., vl }
of V . Then dim(V ) = r + l. From question 5b, we have
U + V = span{w1 , ..., wr , u1 , ..., uk , v1 , ..., vl }.
We claim that {w1 , ..., wr , u1 , ..., uk , v1 , ..., vl } is linearly independent. Suppose
a1 w1 + · · · + ar wr + b1 u1 + · · · + bk uk + c1 v1 + · · · + cl vl = 0. (1)
This is equivalent to
a1 w1 + · · · + ar wr + b1 u1 + · · · + bk uk = −(c1 v1 + · · · + cl vl ).
The left hand side of the equation is a vector in U and the right side is a vector in
V , and hence, c1 v1 + · · · + cl vl ∈ U ∩ V . Hence, there exists d1 , ..., dr such that
c1 v1 + · · · + cl vl = d1 w1 + · · · + dr wr
which is equivalent to
c1 v1 + · · · + cl vl − d1 w1 − · · · − dr wr = 0.
Since {w1 , ..., wr , v1 , ..., vl } is a basis of V , in particular, it is independent, we have
c1 = · · · = cl = 0 = d1 = · · · = dr . Furthermore,
a1 w1 + · · · + ar wr + b1 u1 + · · · + bk uk = −(c1 v1 + · · · + cl vl ) = 0.
Finally, since {w1 , ..., wr , u1 , ..., uk } is a basis for U , we can conclude that a1 =
· · · = ar = 0 = b1 = · · · = bk . This shows that equation 1 has only the trivial
solution, and hence {w1 , ..., wr , u1 , ..., uk , v1 , ..., vl } is independent. Therefore
dim(U + V ) = r + k + l = (r + k) + (r + l) − r = dim(U ) + dim(V ) − dim(U ∩ V ).
4. (MATLAB) In the last tutorial, we introduced the “binary n-space” Bn , which is
governed by the special addition rule: 1+1 = 0. Our goal in this problem is to investigate
how working with binary vectors can help us detect and correct errors in information
transmission.
When a computer transmits a piece of information (a binary string) to another device,
there is always a possibility of an error—that is, the receiving device might receive an
incorrect binary string, perhaps due to external interference or noise in the communica-
tion channel. One way that a computer might “protect” its message is by adding extra
information to the binary string so that the receiving device can detect—and ideally,
correct—any errors that may have occured in transmission.
Consider the following scenario: your friend Annette wants to send you a message u.
For the sake of simplicity, let’s assume that Annette’s message contains four bits—that
is, u is a vector in B4 (as opposed to a standard byte, which is a vector in B8 ). Annette,
however, is afraid that a transmission error might send you the wrong message—say, by
accidentally changing a 1 to a 0, or a 0 to a 1.

1. Rather than just sending you the message u, Annette instead sends you the 8-vector
that results when each bit in u is repeated twice. You receive the vector

0 0 1 1 0 0 0 1 ,

where divider bars have been used to split the string up into segments, each repre-
senting one bit in Annette’s original message. Do you have enough information to
decode Annette’s original message?

Solution: We can detect that an error was made in transmitting the fourth bit of
Annette’s original message. However, we do not have information to recover actual
message—it could easily be either ( 0 1 0 0 ) or ( 0 1 0 1 ).

As the above situation suggests, a simple—perhaps naı̈ve—error-correcting code


would employ repetition: sending each bit repeatedly, with the hope that the recip-
ient will be able to spot any errors. Observe, however, that this method significantly
increases the required amount of data to be transmitted. In the above example,
Annette needed to send out twice as much data—this may be problematic for longer
messages, specially since bandwidth is expensive!
2. Annette, who is running out of mobile data, attempts a different error-correcting
code, invented by the 20th Century mathematician Richard Hamming. Recall that,
taking the non-zero vectors in B3 as columns, we can create the Hamming matrix
 
1 0 0 1 0 1 1
H =  0 1 0 1 1 0 1 .
0 0 1 1 1 1 0

From this, we formed the matrix M by taking the basis vectors v1 , v2 , v3 , v4 for
S = {x ∈ B7 | Hx = 0} (i.e., the basis for the null space of H) as its columns:
 
1 0 1 1
 1 1 0 1 
 
 1 1 1 0 
 
M =  1 0 0 0 
.
 0 1 0 0 
 
 0 0 1 0 
0 0 0 1

(a) Explain why the set S is identical to the column space of M . Hence, without
explicitly calcuating any matrix products, explain why H (M x) = 0 for all
vectors x ∈ B4 .
Solution: The column space of M is simply the linear span of its columns,
which is precisely the set S = span {v1 , v2 , v3 , v4 } . Observe that for an arbi-
trary vector x ∈ B4 , we may write the matrix product M x as
 
  x1
↑ ↑ ↑ ↑  x2 
M x =  v1 v2 v3 v4    x3  = x1 v1 + x2 v2 + x3 v3 + x4 v4 .

↓ ↓ ↓ ↓
x4

That is, the vector M x is a linear combination of the columns of M and must
hence lie in the column space of M . Since the column space of M and the
set S are identical, M x must lie in S = {x ∈ B7 | Hx = 0} as well—that is,
M x is a solution to the homogeneous linear system with coefficient matrix H.
Thus, H (M x) = 0.
An alternative method of checking H (M x) = 0. The columns v1 , . . . , v4 of
M are in the nullspace of H so

Hv1 = · · · = Hv4 = 0.

We compute
   
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
HM = H  v1 v2 v3 v4  =  Hv1 Hv2 Hv3 Hv4  = 0.
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓

Hence
H(Mx) = (HM)x = (0)x = 0.

(b) Consider the vector v = M u, which is a vector in B7 . The first three entries
of v will later be used to detect errors. What are the last four entries of v?
Solution: Observe that the last four rows of the matrix M form the identity
matrix of order 4. We can partition the matrix M into two blocks—the first
three rows forming the matrix A, and the last four rows forming I4 . Thus,
 
1 0 1 1    
 1 1 0 1  ↑ ∗
   Au   ∗ 
 1 1 1 0     
   ↓   ∗ 
v = Mu =   1 0 0 0 u =  ↑  =  ↑ ,
    
 0 1 0 0     
   I4 u   u 
 0 0 1 0 
↓ ↓
0 0 0 1

and the last four entries of the vector v contains the original message u.
(c) Instead of transmitting the vector u, Annette’s computer instead sends out
v = M u. Assume that at most one error can occur during transmission.
• What vector will you receive if no errors occur during transmission?
Solution: If no error occurs during transmission, then all the entries of
the vector v will remain unchanged—thus, we will receive the vector v.
• Let ei denote the standard unit vector whose i-th entry is 1 and remaining
entries are all 0’s. Explain why you would receive a vector of the form
v + ei , for some i ∈ {1, . . . , 7} , if an error has occured during transmission.
Solution: If an error has occurred during transmission, then one compo-
nent of the vector v would have been altered. That is, for one of the vector’s
components—say, the i-th component—a 0 would have been turned into a
1, or a 1 to a 0. Since 0 + 1 = 1 and 1 + 1 = 0, the error would be akin to
adding a 1 to the i-th component of v. Thus, we would receive v + ei : the
vector v whose i-th entry has been altered.
(d) Let w be the vector you receive on your device. Explain how calculating the
matrix product Hw will allow you to detect and correct a potential transmis-
sion error. [Hint: First consider what the vector w would look like if no error
has occured, then consider the possibility that an error has occured during
transmission.]
Solution: There are two possibilities for w, depending on whether or not an
error occurs during transmission.
• If no error has occurred, the vector w we receive would simply be the
vector v that Annette’s computer sends out. Since w = v = M u,
calculating the matrix product Hw will yield
Hw = Hv = H (M u) = 0.
Since the last four entries of the vector v contains Annette’s original
message u, we are easily able to decode Annette’s message.
• If an error has occured, then the vector w we receive would be of the
form w = v + ei . Calculating the matrix product Hw yields
Hw = H (M u + ei ) = H (M u) + Hei = 0 + Hei = Hei .
In particular, the product Hw = Hei is the i-th column of H. Since all
the columns of H are distinct, we can deduce the vector ei by finding the
corresponding column in H. This tells us which component of the vector
v contains an error.

In summary, if Hw is the zero vector, then no error has occurred; if Hw


yields the i-th column of H, then an error has occurred in transmitting the
i-th component of v.
(e) Your device receives the vector
 
1

 0 


 1 

w=
 0 .


 1 

 0 
0
Has an error been made during transmission? Do you have enough information
to deduce Annette’s original message?
Solution: We calculate Hw on MATLAB, performing our operations modulo
2:

>> H=[1 0 0 1 0 1 1; 0 1 0 1 1 0 1; 0 0 1 1 1 1 0];

>> w=[1 0 1 0 1 0 0]’;

>> mod(H*w,2)
 
1
We find that Hw = 1. Since Hw ̸= 0, an error has been made. Now Hw

0
is the 7th column of the matrix H, and we deduce that we received the vector
w = v + e7 , and an error has been made in transmitting the 7th component of
v. Thus, we recover the transmission sent from Annette’s computer to be
 
1
 0 
 
 1 
 
v = w + e7 =  0 .

 1 
 
 0 
1

Since the last four entries of v is the vector u, we deduce that Annette’s original
message is u = (0, 1, 0, 1)T .

You might also like