Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

MAST10007 Linear Algebra 2021 Semester 2: MATLAB Computer Lab 7 - The Vector Space Fn2, Exercises of Mathematics

Mathematics 123 Mathematics 123

Typology: Exercises

2020/2021

Uploaded on 10/06/2023

Cucumber123Cucumber
Cucumber123Cucumber 🇺🇸

7 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MAST10007 Linear Algebra 2021 Semester 2 MATLAB Computer Lab 7
7 Computer Lab 7: The Vector Space Fn
2
7.1 Introduction
In this class you will learn about a new vector space, Fn
2. As part of this lab you will need to do modulo 2
arithmetic. The vector space Fn
2is used in applications such as coding data to detect and correct errors in
transmission.
You will need to use the m-files that you downloaded into MATLAB during Computer Lab 3.
If you do not have the m-files, then follow the instructions on the Computer Lab Class Files page of
the MAST10007 website to load the Linear Algebra m-files into MATLAB.
7.2 The Field F2
Let
F2={0,1}.
This set containing just two elements, equipped with the operations of addition and multiplication given
below, is called the integers modulo 2. Addition and multiplication are defined as follows:
Addition
0 + 0 = 0
1 + 0 = 1
0 + 1 = 1
1 + 1 = 0
Multiplication
0×0=0
1×0=0
0×1=0
1×1=1
The main difference between F2and Zis that 1 + 1 = 0. We call the arithmetic in F2,modular or mod 2
arithmetic.
Try entering mod(1+1,2) into MATLAB. What is the result?
With the above definition of addition and multiplication, F2is a field, that is, a system of numbers that
shares many of the properties as R(the real numbers) and C(the complex numbers).
Exercise 1: Exploring F2
1. Use hand calculations to find the following:
(a) (1 + 0) ×1 =
(b) 1+0×1 =
(c) 1 + 1 + 1 =
2. Use hand calculations to answer the following:
(a) If a+b=b+a= 0 then bis called the additive inverse of a. What are the additive inverses of
the elements 0 and 1 in F2?
(b) If a×b=b×a= 1 then bis called the multiplicative inverse of a. What is the multiplicative
inverse of the element 1 in F2?
Does 0F2have a multiplicative inverse?
The University of Melbourne 1School of Mathematics and Statistics
pf3
pf4
pf5

Partial preview of the text

Download MAST10007 Linear Algebra 2021 Semester 2: MATLAB Computer Lab 7 - The Vector Space Fn2 and more Exercises Mathematics in PDF only on Docsity!

7 Computer Lab 7: The Vector Space F n 2

7.1 Introduction

In this class you will learn about a new vector space, F n 2. As part of this lab you will need to do modulo 2 arithmetic. The vector space F n 2 is used in applications such as coding data to detect and correct errors in transmission.

You will need to use the m-files that you downloaded into MATLAB during Computer Lab 3. If you do not have the m-files, then follow the instructions on the Computer Lab Class Files page of the MAST10007 website to load the Linear Algebra m-files into MATLAB.

7.2 The Field F 2

Let F 2 = { 0 , 1 }.

This set containing just two elements, equipped with the operations of addition and multiplication given below, is called the integers modulo 2. Addition and multiplication are defined as follows:

Addition 0 + 0 = 0 1 + 0 = 1 0 + 1 = 1 1 + 1 = 0

Multiplication 0 × 0 = 0 1 × 0 = 0 0 × 1 = 0 1 × 1 = 1

The main difference between F 2 and Z is that 1 + 1 = 0. We call the arithmetic in F 2 , modular or mod 2 arithmetic.

Try entering mod(1+1,2) into MATLAB. What is the result?

With the above definition of addition and multiplication, F 2 is a field , that is, a system of numbers that shares many of the properties as R (the real numbers) and C (the complex numbers).

Exercise 1: Exploring F 2

  1. Use hand calculations to find the following:

