# -*- coding: utf-8 -*-

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input

# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))

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

ans = float(0)

if K <= N:
    ans += (N-K+1)/N
    X = K
else:
    X = N+1

for i in range(1,X):
    tmp = float(1/N)
    tmp2 = i
    while tmp2 < K:
        tmp2 *= 2
        tmp /= 2
    ans += tmp

print(ans) import sys sys from fractions import gcd import math math from math import ceil,floor import collections collections from collections import Counter import itertools itertools import copy copy N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K ans = float(0) ans float(0) float 0 if K <= N:
    ans += (N-K+1)/N
    X = K
else:
    X = N+1 K <= N K N ans += (N-K+1)/N ans (N-K+1)/N N-K+1 N-K N K 1 N X = K X K X = N+1 X N+1 N 1 for i in range(1,X):
    tmp = float(1/N)
    tmp2 = i
    while tmp2 < K:
        tmp2 *= 2
        tmp /= 2
    ans += tmp i range(1,X) range 1 X tmp = float(1/N) tmp float(1/N) float 1/N 1 N tmp2 = i tmp2 i while tmp2 < K:
        tmp2 *= 2
        tmp /= 2
     tmp2 < K tmp2 K tmp2 *= 2 tmp2 2 tmp /= 2 tmp 2 ans += tmp ans tmp print(ans) print ans ans = float(0) float(0) ans X = N+1 N+1 X tmp2 = i i tmp2 tmp /= 2 2 tmp N,K = map(int,input().split()) map(int,input().split()) N tmp = float(1/N) float(1/N) tmp K = map(int,input().split()) map(int,input().split()) K X = K K X ans += (N-K+1)/N (N-K+1)/N ans tmp2 *= 2 2 tmp2 ans += tmp tmp ans
# -*- coding: utf-8 -*-

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input

# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))

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

ans = float(0)

if K <= N:
    ans += (N-K+1)/N
    X = K
else:
    X = N+1

for i in range(1,X):
    tmp = float(1/N)
    tmp2 = i
    while tmp2 < K:
        tmp2 *= 2
        tmp /= 2
    ans += tmp

print(ans)