# Thread: need help w/ this question.

1. ## need help w/ this question.

Hi everybody! I have no math background and I need the ans to this question, I'd really appreciate your help.

Everytime a new person enters a room all the people that are already in the room shake hands with everybody in the room. people come in one by one. if N people entered the room how many hand shakes were made?

I kinda get how the algorithm should go but I don't know how to write the answer as a function (maybe using the sum char)

$\displaystyle n=1 \rightarrow 0$ handshakes
$\displaystyle n=2 \rightarrow 1$ handshakes
$\displaystyle n=3 \rightarrow 3$ handshakes
$\displaystyle n=4 \rightarrow 6$ handshakes

Then the number of each handshake when someone enters is...

$\displaystyle n=n \rightarrow \frac{n(n-1)}{2}$

The total number of handshakes is simple, its just the number of handshakes from $\displaystyle n=1 \rightarrow n=N$ summed

$\displaystyle \sum_{n}^{N} \frac{n(n-1)}{2}$

3. thank you thank you thank you!!!
just one more thing..
I know that $\displaystyle \sum_{i=1}^{n-1} \ i$ equals (n(n-1))\2

but how can I figure out what $\displaystyle \sum_{n}^{N} \frac{n(n-1)}{2}$ equals?

4. Good heavens! Every one who was already in the room shakes hands with everyone else again? I think that would creep me out.

arcticm, $\displaystyle \sum \frac{n(n+1)}{2}= \frac{1}{2}\sum n(n+1)$.

It's not to difficult (but tedious) to show that the sum of k degree polynomials in n is a k+1 degree polynomial.

That is, $\displaystyle \sum_{j=0}^N n^2+ n= aN^3+ bN^2+ cN+ d$ for some number, a, b, c, and d.

Taking n= 0, $\displaystyle 0= a(0^3)+ b(0^2)+ c(0)+ d= d$ so d= 0.

Taking n= 1, $\displaystyle 1^2+1= 2= a(1^3)+ b(1^3)+ c(1)= a+ b+ c$ so a+ b+ c= 2.

Taking n= 2, $\displaystyle (2^2+ 2)+ (1^2+ 1)= 8= a(2^3)+ b(2^2)+ c(2)= 8a+ 4b+ 2c$ so 8a+ 4b+ 2c= 8.

Taking n= 3, $\displaystyle (3^2+ 3)+ (2^2+ 2)+ (1^2+ 1)= 20= a(3^3)+ b(3^2)+ c(3)= 27a+ 9b+ 3c$ so 27a+ 9b+ 3c= 20.
We know that d= 0 and have 3 equations to solve for a, b, and c.