let information list =
let n = float (List.length list) in
let freqs = frequencies list in
let probabilities = List.map (fun (_,freq) -> float freq /. n) freqs in
List.fold_left (fun accu proba -> accu -. (proba *. log proba)) 0. probabilities