import sys

from itertools import combinations, permutations, product, combinations_with_replacement, accumulate

from heapq import heapify, heappop, heappush, heappushpop

from bisect import bisect_left, bisect_right

from collections import Counter, defaultdict, deque

from math import sqrt, log, floor, ceil, factorial, cos, sin, pi #, gcd

from fractions import gcd

from operator import mul

from functools import reduce

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

INF = float('inf')

LINF = 2**63-1

NIL = -LINF

MOD = 10**9+7

MGN = 4

def AST(exp: bool, msg: str = ""): assert exp, msg

def TAST(exp: bool, msg = ""):

    if exp is False: print("TAssertionError:", msg)

    while exp is False:

        pass

def EPR(msg = ""): print(msg, file=sys.stderr)

def II(): return int(input())

def IF(): return float(input())

def IS(): return input().replace('\n', '')

def ILCI(n: int): return [II() for _ in range(n)]

def ILCF(n: int): return [IF() for _ in range(n)]

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

def ILLI(n: int): return [[int(j) for j in input().split()] for i in range(n)]

def ILF(): return list(map(float, input().split()))

def ILLF(n: int): return [[float(j) for j in input().split()] for i in range(n)]

def LTOS(lst: list, sep: str = ' '): return sep.join(map(str, lst))

def DEC(lst: list): return list(map(lambda x: x-1, lst))

def INC(lst: list): return list(map(lambda x: x+1, lst))





def main():

    N, K = ILI()



    ans = 0.0

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

        scr = i  # 現在のスコア

        pb = 1.0  # 現在のスコアとなる確率

        win = True  # 勝ち続けているか

        while True:

            if K <= scr:  # 勝ち

                EPR(scr)

                break

            elif 0 < scr < K:

                scr *= 2

                pb *= 0.5

            else:  # 負け

                scr = 0

                win = False

                break

        if win:

            ans += pb / N



    print("{:.12}".format(ans))





if __name__ == '__main__':

    main()

import sys

from itertools import combinations, permutations, product, combinations_with_replacement, accumulate

from heapq import heapify, heappop, heappush, heappushpop

from bisect import bisect_left, bisect_right

from collections import Counter, defaultdict, deque

from math import sqrt, log, floor, ceil, factorial, cos, sin, pi #, gcd

from fractions import gcd

from operator import mul

from functools import reduce

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

INF = float('inf')

LINF = 2**63-1

NIL = -LINF

MOD = 10**9+7

MGN = 4

def AST(exp: bool, msg: str = ""): assert exp, msg

def TAST(exp: bool, msg = ""):

    if exp is False: print("TAssertionError:", msg)

    while exp is False:

        pass

def EPR(msg): print(msg, file=sys.stderr)

def II(): return int(input())

def IF(): return float(input())

def IS(): return input().replace('\n', '')

def ILCI(n: int): return [II() for _ in range(n)]

def ILCF(n: int): return [IF() for _ in range(n)]

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

def ILLI(n: int): return [[int(j) for j in input().split()] for i in range(n)]

def ILF(): return list(map(float, input().split()))

def ILLF(n: int): return [[float(j) for j in input().split()] for i in range(n)]

def LTOS(lst: list, sep: str = ' '): return sep.join(map(str, lst))

def DEC(lst: list): return list(map(lambda x: x-1, lst))

def INC(lst: list): return list(map(lambda x: x+1, lst))





def main():

    N, K = ILI()



    ans = 0.0

    for i in range(1,N+1):  # サイコロの出た目

        scr = i  # 現在のスコア

        pb = 1.0  # 現在のスコアとなる確率

        if K <= scr:  # 最初から勝っていたら

            ans += pb/N

            continue



        # n 回コインを投げて勝ち続けると得点は

        # scr * 2**n

        # 勝ちとなるのは

        # scr * 2**n >= K

        n = ceil(log(K/scr, 2))

        

        ans += pow(0.5, n) / N



    print("{:.12}".format(ans))





if __name__ == '__main__':

    main()

import sys
from itertools import (
    combinations,
    permutations,
    product,
    combinations_with_replacement,
    accumulate,
)
from heapq import heapify, heappop, heappush, heappushpop
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from math import sqrt, log, floor, ceil, factorial, cos, sin, pi  # , gcd
from fractions import gcd
from operator import mul
from functools import reduce

sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float("inf")
LINF = 2**63 - 1
NIL = -LINF
MOD = 10**9 + 7
MGN = 4


def AST(exp: bool, msg: str = ""):
    assert exp, msg


def TAST(exp: bool, msg=""):
    if exp is False:
        print("TAssertionError:", msg)
    while exp is False:
        pass


def EPR(msg=""):
    print(msg, file=sys.stderr)


def II():
    return int(input())


def IF():
    return float(input())


def IS():
    return input().replace("\n", "")


def ILCI(n: int):
    return [II() for _ in range(n)]


def ILCF(n: int):
    return [IF() for _ in range(n)]


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


def ILLI(n: int):
    return [[int(j) for j in input().split()] for i in range(n)]


def ILF():
    return list(map(float, input().split()))


def ILLF(n: int):
    return [[float(j) for j in input().split()] for i in range(n)]


def LTOS(lst: list, sep: str = " "):
    return sep.join(map(str, lst))


def DEC(lst: list):
    return list(map(lambda x: x - 1, lst))


def INC(lst: list):
    return list(map(lambda x: x + 1, lst))


def main():
    N, K = ILI()
    ans = 0.0
    for i in range(1, N + 1):
        scr = i  # 現在のスコア
        pb = 1.0  # 現在のスコアとなる確率
        win = True  # 勝ち続けているか
        while True:
            if K <= scr:  # 勝ち
                EPR(scr)
                break
            elif 0 < scr < K:
                scr *= 2
                pb *= 0.5
            else:  # 負け
                scr = 0
                win = False
                break
        if win:
            ans += pb / N
    print("{:.12}".format(ans))


if __name__ == "__main__":
    main()

import sys
from itertools import (
    combinations,
    permutations,
    product,
    combinations_with_replacement,
    accumulate,
)
from heapq import heapify, heappop, heappush, heappushpop
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from math import sqrt, log, floor, ceil, factorial, cos, sin, pi  # , gcd
from fractions import gcd
from operator import mul
from functools import reduce

sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float("inf")
LINF = 2**63 - 1
NIL = -LINF
MOD = 10**9 + 7
MGN = 4


def AST(exp: bool, msg: str = ""):
    assert exp, msg


def TAST(exp: bool, msg=""):
    if exp is False:
        print("TAssertionError:", msg)
    while exp is False:
        pass


def EPR(msg):
    print(msg, file=sys.stderr)


def II():
    return int(input())


def IF():
    return float(input())


def IS():
    return input().replace("\n", "")


def ILCI(n: int):
    return [II() for _ in range(n)]


def ILCF(n: int):
    return [IF() for _ in range(n)]


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


def ILLI(n: int):
    return [[int(j) for j in input().split()] for i in range(n)]


def ILF():
    return list(map(float, input().split()))


def ILLF(n: int):
    return [[float(j) for j in input().split()] for i in range(n)]


def LTOS(lst: list, sep: str = " "):
    return sep.join(map(str, lst))


def DEC(lst: list):
    return list(map(lambda x: x - 1, lst))


def INC(lst: list):
    return list(map(lambda x: x + 1, lst))


def main():
    N, K = ILI()
    ans = 0.0
    for i in range(1, N + 1):  # サイコロの出た目
        scr = i  # 現在のスコア
        pb = 1.0  # 現在のスコアとなる確率
        if K <= scr:  # 最初から勝っていたら
            ans += pb / N
            continue
        # n 回コインを投げて勝ち続けると得点は
        # scr * 2**n
        # 勝ちとなるのは
        # scr * 2**n >= K
        n = ceil(log(K / scr, 2))
        ans += pow(0.5, n) / N
    print("{:.12}".format(ans))


if __name__ == "__main__":
    main()

-def EPR(msg=""): +def EPR(msg): -    for i in range(1, N + 1): +    for i in range(1, N + 1):  # サイコロの出た目 -        win = True  # 勝ち続けているか -        while True: -            if K <= scr:  # 勝ち -                EPR(scr) -                break -            elif 0 < scr < K: -                scr *= 2 -                pb *= 0.5 -            else:  # 負け -                scr = 0 -                win = False -                break -        if win: +        if K <= scr:  # 最初から勝っていたら +            continue +        # n 回コインを投げて勝ち続けると得点は +        # scr * 2**n +        # 勝ちとなるのは +        # scr * 2**n >= K +        n = ceil(log(K / scr, 2)) +        ans += pow(0.5, n) / N