AngouriMath

Navigation

IversonSum


← Back to list of classes

Description

Summary

A sum of an Iverson bracket over a range of whole numbers is a count, written in closed
form: how many whole numbers of the range satisfy the statement. A product of brackets is
the bracket of the conjunction.
sum(iverson(2 divides k or 3 divides k), k, 1, 1000) is 667.

Remarks

The statement is read as conditions on the index. An equation linear in it fixes it at a
point p, and then the sum is a bracket again, of p being whole, in the range,
and satisfying the other conditions: in a nested sum that is what the next sum out counts.
A comparison linear in the index, with a numeric slope, bounds it from one side, and so
does a membership in an interval. A divisibility of a linear function of the index with
whole coefficients fixes its residue, and several residues combine into one class or
none, by the Chinese remainder theorem. A conjunct that does not mention the index is a
factor, and so is a linear function of it being whole, which depends only on its constant
term. What is left is the number of whole numbers from L to U in the class
r modulo m, floor((U - r)/m) - floor((L - 1 - r)/m), or
U - L + 1 with no class, and never below zero, which is also the count of an empty
range. A bound that is not a number is read as real, as a bound of the range that is not a
number is read as whole.
A negation and a disjunction are counted by inclusion and exclusion: not Q counts
the range less Q, and Q or R counts Q and R less both. So
sum(iverson(not 2 divides k and not 5 divides k), k, 1, 99) is 40, Sullivan and
Mackey's §8.7.4 Try 1.
https://github.com/asc-community/AngouriMath/issues/1409
https://github.com/asc-community/AngouriMath/issues/1478

Members

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online