Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -913,11 +913,18 @@ where `P` is not decided, so a count is a sum of brackets: `sum(iverson(k divide
([#1478](https://github.com/asc-community/AngouriMath/issues/1478)). In 2.5.0 the name was read as a
variable multiplying its argument, and a product with a truth value is `NaN`.

A sum of a bracket is counted in closed form, however long the range, where the statement bounds the
index, fixes it at a point, fixes its residue or makes it a perfect power, with `not` and `or` counted by inclusion and
exclusion: the number of whole numbers from `L` to `U` in the class `r` modulo `m` is
`floor((U - r)/m) - floor((L - 1 - r)/m)`, and never below zero.

| Input | Was (2.5.0) | Now |
|---|---|---|
| `"iverson(2 > 1)".ToEntity().Simplify()` | `NaN` — `iverson * (2 > 1)` | `1` |
| `"iverson(x > 0)".ToEntity().Simplify()` | `iverson * (x > 0)` | `iverson(x > 0)` |
| `"sum(sum(sum(iverson(r + b + g = 4), g, 0, 3), b, 0, 3), r, 0, 3)".ToEntity().Simplify()` | `NaN` | `12` |
| `"sum(iverson(2 divides k or 3 divides k), k, 1, 1000)".ToEntity().Simplify()` | `sum(iverson * (2 divides k or 3 divides k), k, 1, 1000)` | `667` |
| `"sum(sum(sum(iverson(a + b + c = 20), c, 0, 20), b, 0, 20), a, 0, 20)".ToEntity().Simplify()` | did not finish in two minutes | `231` |

### A statement about a sum up to `n` is decided by induction

Expand Down
3 changes: 3 additions & 0 deletions Sources/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed
[AngouriMath/Functions/Algebra/Polynomials/FactorialSum.cs]
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n

[AngouriMath/Functions/Algebra/Polynomials/IversonSum.cs]
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n

[Tests/UnitTests/Core/FactorialSumTest.cs]
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
[Tests/UnitTests/Core/ClosedFormProductTest.cs]
Expand Down
6 changes: 5 additions & 1 deletion Sources/AngouriMath/Docs/Usage/Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ identities of chapter 8 of Sullivan and Mackey's *An Introduction to Proofs*, so
**Iverson bracket** — `iverson(P)`. `1` where the statement `P` holds and `0` where it does not,
which is how a count is written as a sum: `sum(iverson(k divides 12), k, 1, 12)` is `6`, the number
of divisors of `12`. A statement that is not decided keeps the node, which prints as `[\![P]\!]` in
LaTeX, and so does a number, which is not a statement.
LaTeX, and so does a number, which is not a statement. A sum of a bracket whose statement bounds the
index, fixes it, fixes its residue or makes it a perfect power is counted in closed form, however long the range, with `not`
and `or` counted by inclusion and exclusion: `sum(iverson(2 divides k or 3 divides k), k, 1, 1000)`
is `667`, and `sum(iverson(not 2 divides k and not 5 divides k), k, 1, n)` is
`n - floor(n/2) - floor(n/5) + floor(n/10)` for a whole `n >= 0`.

**Error functions** — `erf(z)` `erfc(z)` `erfi(z)`. The error function
`2/sqrt(pi) int_0^z e^(-t^2) dt`, its complement `1 - erf(z)`, and the imaginary error function
Expand Down
Loading
Loading