 # File: Example.php

 Recommend this page to a friend!
 Classes of stefano dolzi > Combinatorics > Example.php > Download
File: Example.php Example script text/plain Example n.1 Combinatorics Make combinatorial statistics calculations By stefano dolzi 16 years ago 1,791 bytes

## Contents Download
 ``` numPerm(5); echo "Number of possible permutations of 5 objects is " . \$nperms; echo "
"; // Permutations of objects \$perms=\$mycalc->makePermutations(array("A","B","C","D","E")); echo"and they are the followings:
"; foreach(\$perms as \$key=>\$value){ echo \$key .": "; foreach (\$value as \$key2=>\$value2){ echo \$value2; } echo "
"; } // Number combinations of objects without repetition \$ncombwr=\$mycalc->numComb(4,2); echo "Number of possible combinations of 4 objects taken 2 by 2 without repetition is " . \$ncombwr; echo "
"; // Combinations without repetition \$combwr=\$mycalc->makeCombination(array("A","B","C","D"), 2); echo"and they are the followings:
"; foreach(\$combwr as \$key=>\$value){ echo \$key .": "; foreach (\$value as \$key2=>\$value2){ echo \$value2; } echo "
"; } //Number of dispositions of objects \$ndisp=\$mycalc->numDisp(4,3 ); echo "Number of possible dispositions of 4 objects taken 3 by 3 is " . \$ndisp; echo "
"; \$disp=\$mycalc->makeDisposition(array("A","B","C","D"), 3); echo"and they are the followings:
"; foreach(\$disp as \$key=>\$value){ echo \$key .": "; foreach (\$value as \$key2=>\$value2){ echo \$value2; } echo "
"; } \$ndispwr=\$mycalc->numDispWoR(5,3 ); echo "Number of possible dispositions of 5 objects without repetition taken 3 by 3 is ",\$ndispwr ; echo "
"; \$dispwr=\$mycalc->makeDispositionWoR(array("A","B","C","D","E"), 3); echo"and they are the followings:
"; foreach(\$dispwr as \$key=>\$value){ echo \$key .": "; foreach (\$value as \$key2=>\$value2){ echo \$value2; } echo "
"; } ?> ``` Advertise on this site Site map Newsletter Statistics Site tips Privacy policy Contact
For more information send a message to `info at phpclasses dot org`.