Determining the extinction by counting stars? Hi I'm a highschool student studying astronomy at school.
I learned that one can determine how much a luminosity of a star is reduced by counting stars, but I can't understand how it works. My textbook has the following equation:

$\Delta m=2.5 \log(\frac{N}{N_0})$ or also written as $\Delta\log N=0.4\Delta m$
, where N is a number of stars and m is the magnitude.

The textbook says that by comparing the number of visible stars from the inside of an interstellar cloud with that of stars from the outside of the cloud, one can determine how much the luminosity is decreased using that equation.

I have no idea how the equation is created. I searched it on google but I only found this pdf: http://rpi.edu/dept/phys/observatory/obsastro9.pdf
Can anybody explain it for me?
The general idea is that the more extinction there is, the less you'll be able to see stars. So there is a direct relation between the decrease in flux observed for any individual star and the number of stars you can see in that general direction. So the surface distribution of star counts is an excellent tracer of optical extinction, and $\Delta m = 2.5 \log\frac{N}{N_0}$ is a fairly good approximation in many cases.

This relation between $N$ and $\Delta m$ is not derived mathematically, but rather observed empirically (here or here, for instance), under the assumption that the density of stars is the same in the direction of reference and in the direction of interest. This means that the extinction is measured with another method (for instance looking at how much specific emission lines are absorbed), counting the stars, and then fitting a curve that will give the relation between star count and absorption. 

But why don't we just use the other methods directly, might you ask! Well the other methods require data such as high-enough resolution spectroscopic data that aren't always available for the region of the sky you are studying. Then star counting gives you a close enough guess without being prohibitively expensive.