I have always had a certain love for math and the neat things you can do with it. Here is a bit of information and shortcuts I have picked up in a few of my math classes.
Pascal’s Triangle
Pascal’s Triangle is a pretty neat thing. It is very simple to construct and can be used to understand a lot of different ideas. It follows a very simple form: start with a ’1′ and add the two digits above to get the next number. The first few line look like this:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
…
The line numbers start at 0, and continue on ad infinitum. In order to generate this triangle, programmatically, you would use something like this:

vector<int> pascal(

vector<int> prev, //the current (old) row data

int *len, //the length of the data

int end, //the row to retrieve

int cur=0 //the current row we are on

);


vector<int> pascal(vector<int> prev,int *len,int end,int cur){


//return immediately if we are at the last row

if (cur==end) return prev;


//if the current vector length is 0, then set it to 1

if (*len==0) *len=1;


//create a temp vector (all 1′s) to store the new row data

vector<int> t((*len)+1,1);


//sum the two rows

for(int i=1;i<(*len);i++)

t[i]=prev[i1]+prev[i];


//increase the length by 1

*len=(*len)+1;


//return the new row data

return pascal(t,len,end,cur+1);


}
Binomial Expansion
Remember binomials from algebra? They were the pair of numbers used to create or simplify polynomial expressions, something like:
You can use Pascal’s triangle to find the coefficients of the polynomials. Let’s begin by solving for the generic case:
See the coefficients so far, with n=2 ? They are [1 2 1], which corresponds to the second row in Pascal’s triangle. But this could be a fluke, right, so let’s jump ahead to n=5 to see if that works as well.
[we know what is, so: ]
[note: notice that the coefficients of are (1 4 6 4 1) ! ]
There it is! The coefficients correspond to the rows on Pascal’s Triangle!
Features
Now, to make things a little simpler, I will note some interesting “features” about what we just did.
General Formula for Binomial Expansion
The general formula for binomial expansion is:
Where is the coefficient at row n (starting from 0) and column i in Pascal’s Triangle. The formula means to add from i=0 to n all the terms , replacing i with the number you are at. For example, supposing i=3, you would get:
since , we finally get:
cleaning up a bit :
Exponents
Note in all the expansions, the first variable counts down from n to 0, while the second variable counts up from 0 to n.
Does your binomial already have coefficients?
If your binomial already has coefficients, simply add the coefficient in with the variable it is with, so it merely multiplies the term by that amount. For example:
Hi, Congratulations to the site owner for this marvelous work you’ve done. It has lots of useful and interesting data.