Skip to content

Commit c162978

Browse files
Update rng usage in lln_clt.md (#738)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e60cf3b commit c162978

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lectures/lln_clt.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,8 @@ NumPy doesn't provide a `bernoulli` function that we can sample from.
562562
However, we can generate a draw of Bernoulli $X$ using NumPy via
563563
564564
```python3
565-
U = np.random.rand()
565+
rng = np.random.default_rng()
566+
U = rng.random()
566567
X = 1 if U < p else 0
567568
print(X)
568569
```

0 commit comments

Comments
 (0)