program main
	implicit none
	integer :: N, K, counter, i, m, N_const
	real(8) :: Right, Left, ans
	read(*, *) N, K
	ans = 0.0d0
	counter = 0
	N_const = N
	if(N > K) then
		ans = ans + dble(N-K+1)  / dble(N_const)
		N   = K
	end if
	do m = 1, 20
		Right = dble(K)*(0.50d0)**(m-1)
		Left  = dble(K)*(0.50d0)**m
		counter = 0
		do i = N, 1, -1
			if(Left <= i .AND. i < Right)then
				counter = counter + 1
			end if
		end do
		ans = ans + (dble(counter)/dble(N_const))*(0.50d0)**m
		N = N - counter
!		write(*, *) Left, Right, ans, N
		if(Left <= 1) then
			exit
		end if
	end do
	write(*, *) ans
end program main