program dice_and_coin
  implicit none
  integer :: n, k, d, i, j
  real(8) :: x = 0.d0, p
  character(64) :: s
  read(*,*) n, k
  do i = 1, n
    d = i
    p = 1.d0
    do while (d < k)
      d = lshift(d,1)
      p = 0.5d0*p
    end do
    x = x+p
  end do
  write(s,'(f32.16)') x/real(n,8)
  write(*,'(a)') trim(adjustl(s))
end program dice_and_coin