#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    ans = 0
    for n in range(1, N+1):
        b = 1
        while n * b < K:
            b <<= 1
        ans += 1 / (b * N)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main() import sys sys def solve(N: int, K: int):
    ans = 0
    for n in range(1, N+1):
        b = 1
        while n * b < K:
            b <<= 1
        ans += 1 / (b * N)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools solve ans = 0 ans 0 for n in range(1, N+1):
        b = 1
        while n * b < K:
            b <<= 1
        ans += 1 / (b * N)
     n range(1, N+1) range 1 N+1 N 1 b = 1 b 1 while n * b < K:
            b <<= 1
         n * b < K n * b n b K b <<= 1 b 1 ans += 1 / (b * N) ans 1 / (b * N) 1 b * N b N return ans ans N: int N K: int K def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K)) main def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens N = int(next(tokens)) N int(next(tokens)) int next(tokens) next tokens K = int(next(tokens)) K int(next(tokens)) int next(tokens) next tokens print(solve(N, K)) print solve(N, K) solve N K def test():
    import doctest
    doctest.testmod() test import doctest doctest doctest.testmod() doctest.testmod doctest testmod if __name__ == '__main__':
    #test()
    main() __name__ == '__main__' __name__ '__main__' main() main def solve(N: int, K: int):
    ans = 0
    for n in range(1, N+1):
        b = 1
        while n * b < K:
            b <<= 1
        ans += 1 / (b * N)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools def solve(N: int, K: int):
    ans = 0
    for n in range(1, N+1):
        b = 1
        while n * b < K:
            b <<= 1
        ans += 1 / (b * N)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools solve def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K)) def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K)) main def test():
    import doctest
    doctest.testmod() def test():
    import doctest
    doctest.testmod() test
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    ans = 0
    for n in range(1, N+1):
        b = 1
        while n * b < K:
            b <<= 1
        ans += 1 / (b * N)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
