29 coaches online • Server time: 07:23
* * * Did you know? The most valuable player is Thursdaynight Guitarclub with 96 MVPs.
Log in
Recent Forum Topics goto Post New Gnones vs Old Gn...goto Post Custom Icon, Portrai...goto Post All Star Bowl!
Bardazur
Last seen 12 years ago
Overall
Rookie
Overall
Record
0/0/0
Win Percentage
n/a
Archive

2011

2011-11-04 21:02:00
rating 5.8
2011-09-02 10:27:14
rating 5
2011-08-04 11:44:36
rating 4.6
2011-08-02 22:15:44
rating 5.1
2011-05-15 09:26:12
rating 5
2011-03-28 22:56:26
rating 5.1
2011-03-19 20:54:01
rating 4.4
2011-02-19 09:03:18
rating 3.7
2011-02-16 19:25:03
rating 5
2011-02-13 21:19:49
rating 5.2
2011-02-09 20:40:28
rating 4.7
2011-02-03 01:22:16
rating 5.1
2011-01-29 14:25:07
rating 4.6
2011-01-24 22:46:05
rating 4.8

2007

2007-12-11 15:04:32
rating 3.6
2007-12-07 20:47:15
rating 5.2
2007-12-03 22:06:26
rating 4
2007-12-03 22:06:26
51 votes, rating 4
Proba calculator
Here is a small OCaml program computing the percentage of succes of a sequence of actions.
The program

let p x = (float (7 - x) /. 6.)
(* conversion difficulty -> probability of success *)

let rec proba_without (rolls_list : int list) : float =
match rolls_list with
[] -> 1.
| h::t -> (p h) *. (proba_without t)

let rec proba_with_rr (rolls_list : int list) : float =
match rolls_list with
[] -> 1.
| h::t -> (p h) *. (proba_with_rr t) +. (1. -. (p h)) *. (proba_without
rolls_list)


let percentage (px : float) : float =
(floor (px *. 1000.))/. 10.
(* conversion probability -> percentage, rounded down with an accuracy of 0.1 % *)



let proba_calculator (rolls_list : int list) (reroll : bool) : float =
if reroll
then percentage (proba_with_rr rolls_list)
else percentage (proba_without rolls_list)


How to use it ?
First you need to run a Ocaml toplevel and load the definitions I gave here. Then you just have to call the function proba_calculator with the list of rolls you must do and wether you have a re-roll or not. the result is the percentage of success, rounded down. If you must roll 2 actions with a 3+ difficulty each, without reroll, just type proba_calculator [ 3 ; 3 ] false and the program will answer 44.4%.

Some examples :
proba_calculator [ 2 ] true
97.2

proba_calculator [ 4 ; 4 ] false
25

proba_calculator [ 3 ; 2 ; 2 ; 3 ] true
61.7
Rate this entry
Comments