Suppose we also happen to know the gender of the lottery winner. Here are same OECD statistics as above broken down by gender:
Country | Population | Male fishers | Female fishers | Fishers (total) |
---|---|---|---|---|
Denmark | 5,615,000 | 1822 | 69 | 1891 |
Finland | 5,439,000 | 2575 | 77 | 2652 |
Iceland | 324,000 | 3400 | 400 | 3800 |
Norway | 5,080,000 | 11,291 | 320 | 11,611 |
Sweden | 9,609,000 | 1731 | 26 | 1757 |
TOTAL | 26,067,000 | 20,819 | 892 | 21,711 |
Write a function that uses the above numbers and tries to guess the nationality of the winner when we know that the winner is a fisher and their gender (either female or male).
The argument of the function should be the gender of the winner ('female' or 'male'). The return value of the function should be a pair (country, probability) where country is the most likely nationality of the winner and probability is the probability of the country being the nationality of the winner.
Tip: Your values might be different, but the formatting should be identical.