Passing the seminar

Absences

  • 2 unexcused absences (for more you'll need a letter of excuse)

Homework assignments

  • 4 regular assignements througout the semester, 2 weeks for each one. You'll need to have at least 3 assignments with >50% points to pass the seminar.
  • 1 (harder) final assigment for the exam
  • points from the assignments will be taken into account at the exam
  • only assignments with proper math typesetting will be accepted (= no MS Word, more details in 1st homework)

Seminar from 19.9.2016

Task 1

  1. Open R Studio and run commands
     mean(rnorm(10))
    and then
     a = 1:10
     print(a)
  2. Go to https://try.jupyter.org/, open notebook Welcome R - demo.ipynb and submit commands above

Task 2

Simulate proportion of heads in a coin flip. Create a vector with random zeros (tail) and ones (head) with length lengths 10, 100, 1000 and 10000 and for each length calculate proportion of heads. What do you notice with increasing number of coin flips?

Hints: help, runif, mean

Task 3

  1. Simulate 10000 realizations of random variable $$X \sim Ex(1)$$ (using rexp command) and calculate their mean and 20% and 80% quantiles.
  2. Simulate 10000 realizations of random variable $$ Y = \frac{X_1 + \cdots + X_{n}}{n} $$ where $X_i \sim Ex(1)$ and $n=5$. Calculate its mean and 20% and 80% quantiles.
  3. Try increasing $n$ (e.g. 10, 50, 100, 1000) and look at quantiles and mean. Can you notice any symmetry? The symmetry comes from the fact that $Y$ converges to a normal distribution.

Hints: rexp, quantile(x, 0.2), for(i in 1:n){...}, rep(0, n)