Skip to content

Commit 5528f54

Browse files
committed
WIP #1034 NSum, NExpectation NProbability
- use interfaces `IDiscreteDistribution, IContinuousDistribution` - defined keyword `NProduct`
1 parent 568bab0 commit 5528f54

File tree

14 files changed

+1753
-1169
lines changed

14 files changed

+1753
-1169
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## NSum
2+
3+
```
4+
NSum(expr, {i, imin, imax})
5+
```
6+
7+
> evaluates the numerical approximated sum of `expr` with `i` ranging from `imin` to `imax`.
8+
9+
```
10+
NSum(expr, {i, imin, imax, di})
11+
```
12+
13+
> `i` ranges from `imin` to `imax` in steps `di`
14+
15+
See
16+
* [Wikipedia - Summation](https://en.wikipedia.org/wiki/Summation)
17+
* [Wikipedia - Convergence_tests](https://en.wikipedia.org/wiki/Convergence_tests)
18+
19+
### Examples
20+
21+
```
22+
>> Num(k, {k, 1, 10})
23+
55
24+
```

symja_android_library/doc/functions/Sum.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Sum(expr, {i, imin, imax}, {j, jmin, jmax}, ...)
2727
2828
See
2929
* [Wikipedia - Summation](https://en.wikipedia.org/wiki/Summation)
30+
* [Wikipedia - Faulhaber's formula](https://en.wikipedia.org/wiki/Faulhaber%27s_formula)
3031

3132
### Examples
3233

symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/FunctionDefinitions.java

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ private static void init() {
9393
S.NonCommutativeMultiply
9494
.setEvaluator(new org.matheclipse.core.reflection.system.NonCommutativeMultiply());
9595
S.NSolve.setEvaluator(new org.matheclipse.core.reflection.system.NSolve());
96+
S.NSum.setEvaluator(new org.matheclipse.core.reflection.system.NSum());
9697
S.NumberLinePlot.setEvaluator(new org.matheclipse.core.reflection.system.NumberLinePlot());
9798

9899
S.Out.setEvaluator(new org.matheclipse.core.reflection.system.Out());

0 commit comments

Comments
 (0)