verisimiltude - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of verisimiltude.php

  1. <?php
  2.  
  3. $pi= 3.1416;
  4. $sd = 10;
  5. $mean = 20; // cambiar esto pr ej. (30,40,50,60)
  6.  
  7. $answer = [];
  8. foreach ([38.6, 42.4, 57.5, 40.5, 51.7, 67.1, 33.4, 60.9, 64.1, 40.1, 40.7, 6.4 ] as $val){
  9.     $value =  exp(-1/2* pow((($val-$mean)/$sd ),2));
  10.     array_push($answer,$value);
  11.  
  12. }
  13.  $value2 = 1/sqrt(2*$pi*$sd);
  14. array_push($answer,$value2);
  15. //print_r($answer);
  16. echo array_product($answer);
File Description
  • verisimiltude
  • PHP Code
  • 18 Nov-2017
  • 381 Bytes
You can Share it: