fork download
  1. var numCases = 616;
  2. var cobaltProb = 0.001;
  3.  
  4. var calculatedOdds = 1 - Math.pow((1 - cobaltProb), numCases);
  5.  
  6. print("The odds of getting a Cobalt when opening " + numCases + " cases is %" + calculatedOdds*100);
Success #stdin #stdout 0.01s 30152KB
stdin
Standard input is empty
stdout
The odds of getting a Cobalt when opening 616 cases is %46.0065911651493