Guessing the sex of my app user based on the overall app downloads statistics

I have got an app that has 72% male, 22% female, and 7% unknown users. In order to make more money from displaying ads, I want to pass the sex of the user to the ad server.

How close would I be if I implement a function like such:

Generate a random number between 1 and 100.
If the number is 1 to 7 then sex = Unknown
If the number is 8 to 22 then sex = female
If the number is 23 to 100 then sex = male .


So for each time a user opens the app the function above will try to guess their sex based on the statistics above. Would I be correct most of the time with around 5000 users per day?

• It sounds dangerous to assume that a "monte carlo" method for determining sex will work. You have to answer a few questions your self, what is the size of the original dataset? Also with that in mind you will also need to test the hypothesis that percentages are significant i.e. what is the error associated with each of the probabilities. Then compute the type errors from the assumptions you have made..i.e. P(actual = F|model=M) etc etc. To be honest you could use pattern analysis to try and find indicators of the sex from other variables that are available. – Chinny84 Feb 17 '14 at 11:30

The probability of it hitting correct is the probability $$P((\text{user is male}\wedge\text{guess is male})\vee(\text{user is female}\wedge\text{guess is female})\vee(\text{user unknown}\wedge\text{guess unknown}))$$ Which is, since the events are exclusive, equal to the sum of the probabilities of each event.
The probability of the user being male and the guess being male is, since you choose the guess independently, just the product of the two, so your result is $$0.72\cdot 0.72 + 0.22\cdot 0.22 + 0.06\cdot 0.06$$ which yields a rather low $0.5704$.
On the other hand, if you make a predictor which always guesses the user will be male, then the probability of being correct is $0.72$. Therefore, I cannot recommend your method.
In fact, if you will simply guess at the sex of the user, you will always see that the resulting probability of being correct will be $$\alpha_10.72 + \alpha_2 0.22 + \alpha_30.06,$$ where $\alpha_i$ is the probability of you guessing that the user is male, female or unknown for $i=1,2,3$, respectively. Since the maximum of that expression (given that $\alpha_i\geq 0$ and $\alpha_1+\alpha_2+\alpha_3=1$) is $0.72$, the number achieved just by guessing male, there isn't much more you can do.