n,k = list(map(int,input().split()))



ans = 0

for i in range(1,n+1):

	y = 0

	while i*2**y < k:

		y +=1

	else:

		ans += (1/2)**y*1/n

print(ans)
n, k = list(map(int, input().split()))



ans = 0

for i in range(1,n+1):

	a = i

	x = 0

	while a < k:

		x += 1

		a = a * 2

	ans += (1/n)*(1/2)**x

print(ans)
n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    y = 0
    while i * 2**y < k:
        y += 1
    else:
        ans += (1 / 2) ** y * 1 / n
print(ans)

n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    a = i
    x = 0
    while a < k:
        x += 1
        a = a * 2
    ans += (1 / n) * (1 / 2) ** x
print(ans)

-    y = 0 -    while i * 2**y < k: -        y += 1 -    else: -        ans += (1 / 2) ** y * 1 / n +    a = i +    x = 0 +    while a < k: +        x += 1 +        a = a * 2 +    ans += (1 / n) * (1 / 2) ** x