1.MATH347 Homework 3

Topic: Math@UNC environment
Post date: May 26, 2021
Due date: May 30, 2021

1.1.Background

This homework investigates consequences of the fundamental theorem of algebra and application of the singular value decomposition.

1.2.Theoretical questions

Consider a linear mapping 𝒇:UV, from vector space 𝒰=(U,,+,) with basis {𝒖1,,𝒖n}, to 𝒱=(V,,+,), with basis {𝒗1,,𝒗m}.

  1. Is {𝒇(𝒖1),,𝒇(𝒖n)} a basis for 𝒱?

  2. If nullity(𝒇)=0 must m=n?

  3. If m=n and 𝒖i=𝒗i for i=1,,m, what is the matrix 𝑨 representing 𝒇?

  4. Determine the singular value decomposition and pseudo-inverse of a matrix 𝑨1×n (i.e., a row vector).

1.3.Ordered bases for the fundamental spaces and painting motifs

The fudamental theorem of linear algebra partitions the domain and codomain of a linear mapping. The singular value decomposition provides orthogonal bases for each of the subspaces arising in the partition. The bases are ordered according to the amplification behavior of the linear mapping, expressed through the norm of successive restrictions of the mapping. This approach is closely aligned with typical problems in data science, and can be used in a variety of scenarios. In this homework linear algebra methods will first be used in a field far removed from the physical sciences: extracting the quirks of painter style from the overall composition of a painting, and applying one artist's style to another artist's composition. This is often-encountered data science problem: distinguishing between small and large scale features of data.

octave] 
cd /home/student/courses/MATH347DS/homework; mkdir hw03; cd hw03
octave] 
im=imread(/home/student/courses/MATH347DS/Frida_Kahlo_96.jpg");
octave] 
imshow(im)
octave] 
function im=pread(name)
  im=imread(strcat("/home/student/courses/MATH347DS/data/paintings/",name));
  im=rgb2gray(im);
end
octave] 
imFK96=pread("Frida_Kahlo_96.jpg");
octave] 
imshow(imFK96); size(imFK96)

ans =

484 430

octave] 

1.3.1.Images as mappings

Alternatively, an image can be interpreted as a matrix 𝑨, hence a mapping. From

𝑨=𝑨𝑰=𝑨[ 𝒆1 𝒆2 𝒆m ]=[ 𝑨𝒆1 𝑨𝒆2 𝑨𝒆m ],

the image can be interpreted as the transformation of the image encoded by 𝑰. Denote by 𝑨k the kth-rank approximation of 𝑨 from the singular value decomposition 𝑨=𝑼𝚺𝑽T

𝑨k=l=1kσl𝒖l𝒗lT.

Display the images that correspond to k=m,m/2,m/4,m/8.

1.3.2.Extracting and applying motifs

Consider images from two different artists, 𝑨,𝑩 and their singular value decompositions

𝑨=𝑺𝚲𝑻T,𝑩=𝑼𝚺𝑽T.

Let q=rank(𝑨), r=rank(𝑩). Construct and display images that take the large scale features from 𝑨 combined with small scale features from 𝑩,

𝑪=l=1min(k,q)λl𝒔l𝒕lT+l=max(1,r-k)rσl𝒖l𝒗lT,

for k=m/2,m/4,m/8,m/16where r=rank(𝑩).