Verify distribution uniformity/Naive: Difference between revisions

Content added Content deleted
Line 99: Line 99:
done;
done;
Hashtbl.iter (fun v n -> Printf.printf "%d => %d\n%!" v n) h;
Hashtbl.iter (fun v n -> Printf.printf "%d => %d\n%!" v n) h;
let target = 1.0 *. (float n) /. float (Hashtbl.length h) in
let target = (float n) /. float (Hashtbl.length h) in
Hashtbl.iter (fun key value ->
Hashtbl.iter (fun key value ->
if abs_float(float value -. target) > 0.01 *. delta *. (float n)
if abs_float(float value -. target) > 0.01 *. delta *. (float n)