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

answer=0

for i in range(n):

  j=1

  while (i+1)*j<k:

    j*=2

  answer+=1/j*1/n

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

m=0

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

  l=k

  j=0

  while l>i:

    l/=2

    j+=1

  m+=1/n*((1/2)**j)

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

n, k = list(map(int, input().split()))
m = 0
for i in range(1, n + 1):
    l = k
    j = 0
    while l > i:
        l /= 2
        j += 1
    m += 1 / n * ((1 / 2) ** j)
print(m)

-answer = 0 -for i in range(n): -    j = 1 -    while (i + 1) * j < k: -        j *= 2 -    answer += 1 / j * 1 / n -print(answer) +m = 0 +for i in range(1, n + 1): +    l = k +    j = 0 +    while l > i: +        l /= 2 +        j += 1 +    m += 1 / n * ((1 / 2) ** j) +print(m)