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 command
     hist(rnorm(10000), breaks=100)
  2. Go to https://try.jupyter.org/, open notebook Welcome R - demo.ipynb and try submitting a few commands
  3. Go to http://shiny.rstudio.com/gallery/, play with some application and briefly look at its source code

Task 2

Simulate proportion of heads in a coin flip. Create a vector with random zeros (tail) and ones (head) with length 1000 and plot its cumulative proportion as a line plot. Your plot should be similat to the one below.

Hints: help, runif, cumsum, plot(..., type='l', xlab='...', ylab='...')

Task 3

  1. Simulate 10000 realizations of random variable $$X \sim Ex(1)$$ (using rexp) and plot histogram of those values with 100 bins.
  2. Simulate 10000 realizations of random variable $$ Y = \frac{X_1 + \cdots + X_{n}}{n} $$ where $X_i \sim Ex(1)$ and $n=5$. Plot its histogram with 100 bins.
  3. Try increasing $n$ (10, 50, 100, 1000) and see how it converges to normal distribution.

Hints: rexp, for(i in 1:n){...}, rep(0, n), hist(..., breaks=100)