# https://atcoder.jp/contests/abc126/tasks/abc126_c

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



probs = []

keisuu = 1 / N

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

    score = dice

    cnt = 0

    while score < K:

        score *= 2

        cnt += 1

    probs.append(keisuu * (1 / 2)**cnt)





print((sum(probs)))

import sys

sys.setrecursionlimit(1 << 25)

read = sys.stdin.readline

ra = range

enu = enumerate





def read_ints():

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





def read_a_int():

    return int(read())





def read_tuple(H):

    '''

    H is number of rows

    '''

    ret = []

    for _ in range(H):

        ret.append(tuple(map(int, read().split())))

    return ret





def read_col(H):

    '''

    H is number of rows

    A列、B列が与えられるようなとき

    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合

    '''

    ret = []

    for _ in range(H):

        ret.append(list(map(int, read().split())))

    return tuple(map(list, list(zip(*ret))))





def read_matrix(H):

    '''

    H is number of rows

    '''

    ret = []

    for _ in range(H):

        ret.append(list(map(int, read().split())))

    return ret

    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため





MOD = 10**9 + 7

INF = 2**31  # 2147483648 > 10**9

# default import

from collections import defaultdict, Counter, deque

from operator import itemgetter

from itertools import product, permutations, combinations

from bisect import bisect_left, bisect_right  # , insort_left, insort_right



# https://atcoder.jp/contests/abc126/tasks/abc126_c

# 最初のサイコロでコインを最大何回降るか決まる

# 最大表が出続ける確率がすぬけくんの勝つ確率

# はじめにサイコロの確率も考慮したい



N, K = read_ints()

mul = 1 / N

ans = 0

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

    n_coin = 0

    prob_win = 1

    while i < K:

        i *= 2

        prob_win /= 2

    ans += prob_win

print((ans * mul))

# https://atcoder.jp/contests/abc126/tasks/abc126_c
N, K = list(map(int, input().split()))
probs = []
keisuu = 1 / N
for dice in range(1, N + 1):
    score = dice
    cnt = 0
    while score < K:
        score *= 2
        cnt += 1
    probs.append(keisuu * (1 / 2) ** cnt)
print((sum(probs)))

import sys

sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    """
    H is number of rows
    """
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    """
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    """
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, list(zip(*ret))))


def read_matrix(H):
    """
    H is number of rows
    """
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc126/tasks/abc126_c
# 最初のサイコロでコインを最大何回降るか決まる
# 最大表が出続ける確率がすぬけくんの勝つ確率
# はじめにサイコロの確率も考慮したい
N, K = read_ints()
mul = 1 / N
ans = 0
for i in ra(1, N + 1):
    n_coin = 0
    prob_win = 1
    while i < K:
        i *= 2
        prob_win /= 2
    ans += prob_win
print((ans * mul))

+import sys + +sys.setrecursionlimit(1 << 25) +read = sys.stdin.readline +ra = range +enu = enumerate + + +def read_ints(): +    return list(map(int, read().split())) + + +def read_a_int(): +    return int(read()) + + +def read_tuple(H): +    """ +    H is number of rows +    """ +    ret = [] +    for _ in range(H): +        ret.append(tuple(map(int, read().split()))) +    return ret + + +def read_col(H): +    """ +    H is number of rows +    A列、B列が与えられるようなとき +    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合 +    """ +    ret = [] +    for _ in range(H): +        ret.append(list(map(int, read().split()))) +    return tuple(map(list, list(zip(*ret)))) + + +def read_matrix(H): +    """ +    H is number of rows +    """ +    ret = [] +    for _ in range(H): +        ret.append(list(map(int, read().split()))) +    return ret +    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため + + +MOD = 10**9 + 7 +INF = 2**31  # 2147483648 > 10**9 +# default import +from collections import defaultdict, Counter, deque +from operator import itemgetter +from itertools import product, permutations, combinations +from bisect import bisect_left, bisect_right  # , insort_left, insort_right + -N, K = list(map(int, input().split())) -probs = [] -keisuu = 1 / N -for dice in range(1, N + 1): -    score = dice -    cnt = 0 -    while score < K: -        score *= 2 -        cnt += 1 -    probs.append(keisuu * (1 / 2) ** cnt) -print((sum(probs))) +# 最初のサイコロでコインを最大何回降るか決まる +# 最大表が出続ける確率がすぬけくんの勝つ確率 +# はじめにサイコロの確率も考慮したい +N, K = read_ints() +mul = 1 / N +ans = 0 +for i in ra(1, N + 1): +    n_coin = 0 +    prob_win = 1 +    while i < K: +        i *= 2 +        prob_win /= 2 +    ans += prob_win +print((ans * mul))