# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n, k = [int(x) for x in input().split()]
    ans = 0
    for i in range(1, n + 1):
        x = 1 / n
        score = i
        while score < k:
            score *= 2
            x /= 2
        ans += x
    print(ans)


    

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""


""" import sys sys from collections import deque, defaultdict from math import sqrt, factorial def solve():
    n, k = [int(x) for x in input().split()]
    ans = 0
    for i in range(1, n + 1):
        x = 1 / n
        score = i
        while score < k:
            score *= 2
            x /= 2
        ans += x
    print(ans)


     solve int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x n, k = [int(x) for x in input().split()] n [int(x) for x in input().split()] k ans = 0 ans 0 for i in range(1, n + 1):
        x = 1 / n
        score = i
        while score < k:
            score *= 2
            x /= 2
        ans += x
     i range(1, n + 1) range 1 n + 1 n 1 x = 1 / n x 1 / n 1 n score = i score i while score < k:
            score *= 2
            x /= 2
         score < k score k score *= 2 score 2 x /= 2 x 2 ans += x ans x print(ans) print ans t = 1 t 1 for case in range(1,t+1):
    ans = solve() case range(1,t+1) range 1 t+1 t 1 ans = solve() ans solve() solve """


""" t = 1 1 t ans = solve() solve() ans def solve():
    n, k = [int(x) for x in input().split()]
    ans = 0
    for i in range(1, n + 1):
        x = 1 / n
        score = i
        while score < k:
            score *= 2
            x /= 2
        ans += x
    print(ans)


     def solve():
    n, k = [int(x) for x in input().split()]
    ans = 0
    for i in range(1, n + 1):
        x = 1 / n
        score = i
        while score < k:
            score *= 2
            x /= 2
        ans += x
    print(ans)


     solve
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n, k = [int(x) for x in input().split()]
    ans = 0
    for i in range(1, n + 1):
        x = 1 / n
        score = i
        while score < k:
            score *= 2
            x /= 2
        ans += x
    print(ans)


    

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""


"""