(a) (1 + 0) × 1 = (b) 1 + 0 × 1 = (c) 1 + 1 + 1 =

  1. Use hand calculations to answer the following: (a) If a + b = b + a = 0 then b is called the additive inverse of a. What are the additive inverses of the elements 0 and 1 in F 2?

(b) If a × b = b × a = 1 then b is called the multiplicative inverse of a. What is the multiplicative inverse of the element 1 in F 2?

Does 0 ∈ F 2 have a multiplicative inverse?

Exercise 2: Row Reducing and Multiplying Matrices using Modulo 2 Arithmetic

In the same way that we have matrices with real entries, we can have matrices with entries in F 2. The usual operations apply, except that addition and multiplication is done using mod 2 arithmetic.

In MATLAB enter the matrices

A =

   

    and x =

    

    

(a) Using hand calculations, find A x using mod 2 arithmetic.

A x =

  

  

   

   ^ =

(b) In the box below, use hand calculations to find the reduced row echelon form for the matrix A using mod 2 arithmetic. Remember to use 1 + 1 = 0 to obtain zeros where needed.

A =

  

   ∼

(c) Use the commands mod(A∗x,2) and rrefmod2(A) to check your answers.

mod(A∗x,2)= rrefmod2(A)=

Compare the results with the answers in (a) and (b).

The second command finds the row reduced form of the matrix A using modulo 2 arithmetic. It is a special function created for these classes. The usual command rref will not give the right answer.

Put the vectors u 1 , u 2 , u 3 , u 5 , u 6 in the columns of a matrix called C and u 1 , u 2 , u 4 , u 5 , u 6 in the columns of a matrix called D.

(d) Decide if either of the following sets of vectors spans F^52. Give a brief explanation. You may assume that dim(F^52 ) = 5. Do keep using rrefmod2.

(i) { u 1 , u 2 , u 3 , u 5 , u 6 }

(ii) { u 1 , u 2 , u 4 , u 5 , u 6 }

(e) How can you test for linear dependence and independence of the vectors v 1 ,... , v k ∈ F n 2?

(f) Are the following sets of vectors linearly dependent or linearly independent? Why?

(i) { u 1 , u 2 , u 3 , u 5 , u 6 }

(ii) { u 1 , u 2 , u 4 , u 5 , u 6 }

(g) Are either of the following sets of vectors a basis for F^52? Give a brief explanation.

(i) { u 1 , u 2 , u 3 , u 5 , u 6 }

(ii) { u 1 , u 2 , u 4 , u 5 , u 6 }

(h) Why does dim(F^52 ) = 5?

Exercise 4: Solution Space

This exercise will refer to the matrix M and the vectors v1, v2, v3 and v4 that were loaded when you ran zed2input.

(a) Let M be a m × n matrix and x be a n × 1 coordinate vector. How can you check whether or not x is in the solution space of M?

(b) Let

M =

   

   

Using MATLAB decide whether or not the following are in the solution space of M.

(i) v 1 =

    

    

(ii) v 2 =

    

    

(iii) v 3 =

    

    

Remark: In coding theory, this idea is used to detect errors in transmitted messages. The messages sent are coded using vectors in the solution space of a “check matrix” M with entries in F 2. If we receive a vector v with M v 6 = 0 , then we know that a transmission error has occurred. By choosing the matrix M cleverly (e.g. using a Hamming matrix) it is also possible to correct errors and recover the original message.

The following exercise gives an idea of how this works.

Exercise 5: Column Space

This exercise will refer to the matrix M and the vectors w1 and w2 that were loaded when you ran zed2input.

(a) Let M be a m × n matrix and w be a m × 1 coordinate vector. How can you check whether or not w is in the column space of M?

(b) Let M be as in Exercise 4.

Using MATLAB decide whether or not the following are in the column space of M.

(i) w 1 =

  

  

(ii) w 2 =

   

   