
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());//int型
		int K = Integer.parseInt(sc.next());
		double ans = 0;
		// サイコロの段階で勝ち確定
		ans = Math.max((double)(N-K+1)/N, 0);
		int co=0;
		if(N<K) co = N;
		else if(N>=K) co=K-1;
		
		for( int i=1; i<=co;i++) {
			int countpow=0;
			for(int j=1; j<18;j++){
			    int p = (int) (i*Math.pow(2, j));
				if(p>=K) {
					countpow=j;
					break;
				}
			}
			double tmp=(double)1/(N * Math.pow(2, countpow));
			ans += tmp;
			
		}
		
		System.out.println(String.format("%.12f",ans));
		
	}

}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz