Skip to content

Commit 23f77f5

Browse files
committed
0.2.1 statHelpers
1 parent 07a107a commit 23f77f5

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

libraries/statHelpers/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.2.1] - 2025-06-02
10+
- minor edits readme.md
11+
912
## [0.2.0] - 2024-01-06
1013
- add **skipFactorial(n, skip);** experimental
1114
- Fix URL in examples

libraries/statHelpers/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2010-2024 Rob Tillaart
3+
Copyright (c) 2010-2025 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

libraries/statHelpers/README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ To print very large numbers - https://github.com/RobTillaart/PrintHelpers
3131
- https://github.com/RobTillaart/Correlation
3232
- https://github.com/RobTillaart/GST - Golden standard test metrics
3333
- https://github.com/RobTillaart/Histogram
34+
- https://github.com/RobTillaart/infiniteAverage
3435
- https://github.com/RobTillaart/RunningAngle
3536
- https://github.com/RobTillaart/RunningAverage
3637
- https://github.com/RobTillaart/RunningMedian
3738
- https://github.com/RobTillaart/statHelpers - combinations & permutations
3839
- https://github.com/RobTillaart/Statistic
40+
- https://github.com/RobTillaart/Student
3941

4042

4143
## Interface
@@ -56,7 +58,8 @@ The limits mentioned is the n for which all k still work.
5658

5759
If you need a larger n but k is near 0 the functions will still work.
5860
To which value of k the formulas work differs per value for n.
59-
No formula found, and build in an overflow detection takes overhead, so that is not done.
61+
No formula found, and to build in an overflow detection takes extra overhead,
62+
so that is not implemented.
6063

6164

6265
- **nextPermutation<Type>(array, size)** given an array of type T it finds the next permutation
@@ -69,7 +72,7 @@ other same code examples exist.
6972

7073
- **uint32_t factorial(n)** exact up to n = 12.
7174
- **uint64_t factorial64(n)** exact up to n = 20. (Print 64 bit integers with my printHelpers)
72-
- **double dfactorial(n)** not exact up to n = 34 (4 byte) or n = 170 (8 byte).
75+
- **double dfactorial(n)** not exact up to n = 34. (double == 4 byte) or n = 170 (double == 8 byte).
7376
- **double stirling(n)** approximation function for factorial (right magnitude).
7477
Constant run-time.
7578

@@ -108,12 +111,14 @@ This formula allows to calculate the value of n! indirectly.
108111
- **double dSkipFactorial(uint32_t n, uint32_t skip)**
109112

110113
SkipFactorials are like factorials and semiFactorials but they skip **skip** numbers.
114+
Thus skipFactorial(n, 2) is the same as semiFactorial(n).
115+
111116
- **skipFactorial(12, 4)** = 12 x 8 x 4 = 384
112117
- **skipFactorial(17, 5)** = 17 x 12 x 7 x 2 = 2856
113118
- **skipFactorial(n, 1)** == **factorial(n)**
114119
- **skipFactorial(n, 2)** == **semiFactorial(n)**
115120

116-
As the maximum depends on both n and step sizze there is no single maximum for n.
121+
As the maximum depends on both n and step size there is no single maximum for n.
117122
This is similar to combinations and permutations.
118123

119124
An indicative table of maxima per function call, the larger the skip, the larger the maximum n.
@@ -127,6 +132,7 @@ Note that for skip <= 10 n still is an 8 bit number.
127132
| dSkipFactorial | 300 | | | | | double (8 bytes)
128133

129134
Note that for the function the **max / skip** is decreasing when **skip grows**.
135+
Expectation is that **max** roughly doubles when **skip** doubles (to be investigated).
130136

131137

132138
### Combinations
@@ -148,20 +154,20 @@ No formula found, and build in an overflow detection takes overhead, so that is
148154

149155

150156
- **combPascal(n, k)** n = 0 .. 30 but due to double recursion per iteration it takes
151-
time and a lot of it for larger values. Added for recreational purposes, limited tested.
152-
Uses Pascal's triangle.
157+
time and a lot of it for larger values. Added for recreational / educational purposes.
158+
The function is only tested for small values. Uses Pascal's triangle.
153159

154160

155161
## Notes
156162

157-
- **perm1** is a sketch in the examples that shows a recursive permutation algorithm.
163+
- **perm1.ino** is a sketch in the examples that shows a recursive permutation algorithm.
158164
It generates all permutations of a given char string and allows you to process every instance.
159165
This sketch is added to this library as it fits in the context.
160166

161167

162168
## Experimental
163169

164-
#### 32 bit numbers
170+
### 32 bit numbers
165171

166172
- **void bigFactorial(uint32_t n, double &mantissa, uint32_t &exponent)**
167173
returns a double mantissa between 0 and 10, and an integer exponent.
@@ -184,7 +190,7 @@ Not investigated what its maximum value is, but it should be higher than **51867
184190
of combinations is always smaller than number of permutations.
185191

186192

187-
#### 64 bit numbers- not investigated
193+
### 64 bit numbers- not investigated
188194

189195
To have support for huge numbers one could upgrade the code to use uint64_t as parameter and
190196
internally but calculating these values could take a lot of time, although **bigPermutations64(n, k)**

libraries/statHelpers/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/statHelpers.git"
1717
},
18-
"version": "0.2.0",
18+
"version": "0.2.1",
1919
"license": "MIT",
2020
"frameworks": "*",
2121
"platforms": "*",

libraries/statHelpers/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=statHelpers
2-
version=0.2.0
2+
version=0.2.1
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library with a number of statistic helper functions.

libraries/statHelpers/statHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: statHelpers.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.2.0
4+
// VERSION: 0.2.1
55
// PURPOSE: Arduino library with a number of statistic helper functions.
66
// DATE: 2020-07-01
77
// URL: https://github.com/RobTillaart/statHelpers

libraries/statHelpers/statHelpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: statHelpers.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.2.0
5+
// VERSION: 0.2.1
66
// PURPOSE: Arduino library with a number of statistic helper functions.
77
// DATE: 2020-07-01
88
// URL: https://github.com/RobTillaart/statHelpers
@@ -11,7 +11,7 @@
1111
#include "Arduino.h"
1212

1313

14-
#define STATHELPERS_LIB_VERSION (F("0.2.0"))
14+
#define STATHELPERS_LIB_VERSION (F("0.2.1"))
1515

1616

1717
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)