Class 24: Practice

Computing for Molecular Biology 2

Andrés Aravena, PhD

4 June 2021

Organizing a conference

You are in charge of organizing a conference

There are four kind of people who may attend:

  • national students,
  • international students,
  • national academics, and
  • international academics

To organize the conference room, you need to find how many people will attend

Organizing a conference

Your preliminary survey shows that there are

  • 200 national students, attending with probability 60%

  • 100 international students, attending with probability 40%

  • 50 national academics, attending with probability 20%

  • 20 international academics, attending with probability 80%

How would you solve this?

Simulate one conference

The function conference() receives the number of national students, international students, national academics and international academics

It returns the total number of people attending to the simulated conference

The result should be something like this

conference(200, 100, 50, 20)
[1] 210

Simulate 10000 conferences

Store the result in a vector called conferences

barplot(table(conferences))

Average and standard deviation

Find the mean and the standard deviation of the number of people attending the conference

[1] 210.049900   9.503823

Find an interval containing 95% of cases

Something like this

[1] 191.0423 229.0575