def main():
    N, K = map(int, input().split())
    ans = 0
    for i in range(1, N + 1):
        if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
    print(ans)


if __name__ == "__main__":
    main() def main():
    N, K = map(int, input().split())
    ans = 0
    for i in range(1, N + 1):
        if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
    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:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
     i range(1, N + 1) range 1 N + 1 N 1 if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
     i >= K i K ans += 1 / N ans 1 / N 1 N tmp = i tmp i cnt = 0 cnt 0 while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
             True tmp *= 2 tmp 2 cnt += 1 cnt 1 if tmp >= K:
                    break
             tmp >= K tmp K break ans += 1 / N * (1 / 2)**cnt ans 1 / N * (1 / 2)**cnt 1 / N 1 N (1 / 2)**cnt 1 / 2 1 2 cnt print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N, K = map(int, input().split())
    ans = 0
    for i in range(1, N + 1):
        if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
    print(ans) def main():
    N, K = map(int, input().split())
    ans = 0
    for i in range(1, N + 1):
        if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
    print(ans) main
def main():
    N, K = map(int, input().split())
    ans = 0
    for i in range(1, N + 1):
        if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
    print(ans)


if __name__ == "__main__":
    main()
