# How do I deal with huge exponents in the partition function?

1. Nov 9, 2009

### Brainfarmer

1. The problem statement, all variables and given/known data

This is just a general question, not a "problem"

2. Relevant equations

Z = sum(e^Ej/kT)

3. The attempt at a solution

I'm working on a problem in which I'm asked to find the probabilities of an electron in a hydrogen atom being at one of three energies. The partition function produces something like Z= e^523 + 4e^125 + 9e^57. How do I deal with these huge exponents? My calculator just laughs at me. Is there an approximation I can use? (i'm sorry if this isn't very specific- I don't really have a problem with setting up and solving this, it's just the math thats an issue)

thanks

2. Nov 9, 2009

### Ben Niehoff

The trick is that probabilities are always ratios, with a weighted sum in the numerator, and the partition function in the denominator. So you'll have something like

$$\frac{e^{527} + e^{344} + e^{217}}{e^{532} + e^{381} + e^{286}}$$

In this case, the first term in each sum is so unimaginably huge, compared to the rest of the sum, that everything else can be ignored. So you can approximate this as

$$\frac{e^{527}}{e^{532}} = e^{-5}$$

which is a perfectly reasonable number.

In general, you might have to do some algebra before you plug things into your calculator, because indeed, taking such sums numerically is complete nonsense.

3. Nov 10, 2009

Thank you!