import sys



read = sys.stdin.buffer.read

input = sys.stdin.buffer.readline

inputs = sys.stdin.buffer.readlines





# rstrip().decode('utf-8')

# INF=float("inf")

# MOD=10**9+7

# sys.setrecursionlimit(2147483647)

# import math

import numpy as np

# import operator

# import bisect

# from heapq import heapify,heappop,heappush

# from math import gcd

# from fractions import gcd

# from collections import deque

# from collections import defaultdict

# from collections import Counter

# from itertools import accumulate

# from itertools import groupby

# from itertools import permutations

# from itertools import combinations

# from scipy.sparse import csr_matrix

# from scipy.sparse.csgraph import floyd_warshall

# from scipy.sparse.csgraph import csgraph_from_dense

# from scipy.sparse.csgraph import dijkstra

# map(int,input().split())





def main():

	N, K = list(map(int, input().split()))

	ans=0

	for i in range(1,N+1):

		x=max(0,np.ceil(np.log2(K/i)))

		ans+=2**(-x)

	print((ans/N))

	

	

	

	

	

	

if __name__ == '__main__':

	main()

import sys



read = sys.stdin.buffer.read

input = sys.stdin.buffer.readline

inputs = sys.stdin.buffer.readlines





# rstrip().decode('utf-8')

# INF=float("inf")

# MOD=10**9+7

# sys.setrecursionlimit(2147483647)

# import math

#import numpy as np

# import operator

# import bisect

# from heapq import heapify,heappop,heappush

# from math import gcd

# from fractions import gcd

# from collections import deque

# from collections import defaultdict

# from collections import Counter

# from itertools import accumulate

# from itertools import groupby

# from itertools import permutations

# from itertools import combinations

# from scipy.sparse import csr_matrix

# from scipy.sparse.csgraph import floyd_warshall

# from scipy.sparse.csgraph import csgraph_from_dense

# from scipy.sparse.csgraph import dijkstra

# map(int,input().split())





def main():

	N, K = list(map(int, input().split()))

	ans=0

	for i in range(1,N+1):

		a=0

		while i*(2**a)<K:

			a+=1

		ans+=(1/2**a)/N

	print(ans)

	

	

	

	

	

	

	

	

if __name__ == '__main__':

	main()

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines
# rstrip().decode('utf-8')
# INF=float("inf")
# MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
import numpy as np

# import operator
# import bisect
# from heapq import heapify,heappop,heappush
# from math import gcd
# from fractions import gcd
# from collections import deque
# from collections import defaultdict
# from collections import Counter
# from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())
def main():
    N, K = list(map(int, input().split()))
    ans = 0
    for i in range(1, N + 1):
        x = max(0, np.ceil(np.log2(K / i)))
        ans += 2 ** (-x)
    print((ans / N))


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines
# rstrip().decode('utf-8')
# INF=float("inf")
# MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
# import numpy as np
# import operator
# import bisect
# from heapq import heapify,heappop,heappush
# from math import gcd
# from fractions import gcd
# from collections import deque
# from collections import defaultdict
# from collections import Counter
# from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())
def main():
    N, K = list(map(int, input().split()))
    ans = 0
    for i in range(1, N + 1):
        a = 0
        while i * (2**a) < K:
            a += 1
        ans += (1 / 2**a) / N
    print(ans)


if __name__ == "__main__":
    main()

-import numpy as np - +# import numpy as np -        x = max(0, np.ceil(np.log2(K / i))) -        ans += 2 ** (-x) -    print((ans / N)) +        a = 0 +        while i * (2**a) < K: +            a += 1 +        ans += (1 / 2**a) / N +    print(ans)