import sys



def solve():

    input = sys.stdin.readline

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

    P = 0

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

        coins = 0

        k = i

        while k < K:

            coins += 1

            k *= 2

        P += pow(0.5, coins) / N

    print(P)



    return 0



if __name__ == "__main__":

    solve()
import sys



def solve():

    input = sys.stdin.readline

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

    possible = 0

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

        this_poss = 1

        if i < K:

            t = i

            while t < K:

                this_poss *= 0.5

                t *= 2

        possible += this_poss / N

    print(possible)



    return 0



if __name__ == "__main__":

    solve()
import sys


def solve():
    input = sys.stdin.readline
    N, K = list(map(int, input().split()))
    P = 0
    for i in range(1, N + 1):
        coins = 0
        k = i
        while k < K:
            coins += 1
            k *= 2
        P += pow(0.5, coins) / N
    print(P)
    return 0


if __name__ == "__main__":
    solve()

import sys


def solve():
    input = sys.stdin.readline
    N, K = list(map(int, input().split()))
    possible = 0
    for i in range(1, N + 1):
        this_poss = 1
        if i < K:
            t = i
            while t < K:
                this_poss *= 0.5
                t *= 2
        possible += this_poss / N
    print(possible)
    return 0


if __name__ == "__main__":
    solve()

-    P = 0 +    possible = 0 -        coins = 0 -        k = i -        while k < K: -            coins += 1 -            k *= 2 -        P += pow(0.5, coins) / N -    print(P) +        this_poss = 1 +        if i < K: +            t = i +            while t < K: +                this_poss *= 0.5 +                t *= 2 +        possible += this_poss / N +    print(possible)