from decimal import Decimal

from fractions import Fraction

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



prob = []



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

  p = 0

  while (base < k):

    p += 1

    base = base * 2

  prob.append(Fraction(1, n * (2 ** p)))

print((Decimal(sum(prob).numerator / sum(prob).denominator)))

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



result = 0

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

    score = i

    sub_prob_recip = N

    while score < K:

        sub_prob_recip *= 2

        score *= 2

    result += 1/sub_prob_recip



print(result)

from decimal import Decimal
from fractions import Fraction

n, k = list(map(int, input().split()))
prob = []
for base in range(1, n + 1):
    p = 0
    while base < k:
        p += 1
        base = base * 2
    prob.append(Fraction(1, n * (2**p)))
print((Decimal(sum(prob).numerator / sum(prob).denominator)))

N, K = list(map(int, input().split()))
result = 0
for i in range(1, N + 1):
    score = i
    sub_prob_recip = N
    while score < K:
        sub_prob_recip *= 2
        score *= 2
    result += 1 / sub_prob_recip
print(result)

-from decimal import Decimal -from fractions import Fraction - -n, k = list(map(int, input().split())) -prob = [] -for base in range(1, n + 1): -    p = 0 -    while base < k: -        p += 1 -        base = base * 2 -    prob.append(Fraction(1, n * (2**p))) -print((Decimal(sum(prob).numerator / sum(prob).denominator))) +N, K = list(map(int, input().split())) +result = 0 +for i in range(1, N + 1): +    score = i +    sub_prob_recip = N +    while score < K: +        sub_prob_recip *= 2 +        score *= 2 +    result += 1 / sub_prob_recip +print(result)