At the faculty costume party, each teacher from Transylvania Middle School came dressed as his or her favorite creepy creature. The teachers arrived one at a time, and when a new teacher came in, each of the teachers alredy there lined up at the door and shook hands with the newcomer. Count Dracula (Mr. Balb, the math teacher) kept track of the number of handshakes exchanged. He said that there were 171 handshakes exchanged at the party. How many teachers came to the costume party

Let the number of teachers be n

the number of handshakes of n people is
C(n,2)

so C(n,2) = 171
n!/(2!(n-2)!) = 171
n(n-1) = 342
n^2 - n - 342) = 0
(n-19)(n+18) = 0
n = 19 or n= -18, but n > 0

So 19 teachers came

People -19

Handshakes- 18
Total handshakes- 171

To determine how many teachers came to the costume party, we can use a combination formula.

Let's assume that "n" represents the number of teachers who attended the party.

When the first teacher arrives, there are no other teachers to shake hands with. So no handshakes occur.

When the second teacher arrives, only one handshake occurs – between the first and second teachers.

When the third teacher arrives, two handshakes occur – one between the first and third teachers, and another between the second and third teachers.

When the fourth teacher arrives, three handshakes occur – one between the first and fourth teachers, another between the second and fourth teachers, and a third between the third and fourth teachers.

We can see the pattern that emerges:

- When the second teacher arrives, 1 handshake occurs.
- When the third teacher arrives, 2 handshakes occur.
- When the fourth teacher arrives, 3 handshakes occur.
- When the fifth teacher arrives, 4 handshakes occur.

More generally, when the "n-th" teacher arrives, the number of handshakes is equal to the sum of the first "n-1" positive integers (1 + 2 + 3 + ... + (n-1)).

To find this sum, we can use the formula:

Sum = (n-1) * n / 2

We know that the sum of handshakes is 171, so we can set up the equation:

171 = (n-1) * n / 2

Now we solve for "n":

171 * 2 = (n-1) * n
342 = n^2 - n

Rearranging the equation:
n^2 - n - 342 = 0

Using the quadratic formula:
n = (-b ± √(b^2 - 4ac)) / (2a)

For this equation, a = 1, b = -1, and c = -342. Plugging in those values:
n = (-(-1) ± √((-1)^2 - 4 * 1 * -342)) / (2 * 1)
n = (1 ± √(1 + 1368)) / 2
n = (1 ± √1369) / 2

Using the positive value since the number of teachers cannot be negative:
n = (1 + √1369) / 2 ≈ 37.07

Since we can't have a fraction of a teacher, we can round the number of teachers to the nearest whole number. Therefore, approximately 37 teachers came to the costume party.