2018/10/24 Intro Stats 2018/19 Bonus 1 -
Cologne Center for Comparative Politics
Introduction to Quantitative Analysis - Winter 2018/19
Bruno Castanho Silva
Bonus points assignment #1 - Bayes Theorem
Thisassignment cangiveyouupto6bonuspoints, ontopofthetotal maximumof100forthis
course. The deadline is on October 30, 23:55 CET.
Exceptionally, this assignment involves no R work. Upload your answers, with
calculations, in a Word file.
The reading on Bayes Theorem is in the OpenStatistics textbook, section 2.2.7.
For another explanation, check this:
https://betterexplained.com/articles/an-intuitive-and-short-explanation-of-bayes-theorem/
Questions:
1) About 5%of the local population have a runny nose, 3%feel fatigued, and10%have
headaches-- all mildsymptomsoftheflu.However,only1%exhibithighfever--asevere
symptom. If a person is infected with the influenza virus (and 0.5% of the local
populationis), thenthereisan80%chancetheyhavearunnynose,a50%chancethey
haveaheadache, a90%chancetheyfeel fatigued,anda30%chancetheyhaveahigh
fever.
a) What is the probability that a person has the flugiventhat heor shehasheadaches?
(0.5 pt)
b) What is the joint probability of having a high fever and a runny nose? (0.5 pt)
2) Supposethat botsmakeup5%of Twitter users, andanalgorithmtodetect botshasafalsepositive
rateof .01andafalsenegativerateof .001. Furthermore, weknowthatthereareabout60millionactive
usersof Twitter inEurope, withsomeofthelargestrepresentedcountriesbeingtheUK(17millionusers)
and Spain (10 million users). Use Bayes’ Theoremto answer each question when appropriate; make
judicious assumptions as needed.
a) What (roughly) is the probability that arandomTwitter account isactuallyabot if thealgorithm
says it is? (0.5pt)
2018/10/24 Intro Stats 2018/19 Bonus 1 - Google
https://docs.google.com/document/d/1ZAttCMAnf68K6if3SOOm7HywHPRnzoM9XCd_J1_EYHU/edit 2/2
b) Suppose that if anaccount isflaggedasabot, thenthereisa20%chanceit claimstobefrom
theUKor Spain. What istheprobabilitythat if anaccount isfromtheUKor Spainthat itwill be
flagged as a bot? (1.5pt)
c) What is the probability that anEuropeanTwitter user isabot giventhat it claimstobe
from the UK or Spain? (1.5pt)
3) Youhavethevotingrecordsof aMember of parliament (MP), butyoudon’tknowwhatparty
thisMPbelongsto. Youthinkit isquiteunlikelythat shebelongstotheopposition.Totestthis,
you check her voting behavior. in parliament on government-sponsored bills. If the MP is in
government, then 90%of the time she votes YES for government bills. If the MP is *not* in
government (i.e., sheisinopposition), then70%of thetimeshevotesNOongovernmentbills.
You check the last 5 votes. You get the results, in order: YES, NO, YES, NO, NO
Apply Bayes' Theorem to calculate the probability of the MP being in opposition. (1.5pt)
Tip: Pay particular attention to “quite likely”. You’ll have to make an educated guess.