program main
  implicit none
  integer :: n, k, j
  real(8) :: res
  read (*, *) n, k
  res = 0.0d0
  do j = 1, n
    res = res + 0.5 ** d(j, k)
  end do
  write (*, "(f12.10)") res / dble(n)
  contains
  pure integer function d(j, k)
    integer, intent(in) :: j, k
    do d = 0, 100
      if (2 ** d * j >= k) return
    end do
  end function d
end program main

