Files
ArtStudies/M1/Monte Carlo Methods/Exercise1.rmd
2024-09-18 16:53:09 +02:00

8 lines
168 B
Plaintext

# Exercise 1 : Uniform
```{r}
n <- 10e4
U <- runif(n)
X <- 5 * (U <= 0.4) + 6 * (0.4 < U & U <= 0.6) + 7 * (0.6 < U & U <= 0.9) + 8 * (0.9 < U)
barplot(table(X)/n)
```