Created
October 30, 2020 11:52
-
-
Save Yigaue/ac1fb2fa2da90dc77e688087bdc29472 to your computer and use it in GitHub Desktop.
Prosper Permeability algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$permeabilityArray = [9230, 5940, 3080, 2860, 2790, 2370, 1464, 594, 593, 526, 500, 366]; | |
/** | |
* Each number in the array should take turns to divided it self and every other number in the array, | |
* and a number can only divide itself or a number that has index greater than it. | |
* E.g 9230 can divide itself and every other number. 3080 can not divide 5940, and 9230 but can divide | |
* 2860, 2790, 2370, 1464, 594, 593, 526, 500, and 366. | |
* Print result different set of arrays. | |
*/ | |
for ($i = 0; $i < count($permeabilityArray); $i++ ) { | |
$i_data = []; | |
foreach ($permeabilityArray as $index => $permeability) { | |
if ($i <= $index) { | |
$permeability_ratio = $permeability / $permeabilityArray[$i] . ', '; | |
array_push($i_data, $permeability_ratio); | |
} | |
} | |
print_r($i_data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment