from functools import reduce

from math import log2

from operator import mul





def end_of_loop():

    raise StopIteration





def main():

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

    MAX_SHIFT = int(log2(K) + 1)

    print((sum(reduce(mul, (0.5

                           if i << j < K

                           else end_of_loop()

                           for j in range(MAX_SHIFT)), 1)

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

    return





main()

import math





def main():

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

    k = int(math.log2(K)) + 1

    print(((max(0, N - K + 1) + sum(

        max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i

        - max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1 / 2) ** i

        for i in range(1, k + 1))) / N))

    return





main()

from functools import reduce
from math import log2
from operator import mul


def end_of_loop():
    raise StopIteration


def main():
    N, K = list(map(int, input().split()))
    MAX_SHIFT = int(log2(K) + 1)
    print(
        (
            sum(
                reduce(
                    mul,
                    (0.5 if i << j < K else end_of_loop() for j in range(MAX_SHIFT)),
                    1,
                )
                for i in range(1, N + 1)
            )
            / N
        )
    )
    return


main()

import math


def main():
    N, K = list(map(int, input().split()))
    k = int(math.log2(K)) + 1
    print(
        (
            (
                max(0, N - K + 1)
                + sum(
                    max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i
                    - max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1 / 2) ** i
                    for i in range(1, k + 1)
                )
            )
            / N
        )
    )
    return


main()

-from functools import reduce -from math import log2 -from operator import mul - - -def end_of_loop(): -    raise StopIteration +import math -    MAX_SHIFT = int(log2(K) + 1) +    k = int(math.log2(K)) + 1 -            sum( -                reduce( -                    mul, -                    (0.5 if i << j < K else end_of_loop() for j in range(MAX_SHIFT)), -                    1, +            ( +                max(0, N - K + 1) +                + sum( +                    max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i +                    - max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1 / 2) ** i +                    for i in range(1, k + 1) -                for i in range(1, N + 1)