Skip to content

Commit a68906c

Browse files
Eliminate use of math markdown
1 parent e61bb92 commit a68906c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ This is a very reasonable assumption for certain types of data, e.g. Monte Carlo
3737

3838
For inherently unordered data:
3939
Define `p` as the probability of success, i.e. the probability of `true` w.r.t. `any` and the probability of `false` w.r.t. `all`.
40-
The cumulative probability of evaluating all elements:
41-
```math
42-
Pr(x \leq 0) = {n \\choose 0} p^0 (1 - p)^{n-0} = (1 - p)^n
40+
The cumulative probability of evaluating all elements, `Pr(x ≤ 0)` is
41+
```julia
42+
binomial(n, 0) * p^0 * (1 - p)^(n - 0) # (1 - p)^n
4343
```
44-
Define a linearized cost model, with `t` the time required to evaluate one element, and `n` the length of the vector. Denote `t_0` as the non-vectorized evaluation time per element, and `t_v` as the vectorized evaluation time per element. A crude estimate for the expected cost of the call is therefore
45-
```math
46-
t_{0} n (1 - p)^n
44+
Define a linearized cost model, with `t` the time required to evaluate one element, and `n` the length of the vector. Denote `t₀` as the non-vectorized evaluation time per element, and `tᵥ` as the vectorized evaluation time per element. A crude estimate for the expected cost of the call is therefore
45+
```julia
46+
t₀ * n * (1 - p)^n
4747
```
4848
Thus, the point at which non-vectorized evaluation is optimal is
4949
```julia

0 commit comments

Comments
 (0)