Processing math: 97%

The page you are reading is part of a draft (v2.0) of the "No bullshit guide to math and physics."

The text has since gone through many edits and is now available in print and electronic format. The current edition of the book is v4.0, which is a substantial improvement in terms of content and language (I hired a professional editor) from the draft version.

I'm leaving the old wiki content up for the time being, but I highly engourage you to check out the finished book. You can check out an extended preview here (PDF, 106 pages, 5MB).


Applications

lots of good examples here
http://isites.harvard.edu/fs/docs/icb.topic1011412.files/applications.pdf

  • RREF solve eqns
  • ML (decomp and eigenvectors google page rank?)

Linear programming

Solving systems of equations

Example from circuits

When you learn about circuits, you will use Ohm's law V=RI which tells you the drop in potential that occurs when a current I runs through a resistor of R[Ω] (Ohm's). Voltage is measured in Volts [V], current is measured in Amprères [A] so [Ω]=[V/A].

Given a complicated electric circuit in which several voltage sources (batteries) and resistors (light bulbs) are connected, it can be quite difficult to “solve for” all the voltages and currents in the circuit. More precisely, it can be hard if you don't know about linear algebra.

If you know linear algebra you can solve the circuit using row operations (Gauss-Jordan elimination) in one or two minutes. Let me show you an example. Using the Kirchoff's Voltage Law for each loop (The KVL states that the sum of the voltage gains and drops along any loop in the circuit must add up to zero), we obtain the following equations: +10R1I1+5R2(I1I2)=0,+R2(I1I2)R3I2+20=0. You can rearrange these into the form: (R1+R2)I1R2I2=15R2I1(R2+R3)I2=20. You can now use standard techniques from linear algebra (row operations) to solve this system of equations in just a few seconds.

Sidenote: the notion of linear independence of the equations you need to solve manifests in an interesting way with circuits. We must choose the KVL equations to describe the current flowing in linearly independent loops. For example, there are actually three loops in a circuit with two loops which share some elements: the voltage gains/drops around the first loop, the voltages around the second loop, and also the voltages around both loops taken together. It would seem then, that we have a system of three equations in two unknowns. However, the three equations are not independent: the KVM equation for the outer loop is equal to the sum of the first two loops.

Least squares approximate solution

Recall that an equation of the form Ax=b could have exactly one solution (if A is invertible), infinitely many solutions (if A has a null space), or no solutions at all.

Let's analyze what happens in the case where there ar enosWe will analyze The case

no exact solution, but can come up with an approximate solution

he cool direct applications of linear algebra to machine learning. Suppose you are given the data D=[r1r2r3rN]. Each row ri is an n-vector ri=(ai1,ai2,,ain,bi). Each row consists of some observation data. We want to predict future bj given the future aj, given that we have seen rii=1...N The data set consists of N data rows ri where both ai and bi are known.

One simple model for bj given ai=ai=(ai1,ai2,,ain) is a linear model with n parameters m1,m2,,mn: ym(x1,x2,,xn)=m1x1+m2x2++mnxn=mx. If the model is good then ym(ai) approximates bi well. But how well?

Enter error term: ei(m)=|ym(ai)bi|2, the squared absolute value of the difference between the model's prediction and the actual output—hence the name error term. Our goal is to make the sum S of all the error terms as small as possible. S(m)=i=Mi=1ei(m). Note that the “total squared error” is a function of the model parameters m. At this point we have reached a level of complexity that becomes difficult to follow. Linear algebra to the rescue! We can express the “vector prediction” of the model y_m in “one shot” in terms of the following matrix equation: Am=b, where A is an N×n matrix (contains the aij part of the data), m is an n×1 vector (model parameters—the unknown), and b is an N×1 vector (contains the bi part of the data)

To find \vec{m}, we must solve this matrix equation, however A is not a square matrix: A is a tall skinny matrix N>>n, so there is no A1. Okay so we don't have a A1 to throw at the equation Am=b to cancel the A, but what else could we throw at it. Let's throw AT at it! ATANm=ATbNm=ATb Now the thing to observe is that if N is invertible, then we can find an approximation m using m=N1ATb=(ATA)1ATb. This solution to the problem is known as the “least squares fit” solution. This name comes from the fact that this solution is equal to the output of the following optimization problem m=argminmS(m)

Proof: http://en.wikipedia.org/wiki/Linear_least_squares_(mathematics)

Technical detail: the matrix N=ATA is invertible if and only if the columns of A are linearly independent.

When you have to do a “linear regression” model of data matrix X and labels y, the best (in the sense of least squared error) linear model is m=(XTX)1XTy.

Error correcting codes

where the vector coefficients are the raw data bits you want to transmit and the matrix is called an encoding matrix.

Cryptography

Network coding

Pirate material

In the bittorrent scheme, a large file F is split into tiny pieces F={m1,m2,m3,,mN} and the different pieces are shared by the peers of the network. The download is complete when you have collected all the pieces m1 through mN. Of course, you can remain connected.

Suppose that a network coding scheme is used instead, and people share mixtures of packets. For example, you could receive m1m2 (xor of m1 and m2) from one peer, m1m2m3 from another peer and m2 from a third peer.

Can your recover the first three pieces of the file {m1,m2,m3}? Yes you can, thanks to self-inverse the property of XOR.

m1=(m1m2)(m2) and then once you have m1 and m2 you can do m3=(m1m2m3)(m1)(m2).

Q: In general, if you receive M arbitrary combinations of packets, how do you know you can extract the packets?

A: You can if the matrix is invertible. (over the binary field )

Probability density

The power of the signal is a probability density

Pr Verify that it is well normalized \begin{align*} P_{total} &= \int\!\!\int\!\!\int |\psi(\vec{r})|^2 \ d^3\vec{r} \nl &= \int_0^\infty\int_0^{2\pi}\int_0^\pi |\psi(r,\vartheta,\varphi)|^2 \ r^2 \ \sin \varphi d\varphi d\vartheta dr \nl &= \int_0^\infty \frac{4}{a^3} \exp\left(\frac{2 r}{a}\right) r^2 \ dr = 1 \nl &= ?? \int_0^\infty \frac{4}{a^3} \exp\left(\frac{2 r}{a}\right) r^2 \ dr = 1 \textrm{ if } Re(a)>0 \end{align*}

 
home about buy book