Deriving arrays in mathematics
-
28-09-2019 - |
문제
So I found some similarities between arrays and set notation while learning about sets and sequences in precalc e.g. set notation: {a | cond } = { a1, a2, a3, a4, ..., an} given that n is the domain (or index) of the array, a subset of Natural numbers (or unsigned integer). Most programming languages would provide similar methods to arrays that are applied to sets e.g. upperbounds & lowerbounds; possibly suprema and infima too.
Where did arrays come from?
해결책
Python's list comprehensions, in this respect, are as good as it gets:
[x for x in someset if x < 5]
Very "set-like". The for x in <...>
part specifies which set the elements are selected from, and if x...
specifies the condition.
제휴하지 않습니다 StackOverflow