mercredi 20 mars 2019

Random numbers with different probability of ocurring

I'm simulating a problem in Excel to prove my theoretical result.

I have a total number of customers, let's say n = 80. 40% of this group is female and 70% is of the age from 40 to 60. On paper, if I want to get a group of female that is of the age from 40 to 60, I can just multiply 0.4 * 0.7 * 80

However, I'm running a Monte Carlo simulation on Excel, so the sex and the age have to be random here. I can't figure out how to "simulate" the 40% and 70% here. For example, if I do rand() and take 1 for male and 0 for female, that would give 50% female though right?

Can I get help with this please?




Aucun commentaire:

Enregistrer un commentaire