import sys
from math import log2
from math import ceil

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    p = 0
    for i in range(1, min(n+1, k)):
        x = ceil(log2(k/i))
        p += 0.5**x
    p += max(0, n-k+1)
    p /= n
    print(p)

if __name__ == '__main__':
    main() import sys sys from math import log2 from math import ceil def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def LI(): return list(map(int, sys.stdin.readline().split())) LI def main():
    n, k = MI()
    p = 0
    for i in range(1, min(n+1, k)):
        x = ceil(log2(k/i))
        p += 0.5**x
    p += max(0, n-k+1)
    p /= n
    print(p) main n, k = MI() n MI() MI k p = 0 p 0 for i in range(1, min(n+1, k)):
        x = ceil(log2(k/i))
        p += 0.5**x
     i range(1, min(n+1, k)) range 1 min(n+1, k) min n+1 n 1 k x = ceil(log2(k/i)) x ceil(log2(k/i)) ceil log2(k/i) log2 k/i k i p += 0.5**x p 0.5**x 0.5 x p += max(0, n-k+1) p max(0, n-k+1) max 0 n-k+1 n-k n k 1 p /= n p n print(p) print p if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI def main():
    n, k = MI()
    p = 0
    for i in range(1, min(n+1, k)):
        x = ceil(log2(k/i))
        p += 0.5**x
    p += max(0, n-k+1)
    p /= n
    print(p) def main():
    n, k = MI()
    p = 0
    for i in range(1, min(n+1, k)):
        x = ceil(log2(k/i))
        p += 0.5**x
    p += max(0, n-k+1)
    p /= n
    print(p) main def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI
import sys
from math import log2
from math import ceil

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    p = 0
    for i in range(1, min(n+1, k)):
        x = ceil(log2(k/i))
        p += 0.5**x
    p += max(0, n-k+1)
    p /= n
    print(p)

if __name__ == '__main__':
    main()