def count_section_by_zero(data):

  count = 0

  flg = False

  start = 0

  for i, d in enumerate(data):

    if flg is False and d != 0:

      count += 1

      flg = True

      

    if d == 0:

      flg = False

  return count



def input_list():

  return list(map(int, input().split()))



def input_list_str():

  return list(map(str, input().split()))



def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)



def lcm_list(numbers):

    return reduce(lcm_base, numbers, 1)



def gcd(*numbers):

    return reduce(fractions.gcd, numbers)



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



def combinations_count(n, r):

    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



# 2で割り切れる回数

def divide_two(arg):

  c = 0

  while True:

    if c >= 2:

      break

    if arg % 2 != 0:

      break

    arg //= 2

    c += 1

  return c



# 素因数分解

def prime_factorize(n):

    a = []

    while n % 2 == 0:

        a.append(2)

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a.append(f)

            n //= f

        else:

            f += 2

    if n != 1:

        a.append(n)

    return a



def main():

  n, k = input_list()

  ans = 0

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

    t = 1.0

    while i < k:

      i *= 2

      t /= 2

    ans += t

  print((ans/n))

  

import math

import fractions

import collections

import itertools

from functools import reduce

main()
# import sys

# input = sys.stdin.readline

import collections

import itertools



def main():

    n, k = input_list()

    res = 0.0

    for v in range(n):

        i = v + 1

        t = 1.0

        ii = i

        while ii < k:

            ii *= 2

            t /= 2.0

        res += t



    res /= n

    print(res)





def input_list():

    return list(map(int, input().split()))





def input_list_str():

    return list(map(str, input().split()))





if __name__ == "__main__":

    main()

def count_section_by_zero(data):
    count = 0
    flg = False
    start = 0
    for i, d in enumerate(data):
        if flg is False and d != 0:
            count += 1
            flg = True
        if d == 0:
            flg = False
    return count


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


# 2で割り切れる回数
def divide_two(arg):
    c = 0
    while True:
        if c >= 2:
            break
        if arg % 2 != 0:
            break
        arg //= 2
        c += 1
    return c


# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def main():
    n, k = input_list()
    ans = 0
    for i in range(1, n + 1):
        t = 1.0
        while i < k:
            i *= 2
            t /= 2
        ans += t
    print((ans / n))


import math
import fractions
import collections
import itertools
from functools import reduce

main()

# import sys
# input = sys.stdin.readline
import collections
import itertools


def main():
    n, k = input_list()
    res = 0.0
    for v in range(n):
        i = v + 1
        t = 1.0
        ii = i
        while ii < k:
            ii *= 2
            t /= 2.0
        res += t
    res /= n
    print(res)


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

-def count_section_by_zero(data): -    count = 0 -    flg = False -    start = 0 -    for i, d in enumerate(data): -        if flg is False and d != 0: -            count += 1 -            flg = True -        if d == 0: -            flg = False -    return count +# import sys +# input = sys.stdin.readline +import collections +import itertools + + +def main(): +    n, k = input_list() +    res = 0.0 +    for v in range(n): +        i = v + 1 +        t = 1.0 +        ii = i +        while ii < k: +            ii *= 2 +            t /= 2.0 +        res += t +    res /= n +    print(res) -def lcm_base(x, y): -    return (x * y) // fractions.gcd(x, y) - - -def lcm_list(numbers): -    return reduce(lcm_base, numbers, 1) - - -def gcd(*numbers): -    return reduce(fractions.gcd, numbers) - - -def gcd_list(numbers): -    return reduce(fractions.gcd, numbers) - - -def combinations_count(n, r): -    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) - - -# 2で割り切れる回数 -def divide_two(arg): -    c = 0 -    while True: -        if c >= 2: -            break -        if arg % 2 != 0: -            break -        arg //= 2 -        c += 1 -    return c - - -# 素因数分解 -def prime_factorize(n): -    a = [] -    while n % 2 == 0: -        a.append(2) -        n //= 2 -    f = 3 -    while f * f <= n: -        if n % f == 0: -            a.append(f) -            n //= f -        else: -            f += 2 -    if n != 1: -        a.append(n) -    return a - - -def main(): -    n, k = input_list() -    ans = 0 -    for i in range(1, n + 1): -        t = 1.0 -        while i < k: -            i *= 2 -            t /= 2 -        ans += t -    print((ans / n)) - - -import math -import fractions -import collections -import itertools -from functools import reduce - -main() +if __name__ == "__main__": +    main()