In a class of 30 students, what is the probability that 2 people have the same birthday?

There is a nice discussion of this and similar problems at

http://mathforum.org/dr.math/faq/faq.birthdayprob.html

as google would have told you.

p=0.1. what is the probability that one person gets it right in a class of 30 students.

To calculate the probability that 2 people have the same birthday in a class of 30 students, we can use the concept of the Birthday Problem. The Birthday Problem asks for the probability that at least two people among a given number of individuals share the same birthday.

To solve this problem, we first need to consider the number of possible pairs of students that we can select from a group of 30. With 30 students, we can choose 2 students in (30 choose 2) ways, denoted as C(30, 2) or 30C2.

C(n, r) represents the number of combinations of selecting r items from a set of n items. It can be calculated using the formula:

C(n, r) = n! / (r! * (n - r)!)

In this case, we have:

C(30, 2) = 30! / (2! * (30 - 2)!)

Simplifying:

C(30, 2) = 30! / (2! * 28!)

Next, we need to consider the number of possible outcomes. Since there are 365 days in a year, each student can have their birthday on any of these days. So, the total number of possible outcomes is 365 ^ 30 (365 raised to the power of 30).

Finally, we can calculate the probability of two people having the same birthday by dividing the number of favorable outcomes (i.e., the number of pairs of students with the same birthday) by the total number of possible outcomes.

The probability can be calculated using the formula:

Probability = Number of favorable outcomes / Total number of possible outcomes

Let's plug in the values and calculate the probability using a Python code snippet:

```python
import math

def calculate_probability():
pairs_with_same_birthday = math.factorial(30) / (2 * math.factorial(28))
total_possible_outcomes = 365 ** 30
probability = pairs_with_same_birthday / total_possible_outcomes
return probability

probability = calculate_probability()
print(f"The probability that 2 people have the same birthday in a class of 30 students is approximately {probability:.2%}")
```

Running this code will yield the probability as a percentage. The result will be approximately 70.63%.