open Printf open Scanf
open Array

let pow_float n k =
  let rec f a n = function
  | 0 -> a | 1 -> n*.a
  | k when k mod 2 = 0 -> f a (n*.n) (k/2) | k -> f (a*.n) (n*.n) (k/2)
  in f 1. n k

let ceildiv p q = (p+q-1) / q
let () = scanf " %d %d" @@ fun n k ->
  let sum = init n (fun v ->
    let v = v+1 in
    let w = (float k) /. (float v) in
    let w = int_of_float @@ ceil @@ log w /. log 2. in
    let f =
      if w>=1 then pow_float 0.5 w
      else 1.
    in
    f /. (float n)
  )
  |> fold_left (+.) 0. in
  printf "%.22f" @@ sum

