import math



inputted = list(map(int, input().split()))

N = inputted[0]

K = inputted[1]



num_of_rolls = lambda dice, K: max(0, math.ceil(math.log2(K / dice)))

continius_probability = lambda rolls: (1 / 2) ** rolls

dice_probablility = lambda N: 1 / N



answer = 0

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

    answer += continius_probability(num_of_rolls(dice, K))

answer *= dice_probablility(N)



print(answer)

import math



inputted = list(map(int, input().split()))

N = inputted[0]

K = inputted[1]



num_of_rolls = lambda dice, K: max(0, math.ceil(math.log2(K / dice)))

continius_probability = lambda rolls: (1 / 2) ** rolls

dice_probablility = lambda N: 1 / N



answer = sum([continius_probability(num_of_rolls(dice, K)) for dice in range(1, N + 1)])

answer *= dice_probablility(N)



print(answer)

import math

inputted = list(map(int, input().split()))
N = inputted[0]
K = inputted[1]
num_of_rolls = lambda dice, K: max(0, math.ceil(math.log2(K / dice)))
continius_probability = lambda rolls: (1 / 2) ** rolls
dice_probablility = lambda N: 1 / N
answer = 0
for dice in range(1, N + 1):
    answer += continius_probability(num_of_rolls(dice, K))
answer *= dice_probablility(N)
print(answer)

import math

inputted = list(map(int, input().split()))
N = inputted[0]
K = inputted[1]
num_of_rolls = lambda dice, K: max(0, math.ceil(math.log2(K / dice)))
continius_probability = lambda rolls: (1 / 2) ** rolls
dice_probablility = lambda N: 1 / N
answer = sum([continius_probability(num_of_rolls(dice, K)) for dice in range(1, N + 1)])
answer *= dice_probablility(N)
print(answer)

-answer = 0 -for dice in range(1, N + 1): -    answer += continius_probability(num_of_rolls(dice, K)) +answer = sum([continius_probability(num_of_rolls(dice, K)) for dice in range(1, N + 1)])