let rec solve p i k =
  if k <= i then p
  else solve (0.5 *. p) (2 * i) k

let () = Scanf.scanf "%d %d" @@ fun n k ->
  Printf.printf "%.15f\n" @@
  Array.fold_left ( +. ) 0. @@
  Array.init n @@ fun i -> solve (1. /. float_of_int n) (i + 1) k