PROGRAM ATCODER

implicit none
integer :: i=0,n,k,s,c1,c2,r(17),r0
real(8) :: ans=0.d0,a(17)

r = 0
a = 0

read*, n,k

c1 = n
s = 1

if ( n >= k ) then
  r0 = n - k + 1
  c1 = k
end if

do
  i = i + 1
  if ( s > k  ) exit
  s = s*2
  c2 = k/s
  if ( mod(k,s) /= 0 ) then
    c2 = c2 + 1
  end if
  if ( c2 > n ) cycle
  r(i) = c1 - c2
  if ( c1 == c2 ) then
    r(i) = 1
  end if
  c1 = c2
end do

ans = (1.d0/real(n,8))*real(r0,8)

do i = 1, 17, 1
  if ( r(i) == 0.d0 ) cycle
  a(i) = ((1.d0/real(n,8))*(0.5d0)**real(i,8))*real(r(i),8)
  ans = ans + a(i)
end do

write(*,'(i0,f0.10)') 0,ans

END PROGRAM ATCODER