import sys
from operator import itemgetter
import math

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    n, k = mi()

    ans = 0
    for i in range(1, n+1):
        t = 0
        while i < k:
            i *= 2
            t += 1
        ans += 0.5 ** t
    ans /= n
    print(f"{ans:.12f}")
    return

main() import sys sys from operator import itemgetter import math math sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def ii(): return int(input()) ii def mi(): return map(int, input().split()) mi def lmi(): return list(map(int, input().split())) lmi list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def lmif(n): return [list(map(int, input().split())) for _ in range(n)] lmif n n def ss(): return input().split() ss def main():
    n, k = mi()

    ans = 0
    for i in range(1, n+1):
        t = 0
        while i < k:
            i *= 2
            t += 1
        ans += 0.5 ** t
    ans /= n
    print(f"{ans:.12f}")
    return main n, k = mi() n mi() mi k ans = 0 ans 0 for i in range(1, n+1):
        t = 0
        while i < k:
            i *= 2
            t += 1
        ans += 0.5 ** t
     i range(1, n+1) range 1 n+1 n 1 t = 0 t 0 while i < k:
            i *= 2
            t += 1
         i < k i k i *= 2 i 2 t += 1 t 1 ans += 0.5 ** t ans 0.5 ** t 0.5 t ans /= n ans n print(f"{ans:.12f}") print f"{ans:.12f}" return main() main input = sys.stdin.readline sys.stdin.readline input def ii(): return int(input()) def ii(): return int(input()) ii def ss(): return input().split() def ss(): return input().split() ss def lmi(): return list(map(int, input().split())) def lmi(): return list(map(int, input().split())) lmi def mi(): return map(int, input().split()) def mi(): return map(int, input().split()) mi def lmif(n): return [list(map(int, input().split())) for _ in range(n)] def lmif(n): return [list(map(int, input().split())) for _ in range(n)] lmif def main():
    n, k = mi()

    ans = 0
    for i in range(1, n+1):
        t = 0
        while i < k:
            i *= 2
            t += 1
        ans += 0.5 ** t
    ans /= n
    print(f"{ans:.12f}")
    return def main():
    n, k = mi()

    ans = 0
    for i in range(1, n+1):
        t = 0
        while i < k:
            i *= 2
            t += 1
        ans += 0.5 ** t
    ans /= n
    print(f"{ans:.12f}")
    return main
import sys
from operator import itemgetter
import math

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    n, k = mi()

    ans = 0
    for i in range(1, n+1):
        t = 0
        while i < k:
            i *= 2
            t += 1
        ans += 0.5 ** t
    ans /= n
    print(f"{ans:.12f}")
    return

main()
