We define geometric distribution and draw random variables from it in R. We familiarize ourselves with while loop and scientific notation.

R commands and functions:

R commands and functions:

- while(bool){do} - repeats do command while bool logical condition is TRUE
- rgeom(n,p) - generates n draws from geometric distribution with parameter p
- 1+e6 - short notation for 10 to power 6