What is the frequency distribution for luminosity classes in the Milky Way Galaxy? I'm working on a game concept that does some mild simulation of realistic stellar classes and luminosities. In particular, I'd like to roughly model the general frequencies of the classes and luminosities of the stars in the Milky Way.

Several sources, including Wikipedia's entry on stellar classifications, show a chart that includes the frequency distribution for spectral classification: the OBAFGKM categorization. So that's fine.

What I'm having trouble finding is any frequency distribution chart similar to that one but for the Yerkes luminosity categories: Ia+, Ia, Iab, Ib, II, III, IV, V, sub-dwarf and dwarf. I have a copy of the Hipparcos database, which contains a "Spectral Types" field, but it's highly incoherent text. Still, I could write some code to parse the values in that field to try to get a rough count of luminosity categories in those roughly 116,000 stars... but I'm a little perplexed that no such chart appears to exist already somewhere in Internetland. (Either that or my search-fu is weaker than usual.)

If anyone can point me to a chart of the frequency distribution for the luminosity categories noted above, or suggest a reasonably simple way for me to calculate those values myself, I'd appreciate it.

EDIT: Out of curiosity, I went ahead and did my own simple parsing of the spectrum fields from the Hipparcos dataset.

Out of 116472 rows, only 56284 (fewer than half) provided luminosity class data in the Spectrum field. Those 56284 rows broke down this way:

Ia0     16     0.03%
Ia     241     0.43%
Iab    191     0.34%
Ib     694     1.23%
I       17     0.03%
II    1627     2.89%
III  22026    39.13%
IV    6418    11.40%
V    24873    44.19%
VI      92     0.16%
VII     89     0.16%

Note: Around 1000+ rows gave an either/or value for luminosity class (e.g., "M1Ib/II"). In these cases, I counted only the first value provided. This probably skewed the results slightly compared to counting both luminosity classes.

I'm still very curious to know whether anyone else has produced or located a similar table of frequencies for the luminosity classes, if only to see how my very trivial analysis compares.
Here is how you do it "properly" for the Hipparcos data. As Warrick correctly points out, what you have done in your question is massively biased towards giant and supergiant stars, which actually form the very small minority of stars.

You must form a volume limited sample. To do this, sort the stars by distance (1/parallax) and choose a cut off point. Your sample will always be incomplete, but the greater your distance cut off, the more incomplete it will be and it will become incomplete for more intrinsically luminous stars.

You have a philosophical problem to solve here in terms of what you are trying to achieve. The vast majority of stars in the Galaxy are faint M dwarfs with an absolute magnitude of $&gt;10$. As Hipparcos is only complete to around magnitude 10-11, you will only get these M dwarfs in your subsample if you limit yourself to 10pc. But you will find that this sample contains no evolved stars (too rare) and no white dwarfs (too faint).

EDIT: 
This has piqued my interest again, so I have a practical (approximate) solution, based on a two-part process. The first part involves a paper I wrote (actully an undergraduate experiment) based on the nearest 1000 stars to the Sun (from the Gliese &amp; Jahreiss catalogue CNS3). This sample is roughly complete down to mid M-dwarfs, so everything else I say, and the results I give, only applies to a sample of stars more massive than that.

If you look at this volume-limited sample of 1000 nearby stars you can straight away say something about the relative numbers of different types of stars in the Galactic disk (saying something about stars anywhere else in the Galaxy is filled with much more uncertainty). A colour-magnitude diagram is shown below, and from this we see that:

The Sun is among the brightest of stars - brighter than 95% of other stars.

About 6% of the population are white dwarfs (though a few faint, old white dwarfs may still be missing from the sample). This makes sense. If you integrate a typical mass function assuming only stars more massive than about 1$M_{\odot}$ have even had time to become white dwarfs, then this is what you get.

Only 0.9% of the population are giants. The reason for this is that only a small proportion of stars are massive enough to have evolved into giants on the lifetime of the Galaxy. But once they are there, their lifetimes are short compared to the main sequence phase and most have become white dwarfs (see above).

There are a handful of objects, maybe 0.5%, that could be classified as subdwarfs, between the main sequence and the white dwarfs.

So, in broad terms: 92.5% of stars (above $\sim 0.2M_{\odot}$) are main sequence (class V), 6% are white dwarfs, 1% are giants (class III) and 0.5% are subdwarfs (class VI).

 

There are no very massive stars or supergiants in the immediate solar neighbourhood. That is because they are very rare. To get a better estimate we need to look at a larger volume limited sample. To do this I took all the stars (about 7000) from the Hipparcos catalogue that are closer than 50pc and assumed this was complete to just below a solar luminosity and assumed that those stars with an absolute magnitude brighter than the Sun (1949 stars with $M_V&lt;4.5$ represent 5% of the total population in this volume. The absolute magnitude vs colour diagram for this sample is shown below. 

Of these 1949 luminous stars, I find roughly 190 are giants - giving a giant fraction of $5\times 190/1940=0.5$%, in reasonable agreement with the nearby star sample based on smaller numbers. There are still NO supergiants, even in this larger sample. Thus supergiants have a frequency of $\leq 5 \times 1/1949 = 0.0025$%. i.e. less than 1 star per 40,000 is a supergiant.