Matrix Factorization 1

Posted on Mon, Sep 27, 2021 basic math linear-algebra exportober matrix-factorization

I have decided to take up this Exportober challenge by Prof. Neeldhara Misra primarily because I have been procrastinating on a lot of things these days and I never seem to get out of the wretched rabbit hole. I realized that this is largely due to me wanting things to be perfect - I'll do an activity X only when I have the best clarity on how to do it. Even if one assumes that there exists such a thing as best clarity on something, I repeatedly fail to realize that the time spent to attain that clarity can be minimized if I am willing to put myself out there and be imperfect.

I have been wanting to revise some linear algebra stuff that I have learned a few years ago and figure out the gaps in my understanding. Now seems like the perfect time to do that. This will be a series of posts on Matrix Factorization.

Audience: The intended audience for this blog post is anybody who has done high school math - which means I might talk about things that are rather standard to you (I hate to use the word trivial). So, feel free to skip through such sections. (Hopefully, I adhere to this promise and don't assume things just because I happen to know them).

Factorization

We have been factorizing various objects since eternity. For example, the prime factorization of x=202419000x = 202419000 is

202419000=2335537217202419000 = 2^3 * 3^5 * 5^3 * 7^2 * 17

We wrote this large composite number as a product of prime numbers. How is this helpful? Say we have another large number y=35054208=27357223y = 35054208 = 2^7 * 3^5 * 7^2 * 23 and we want to write the simplest form of the fraction yx\frac{y}{x}, i.e., the greatest common divisor of the numerator and denominator should be 11. This problem is rather simple if we are given xx and yy as a product of prime factors instead of a large composite number.

yx=273572232335537217=24235317=3682125\frac{y}{x} = \frac{2^7 * 3^5 * 7^2 * 23 }{2^3 * 3^5 * 5^3 * 7^2 * 17 } = \frac{2^4*23 }{5^3*17} = \frac{368}{2125}

Sure, we could still argue that if we know the gcd(x,y)gcd(x,y) we can obtain the simplest form by dividing both the numerator and denominator by gcd(x,y)gcd(x,y). Hence it is not really necessary to compute the prime factorization of yy and xx. But there are problems where we really need to be able to factorize large composite numbers. Say you are working for an agency that asks you to monitor the conversation between two parties AA and BB. The two parties have agreed upon a large secret prime number yy which you are unaware of. Suppose AA wants to communicate some message xx (which again turns out to be a large prime number). AA is not naive enough to send xx directly to BB, else you would have intercepted the message easily. Instead, AA sends the product (yx)(y \cdot x). Since BB has yy, it can easily recover xx from this product. On the other hand, you can retrieve this conversation only if you are able to factorize (yx)(y\cdot x).

Consider a number x=p1n1p2n2pknkx = p_1^{n_1} \cdot p_2^{n_2} \cdot \ldots \cdot p_k^{n_k} where pip_i's are prime numbers. Let us write the prime factorization PxP_x of xx as follows:

Px={(p1,n1),(p2,n2),,(pk,xk)}P_x = \{(p_1,n_1), (p_2,n_2), \ldots,(p_k,x_k) \}

For the prime factorization problem, we could ask the following questions:

  1. Existence: Can every (positive) integer be written as a product of prime factors?
  2. Uniqueness: Given any two prime factorizations PxP_x and QxQ_x of a (positive) integer xx, is it the case that Px=QxP_x = Q_x?
  3. Algorithm: Do we know how to compute the prime factorization of a given integer? If yes, how efficient it is?

The answer to the first two questions is yes due to the Fundamental Theorem of Arithmetic. To avoid digression from the main topic, I will not go into the third question. But the point is, similar questions can be asked for any factorization problem.

What next?

Before starting matrix factorization, I will walk through some basic definitions of vectors, matrices, and other related terminologies in the next post. See you soon!!