program sample
    implicit none
    real(8)::p,a
    integer(8) :: i,j,m,n,s,t,t1,t0,k
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n,k
    
    if(n>=k)then
        p=real(n-k+1)
        t=k-1
        s=(k-1)/2
        m=1
    else
        p=0.0
        t=n
        s=(k-1)/2
        m=1
        do while(s>t)
            m=m+1
            s=s/2
        end do

    end if
    do while(t>0)
        p=p+real(t-s)/2**m

        t=s
        s=s/2
        m=m+1
    end do
        
    write(*,*) p/n
  
    stop
end program sample
  

