import math



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



p = 0.0



for i in range(n):

  i += 1

  num_required = 0.0

  if i < k:

    num_required = math.ceil(math.log2(k / i))

  p += 0.5 ** num_required



p /= n

print(p)
#!/usr/bin/env python

import bisect

from collections import defaultdict

import math



def main():

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



    prob = 0

    for n in range(N):

        n += 1

        if n >= K:

            p = 1.0

        else:

            min_val = math.ceil(math.log2(K / n))

            p = 0.5 ** min_val

        prob += p



    print((prob / N))



if __name__ == '__main__':

    main()

import math

n, k = list(map(int, input().split()))
p = 0.0
for i in range(n):
    i += 1
    num_required = 0.0
    if i < k:
        num_required = math.ceil(math.log2(k / i))
    p += 0.5**num_required
p /= n
print(p)

#!/usr/bin/env python
import bisect
from collections import defaultdict
import math


def main():
    N, K = list(map(int, input().split()))
    prob = 0
    for n in range(N):
        n += 1
        if n >= K:
            p = 1.0
        else:
            min_val = math.ceil(math.log2(K / n))
            p = 0.5**min_val
        prob += p
    print((prob / N))


if __name__ == "__main__":
    main()

+#!/usr/bin/env python +import bisect +from collections import defaultdict -n, k = list(map(int, input().split())) -p = 0.0 -for i in range(n): -    i += 1 -    num_required = 0.0 -    if i < k: -        num_required = math.ceil(math.log2(k / i)) -    p += 0.5**num_required -p /= n -print(p) + +def main(): +    N, K = list(map(int, input().split())) +    prob = 0 +    for n in range(N): +        n += 1 +        if n >= K: +            p = 1.0 +        else: +            min_val = math.ceil(math.log2(K / n)) +            p = 0.5**min_val +        prob += p +    print((prob / N)) + + +if __name__ == "__main__": +    main()