let log2 b = (log10 b) /. (log10 2.)

let () =
  let n, k = Scanf.scanf "%d %d\n" (fun n k -> n, k) in
  let sum = ref 0. in
  for i = 1 to n do
    let n, k = float_of_int n, float_of_int k in
    let i' = float_of_int i in
    let cnt = let v = log2 (k /. i') in if v < 0. then 0. else v in
    let cnt = ceil cnt in
    let p = (0.5 ** cnt) /. n in
    sum := !sum +. p
  done;
  !sum |> print_float
