let log2 n = log n /. log 2.

let _ =
  Scanf.scanf "%d %d" @@ fun n k ->
    let sum = ref 0. in
    let n' = float n in
    let k' = float k in
    for i = 1 to n do
      let p = max 0. (log2 (k' /. float i)) |> ceil in
      sum := !sum +. 1. /. n' *. (0.5 ** p)
    done;
    Printf.printf "%.12f\n" !sum