import sys
import math
import itertools


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, K = map(int, input().split())

    ans =0
    for i in range(1,N+1):
        if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
        ans +=(0.5 **s ) /N

    print(ans)


if __name__ == "__main__":
    main() import sys sys import math math import itertools itertools def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    N, K = map(int, input().split())

    ans =0
    for i in range(1,N+1):
        if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
        ans +=(0.5 **s ) /N

    print(ans) main N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K ans =0 ans 0 for i in range(1,N+1):
        if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
        ans +=(0.5 **s ) /N

     i range(1,N+1) range 1 N+1 N 1 if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
         i>K i K s =0 s 0 s =math.ceil(math.log2(K/i)) s math.ceil(math.log2(K/i)) math.ceil math ceil math.log2(K/i) math.log2 math log2 K/i K i ans +=(0.5 **s ) /N ans (0.5 **s ) /N 0.5 **s 0.5 s N print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input def main():
    N, K = map(int, input().split())

    ans =0
    for i in range(1,N+1):
        if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
        ans +=(0.5 **s ) /N

    print(ans) def main():
    N, K = map(int, input().split())

    ans =0
    for i in range(1,N+1):
        if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
        ans +=(0.5 **s ) /N

    print(ans) main
import sys
import math
import itertools


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, K = map(int, input().split())

    ans =0
    for i in range(1,N+1):
        if i>K:
            s =0
        else:
            s =math.ceil(math.log2(K/i))
        ans +=(0.5 **s ) /N

    print(ans)


if __name__ == "__main__":
    main()
