You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e2cbcf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: lectures/functions.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -513,7 +513,7 @@ Try to use lambda expressions to define the function `f`.
513
513
:class: dropdown
514
514
```
515
515
516
-
-Here's one solution for part 1
516
+
Here's one solution for part 1
517
517
518
518
```{code-cell} python3
519
519
def factorial(n):
@@ -525,7 +525,7 @@ def factorial(n):
525
525
factorial(4)
526
526
```
527
527
528
-
-Adding the lambda expression
528
+
Adding the lambda expression
529
529
530
530
```{code-cell} python3
531
531
def factorial(n,f = lambda x: x):
@@ -561,14 +561,21 @@ The [binomial random variable](https://en.wikipedia.org/wiki/Binomial_distributi
561
561
Without any import besides `from numpy.random import uniform`, write a function
562
562
`binomial_rv` such that `binomial_rv(n, p)` generates one draw of $Y$.
563
563
564
-
Hint: If $U$ is uniform on $(0, 1)$ and $p \in (0,1)$, then the expression `U < p` evaluates to `True` with probability $p$.
564
+
```{hint}
565
+
:class: dropdown
566
+
567
+
If $U$ is uniform on $(0, 1)$ and $p \in (0,1)$, then the expression `U < p` evaluates to `True` with probability $p$.
0 commit comments