the handshake problem. n people are in a room each person shakes hands with each other person...
TRANSCRIPT
![Page 1: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/1.jpg)
The Handshake Problem
![Page 2: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/2.jpg)
The Handshake Problem
• n people are in a room• Each person shakes hands with each other
person exactly once.• How many handshakes will take place?
![Page 3: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/3.jpg)
Example: n = 5
![Page 4: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/4.jpg)
Example: n = 5
![Page 5: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/5.jpg)
Person 1 shakes hands with the other four and leaves.
Running Total: 4
![Page 6: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/6.jpg)
Person 1 shakes hands with the other four and leaves.
Running Total: 4
![Page 7: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/7.jpg)
Person 2 shakes hands with the other three and leaves.
Running Total: 4 + 3
![Page 8: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/8.jpg)
Person 2 shakes hands with the other three and leaves.
Running Total: 4 + 3
![Page 9: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/9.jpg)
Person 3 shakes hands with the other two and leaves.
Running Total: 4 + 3 + 2
![Page 10: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/10.jpg)
Person 3 shakes hands with the other two and leaves.
Running Total: 4 + 3 + 2
![Page 11: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/11.jpg)
Person 4 shakes hands with the other one and leaves.
Running Total: 4 + 3 + 2 + 1
![Page 12: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/12.jpg)
Person 5 has no one left to shake with.
Running Total: 4 + 3 + 2 + 1
![Page 13: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/13.jpg)
Person 5 has no one left to shake with.
Running Total: 4 + 3 + 2 + 1 = 10
![Page 14: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/14.jpg)
• So when n = 5, it takes 1+2+3+4 handshakes• In general, it takes 1+2+3+ … + (n-1)
handshakes.• Ex: If there were 10 people, there would be
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45handshakes.
![Page 15: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/15.jpg)
Let’s count the handshakes another way.
• Count each hand in a handshake as a “half-handshake”.
• Two half-handshakes make a whole handshake.
![Page 16: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/16.jpg)
When n = 5
Each person has to shake hands with the other four.
So each person contributes 4 half-handshakes.
Since there are 5 people, this is a total of 5 4 = 20 half handshakes, or ⋅10 whole handshakes.
![Page 17: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/17.jpg)
So for a general n, the total number of handshakes is n(n-1)∕2.
Ex: if n = 10, the number of handshakes is
![Page 18: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/18.jpg)
If n = 50, then the number of handshakes is
This is much easier than adding up
1+ 2 + + 49⋅⋅⋅
![Page 19: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/19.jpg)
By counting in two different ways, we determined that the number of handshakes is both
1 + 2 + + (n-1) and n(n-1)/2⋅⋅⋅
Since these formulas count the same things, we have established the identity
1 + 2 + + (n-1) = n(n-1)/2⋅⋅⋅
![Page 20: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/20.jpg)
Let f(n) = 1 + 2 + + (n-1). We’ve seen that ⋅⋅⋅
![Page 21: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/21.jpg)
Let f(n) = 1 + 2 + + (n-1). We’ve seen that ⋅⋅⋅
To get a function for 1 + 2 + + n, we replace ⋅⋅⋅each n with n+1
![Page 22: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/22.jpg)
The formula 1 + 2 + + (n-1) + n = n(n+1)/2⋅⋅⋅
Was discovered byCarl Friedrich Gauss when he was a student in primary school.
![Page 23: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/23.jpg)
Gauss’s teacher wanted to keep Gauss busy, so he gave him the assignment of adding all the numbers from 1 to 100.
Gauss produced the correct answer in a matter of seconds.
His teacher was impressed.
And annoyed.
![Page 24: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/24.jpg)
Gauss realized that it is easy to add up all the numbers twice.
1 + 2 + 3 + ⋅⋅⋅ + 99 + 100100 + 99 + 98 + ⋅⋅⋅ + 2 + 1 101 + 101 + 101 + ⋅⋅⋅ + 101 + 101
=101(100).
Dividing this by 2 gives a sum of 101 50=5050⋅
![Page 25: The Handshake Problem. n people are in a room Each person shakes hands with each other person exactly once. How many handshakes will take place?](https://reader035.vdocuments.net/reader035/viewer/2022062803/56649ca45503460f94965476/html5/thumbnails/25.jpg)
We can do the same trick for any n:
1 + 2 + ⋅⋅⋅ + (n-1) + n n + (n-1) + ⋅⋅⋅ + 2 + 1 n+1 + n+1 + ⋅⋅⋅ + n+1 + n+1
= (n+1)n
So 1 + ⋅⋅⋅ + n = (n+1)n/2