let f i k = 
  let res = ref 0 in
  while i * (1 lsl !res) < k do
    res := !res + 1
  done;
  !res
;;

let g n = 0.5 ** n;;

let () = Scanf.scanf "%d %d" (fun n k -> (
  let p = ref 0. in (
    for i = 1 to n do
      p := !p +. ((f i k) |> float_of_int |> g)
    done;
    p := !p /. (float_of_int n);
    print_float !p
  )
))