# Thread: Solve A(B^-x) < (B-x)!

1. ## Solve A(B^-x) < (B-x)!

I've been stuck for ages on this

Solve A(B^-x) < (B-x)!

B and A are constants, specifically,

A = (365! / 0.25)
B = 365
x is an integer

halp

2. Are you looking for the range of values x for which A(B^-x) < (B-x)! holds good? If so then the range is
x <= -32
x >= 32

for values of x between -31 to 31 (included) it is invalid. Did it iteratively.

I'd actually already solved it iteratively using a calculator, but the people setting the question wanted a more analytic solution

The trick is to use Stirling's (simple) formula, ln (x!) approximately equal to x.ln (x) - x

I still didn't get a solution before I ran out of time.

the range you came up with though was correct, which at least shows I was on the right track (I think!)

4. I'll try with the Stirling's formula.

I used inequality in this form while iterating.

$\forall$ $x \leq 0$ Find $x$ such that $\displaystyle\prod_{i=0}^{|x|}\frac{365}{365 + i}$
and
$\forall$ $x > 0$ Find $x$ such that $\displaystyle\prod_{i=0}^{|x|}\frac{365 - i}{365}$

5. blimey! I havn't used iterative processes for years... I'm an undergrad physicist and

If it helps, the problem is thus:

What is the minimum number of people you need in a room for there to be a 75% chance that two people share the same birthday.

my workings:

P(n people do NOT share the same birthday) = 1 x (1- 1/365) x (1 - 2/365) x ... x ( 1 - n/365)

here the first factor is the first person entering the room, etc

we are looking for n such that

PRODUCT'SUM' from i=0 to i = n-1
(1 - i/365) = 0.25 *

LHS = PRODUCT'SUM' 365^n (365 - i)
= 365 ^ n [365 ! / n !]

which, fitting this all into the * equation, gives us

365 ! / 0.25 = 365^-n * n!

hmm, perhaps I made an error when I last did it... anyway this was where I got stuck.

though do remember that I have already handed my solutions in, I would still like to see the solution

6. If you are trying to solve it, as it is, I suggest you not to use Stirling's formula. $365! \approx e^{1796}$ but from Stirling's you get $365! \approx e^{1788}$.

Another way to find n is to use Taylor series expansion $e^x \approx 1 + x$ for the probabilities as each person enters the room.

Substitute,
$e^{\frac{-1}{365}} \approx 1 - \frac{1}{365}$

$e^{\frac{-2}{365}} \approx 1 - \frac{2}{365}$
.
$e^{\frac{-(n-1)}{365}} \approx 1 - \frac{(n-1)}{365}$

Probability of n people not sharing birthday becomes,
$\bar{P} = e^{\frac{-(0+1+2+...+(n-1))}{365}}$

which can be further reduced since,
$1+2+...+(n-1) = \frac{n(n-1)}{2}$

Now,
$\bar{P} = e^{\frac{-n(n-1)}{2 \times 365}}$

Since,
$P = 1 - \bar{P} = 1 - e^{\frac{-n(n-1)}{2 \times 365}}$

Using $\ln$ simplify,
$n^2 - n = 2 \times 365 \times \ln{(\frac{1}{1 - P})}$

For $P = 0.75$, you get $n \approx 32$

Hope this helps.

7. That's great, thankyou