I hereby claim:
- I am drupol on github.
- I am poldellaiera (https://keybase.io/poldellaiera) on keybase.
- I have a public key ASB7pOkMHfoK_ZG9iDDpkbmAoD9N3G1lJqgJruj93a3Crgo
To claim this, I am signing this object:
| license: gpl-3.0 |
| license: gpl-3.0 |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| /** | |
| * Find the number e (2.7182818284590452354 => M_E constant in PHP). | |
| * | |
| * To find the number e using permutations: | |
| * 1: Generate a set of size S of random values, | |
| * 2: Find the number of permutations of that set, let it be #P0, | |
| * 3: With all the permutations of this set, let #P1 the count of the permutations where | |
| * any items are not at the same index as in the original input, | |
| * 4: Divide #P0 by #P1, that's your approximation, |
| license: gpl-3.0 |
| license: gpl-3.0 |
| <?php | |
| declare(strict_types=1); | |
| include 'vendor/autoload.php'; | |
| use drupol\collection\Collection; | |
| // The Collatz conjecture (https://en.wikipedia.org/wiki/Collatz_conjecture) | |
| $collatz = static function (int $initial = 1): int |
| <?php | |
| declare(strict_types=1); | |
| use drupol\launcher\Launcher; | |
| use drupol\phptree\Exporter\Image; | |
| use drupol\phpmerkle\Hasher\DummyHasher; | |
| use drupol\phptree\Node\MerkleNode; | |
| include './vendor/autoload.php'; |
| <?php | |
| declare(strict_types=1); | |
| use drupol\launcher\Launcher; | |
| use drupol\phptree\Exporter\Image; | |
| use drupol\phptree\Importer\SimpleArray; | |
| include './vendor/autoload.php'; |
| <?php | |
| declare(strict_types=1); | |
| include 'vendor/autoload.php'; | |
| use loophp\collection\Collection; | |
| $monteCarloMethod = static function ($in = 0, $total = 1) { | |
| $randomNumber1 = mt_rand() / mt_getrandmax(); |