numboccur - count occurrences of an expression
|
Calling Sequence
|
|
numboccur(f, x)
|
|
Parameters
|
|
f
|
-
|
expression
|
x
|
-
|
expression
|
|
|
|
|
Description
|
|
•
|
The numboccur(f, x) function returns the number of times that x is found in f.
|
•
|
If x is a sum or a product, the counted expressions are those where the sum or product appear with no extra terms or factors in f. If x is a list or a set, then every element in the list or set is counted.
|
•
|
If x is a list or set, numboccur counts and adds together the number of times each member of the list or set occurs in f. In other words, numboccur(f,{x,y}) is equivalent to numboccur(f,x) + numboccur(f,y). Note that if x is a list and contains a given element more than once, it is counted more than once each time it appears in f.
|
•
|
If the item that you want numboccur to count is itself a list or set, you must enclose it in a list or set. Otherwise, numboccur will count occurrences of the items in the list or set as described above.
|
|
|
Thread Safety
|
|
•
|
The numboccur command is thread-safe as of Maple 15.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
|
|
Download Help Document
Was this information helpful?