mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-02-10 16:06:59 +01:00
Refactor files
This commit is contained in:
8
M1/Monte Carlo Methods/Exercise1.rmd
Normal file
8
M1/Monte Carlo Methods/Exercise1.rmd
Normal file
@@ -0,0 +1,8 @@
|
||||
# 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)
|
||||
```
|
||||
Reference in New Issue
Block a user