```{r, echo=FALSE}
library('exams')
include_supplement('laplace.num', recursive=TRUE)
library("exams.forge")
instruction <- NULL
repeat {
  n  <- sample(20:40, 1)
  k  <- sample(4:6, 1)
  l  <- sample(2:k, 1)
  numer   <- combination(k, l)*combination(n-k,k-l)
  denom   <- combination(n, k)
  if (numer/denom>0.001) break
}
solutiontext <- c(replace_fmt("* Günstige Ereignisse: $\\binom{kk}{ll}\\binom{nk}{kl}=res$",
                              kk=k, ll=l, nk=n-k, kl=k-l, res=numer, digits=0),
                  replace_fmt("* Mögliche Ereignisse: $\\binom{n}{k}=res$",
                              n=n, k=k, res=denom, digits=0)
)
sc      <- num_result(numer/denom, digits=3)
```

Question
=======

```{r, error=TRUE, child=instruction}
```

Wie groß ist die Wahrscheinlichkeit beim Lotto `r k` aus `r n` genau `r l` richtige Gewinnzahlen zu haben?

```{r, child="laplace.num"}
```

Meta-information
================
extype: num
exsolution: `r sc$fx[1]`
extol: `r sc$tolerance`
exname: `r if(exists("story")) story else knitr::current_input()`
