Mathematics - Linear Algebra Function Examples

    Hello it's drifter1 again. Today we will get into some Linear Function Examples finishing off our Linear Algebra series for now. You should check out the posts about Linear Functions and the Linear Function Matrix first if you haven't already. So, without further do let's get into it!

Example 1:

Which of the following functions/morphisms are linear?

f: R^2->R^3, f(x, y) = (x + 1, 3y, y - x)

g: R^3->R, g(x, y, z) = (2x - 3y + 4z)

h: R^2->R^2, h(x, y) = (2x + y, x + 2y)

If you remember from our theory post, a function f: V->W is linear only when:

f(ku + lv) = k*f(u) + l*f(v), where u, v are vectors of V and k, l are real numbers

So, we will test out all the functions to see if they fulfill this requirement.


Suppose two vectors u=(x1, y1) and v=(x2, y2)

We have that:

f(ku + lv) = f(k(x1, y1) + l(x2, y2)) = f((kx1, ky1) + (lx2, ly2)) = f(kx1 + lx2, ky1 + ly2) =>

f(ku + lv) = (kx1 + lx2 + 1,  3(ky1 + ly2), ky1 + ly2 - (kx1 + lx2)).

    After this line we see that we can break up the second and third dimension, but the first dimension contains this "+1" that makes it impossible to create f(ku) + f(lv), because not both can "go back".

So, we will end up with either:

f(ku + lv) = f(ku) + (lx2, 3ly2, ly2 - lx2)


f(ku + lv) = (kx1, 3ky1, ky1 - kx1) + f(lv)

This means that f is not a linear function!


Suppose two vectors u=(x1, y1, z1) and v=(x2, y2, z2)

We have that:

g(ku + lv) = g(k(x1, y1, z1) + l(x2, y2, x2)) = g((kx1, ky1, kz1) + (lx2, ly2, lz2)) =>

g(ku + lv) = g(kx1 + lx2, ky1 + ly2, kz1 + lz2) = (2(kx1 +lx2) -3(ky1 + ly2) + 4(kz1 + lz2)).

This time we can go back and create the g(ku) and g(lv) terms and so:

g(ku + lv) = (2kx1 -3ky1 + 4kz1) + (2lx2 - 3ly2 + 4lz2) = g(ku) + g(lv)

This means that g is a linear function!


Suppose two vectors u=(x1, y1) and v=(x2, y2)

We have that:

h(ku + lv) = h(k(x1, y1) + l(x2, y2)) = h((kx1, ky1) + (lx2, ly2)) = h(kx1 + lx2, ky1 + ly2) =>

h(ku + lv) = (2(kx1 + lx2) + ky1 + ly2, kx1 + lx2 + 2(ky1 + ly2)).

We again can go back and create the h(ku) and h(lv) terms and so:

h(ku + lv) = (2kx1 +ky1, kx1 + 2ky1) + (2lx2 + ly2, lx2 + 2ly2) = h(ku) + h(lv)

This means that h is also a linear function!

    So, from these examples we can see that a function is linear when it contains only linear combinations of the differenent dimension values. This means that when there is some kind of constant added (like +1 in function f) this constant will be passed only to one of the two terms/vectors and so we can't get the linear result.

Example 2:

Suppose the function f: R^3->R^3, f(x, y, z) = (ax - y - 2z, x + ay + 3z, x + 3y + az).

    You can show that it is a linear function with ease and we also already showed some good examples with how you proof it and so I would not get into how you proof it. 

So, let's find out for which integer values of a (a in Z) the function/morphism f is an monomorphism.

In the Linear Functions post I said that f is a monomorphism when the nullspace Kerf = {0}.

    The nullspace contains the solutions for the homogeneous system that this function's matrix represents and so we will have to find the values of a for which the system has no solutions. Because the matrix is a 3x3 square matrix this is pretty easy, cause we simply have to see if the system has one solution that is the all-zero solution and means that the determinant is non-zero.

The matrix A is:

a -1 -2

1   a  3

1  3  a

So, using the rule of Sarrus the determinant is(we have talked about it in Determinants):

det(A) = a^3 - 6a - 9 = (a - 3)(a^2 + 3a + 3).

And so we have that det(A) = 0 when:

a = 3

a1,2 = [-3 +-(9 - 12)] / 2 = [-3 +-3]/2 => a = 0 and a = -3

That way we proofed that f is a monomorphism when a = (Z - {0, 3, -3}).

Example 3:

Suppose the function f: R^4 -> R^4, f(x1, x2, x3, x4) = (x2, x3, x4, 0).

a) find the fuction matrix that corresponds to the standard basis of R^4

b) find the rank(A) of A and a basis for the nullspace N(A)


The first part is pretty simple.

We know that the standard basis is {e1, e2, e3, e4} and so:

f(e1) =  (0, 0, 0, 0) = 0*e1 + 0*e2 + 0*e3 + 0*e4

f(e2) = (1, 0, 0, 0) = 1*e1 + 0*e2 + 0*e3 + 0*e4

f(e3) = (0, 1, 0, 0) = 0*e1 + 1*e2 + 0*e3 + 0*e4

f(e4) = (0, 0, 1, 0) = 0*e1 + 0*e2 + 1*e3 + 0*e4

So, the function matrix A of f is:

0 0 0 0

1 0 0 0

0 1 0 0

0 0 1 0


rank(A) equals to the number of non-zero rows and so rank(A) = 3.

We know that dimV = dimKerf + dimImf, where dimImf = rank(A) and dimV = dimR^4 = 4.

This means that 4 = dimKerf + 3 => dimKerf = 1.

We also know that N(A) = Kerf and so the nullspace basis contains one vector.

    We can already see from here that the linear system A represents has infinite solutions, cause rank(A) < variables. So, finding the "form" of those solutions we will find a basis of N(A).

From the matrix A and solving the homogeneous system AX = 0 we have that:

x1 = x2 = x3 = 0

x4 is arbitrary

So, the solutions are of the form:

[0, 0, 0, x4], x4 arbitrary


[0, 0, 0, 1]*x4

And so N(A) = span{[0 0 0 1]} and [0 0 0 1] is a basis of N(A).

    This example hopefully made you understand better what we mean with Nullspace. You can see that the result of function f will never have a value different to 0 in the 4th dimension value, but N(A) has 0's in the other dimension values and a value different to 0 in the 4th dimension. So, N(A) + f(R^4) = R^4 and you can proof it by yourself if you want, but it's actually logically if you think about what I told you right now, cause function f gives us all vectors that have values different to 0 in the first 3 dimension and N(A) in the 4th dimension and so both combined together give us the whole vector space R^4.

And this is actually it and I hope you enjoyed it!

    From next time we will get into Mathematical Analysis (limits, derivatives, integrals etc.) for our Mathematics posts and I will also start getting into Programming again, cause math really took us away of programming.

Until next time...Bye!

3 columns
2 columns
1 column
Join the conversation now