import math

N, K = list(map(int, input().split()))



t = []



if K > N:

  max = N

  for i in range(max):

    t.append(math.ceil((math.log10(K) - math.log10(i+1))/math.log10(2)))

else:

  max = K

  for i in range(max):

    t.append(math.ceil((math.log10(K) - math.log10(i+1))/math.log10(2)))

  for i in range(N - K):

    t.append(0)



Answer_n = 0

for item in t:

  Answer_n += 0.5**item



Answer = Answer_n / N



print(Answer)

import math

N, K = list(map(int, input().split()))

prob = []

for i in range(N):

  if i+1 >= K:

    prob.append(1)

  else:

    temp = i+1

    x = 0

    while temp < K:

      temp *=2

      x += 1

    prob.append(0.5**x)

Answer = sum(prob)/N



print(Answer)
import math

N, K = list(map(int, input().split()))
t = []
if K > N:
    max = N
    for i in range(max):
        t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2)))
else:
    max = K
    for i in range(max):
        t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2)))
    for i in range(N - K):
        t.append(0)
Answer_n = 0
for item in t:
    Answer_n += 0.5**item
Answer = Answer_n / N
print(Answer)

import math

N, K = list(map(int, input().split()))
prob = []
for i in range(N):
    if i + 1 >= K:
        prob.append(1)
    else:
        temp = i + 1
        x = 0
        while temp < K:
            temp *= 2
            x += 1
        prob.append(0.5**x)
Answer = sum(prob) / N
print(Answer)

-t = [] -if K > N: -    max = N -    for i in range(max): -        t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2))) -else: -    max = K -    for i in range(max): -        t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2))) -    for i in range(N - K): -        t.append(0) -Answer_n = 0 -for item in t: -    Answer_n += 0.5**item -Answer = Answer_n / N +prob = [] +for i in range(N): +    if i + 1 >= K: +        prob.append(1) +    else: +        temp = i + 1 +        x = 0 +        while temp < K: +            temp *= 2 +            x += 1 +        prob.append(0.5**x) +Answer = sum(prob) / N