from sys import stdin



n,k = [int(x) for x in stdin.readline().rstrip().split()]



point = 0

kaku = 0.0



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

    point = 0

    point += i

    kaisu = 0

    while 0 < point < k:

        kaisu += 1

        point *= 2

    kaku += (1/n)*(1/(2**kaisu))

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

point = 0



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

    j = 1/n

    if i >= k:

        point += j

        continue

    now = i

    count = 0

    while now < k:

        now *= 2

        count += 1

    j *= (1/2)**count

    point += j

    

print(point)
from sys import stdin

n, k = [int(x) for x in stdin.readline().rstrip().split()]
point = 0
kaku = 0.0
for i in range(1, n + 1):
    point = 0
    point += i
    kaisu = 0
    while 0 < point < k:
        kaisu += 1
        point *= 2
    kaku += (1 / n) * (1 / (2**kaisu))
print(kaku)

n, k = list(map(int, input().split()))
point = 0
for i in range(1, n + 1):
    j = 1 / n
    if i >= k:
        point += j
        continue
    now = i
    count = 0
    while now < k:
        now *= 2
        count += 1
    j *= (1 / 2) ** count
    point += j
print(point)

-from sys import stdin - -n, k = [int(x) for x in stdin.readline().rstrip().split()] +n, k = list(map(int, input().split())) -kaku = 0.0 -    point = 0 -    point += i -    kaisu = 0 -    while 0 < point < k: -        kaisu += 1 -        point *= 2 -    kaku += (1 / n) * (1 / (2**kaisu)) -print(kaku) +    j = 1 / n +    if i >= k: +        point += j +        continue +    now = i +    count = 0 +    while now < k: +        now *= 2 +        count += 1 +    j *= (1 / 2) ** count +    point += j +print(point)