import java.util.*;
import java.math.*;

class Main
{
	public static void main(String[] args)
	{
		int K;
		double N,n=0,m;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		BigDecimal Ans = BigDecimal.valueOf(0);
		BigDecimal One = BigDecimal.valueOf(1);
		BigDecimal num = new BigDecimal(N);
		for(int i=1;i<=N;i++)
		{
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		}
		Ans = Ans.divide(num,12,BigDecimal.ROUND_HALF_UP);
		System.out.println(Ans);
	}
} import java.util.*; util.* java import java.math.*; math.* java class Main
{
	public static void main(String[] args)
	{
		int K;
		double N,n=0,m;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		BigDecimal Ans = BigDecimal.valueOf(0);
		BigDecimal One = BigDecimal.valueOf(1);
		BigDecimal num = new BigDecimal(N);
		for(int i=1;i<=N;i++)
		{
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		}
		Ans = Ans.divide(num,12,BigDecimal.ROUND_HALF_UP);
		System.out.println(Ans);
	}
} Main public static void main(String[] args)
	{
		int K;
		double N,n=0,m;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		BigDecimal Ans = BigDecimal.valueOf(0);
		BigDecimal One = BigDecimal.valueOf(1);
		BigDecimal num = new BigDecimal(N);
		for(int i=1;i<=N;i++)
		{
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		}
		Ans = Ans.divide(num,12,BigDecimal.ROUND_HALF_UP);
		System.out.println(Ans);
	} main {
		int K;
		double N,n=0,m;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		BigDecimal Ans = BigDecimal.valueOf(0);
		BigDecimal One = BigDecimal.valueOf(1);
		BigDecimal num = new BigDecimal(N);
		for(int i=1;i<=N;i++)
		{
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		}
		Ans = Ans.divide(num,12,BigDecimal.ROUND_HALF_UP);
		System.out.println(Ans);
	} int K; K double N N n=0 n 0 m; m Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc K = sc.nextInt() K sc.nextInt() sc.nextInt sc BigDecimal Ans = BigDecimal.valueOf(0); Ans BigDecimal.valueOf(0) BigDecimal.valueOf BigDecimal 0 BigDecimal One = BigDecimal.valueOf(1); One BigDecimal.valueOf(1) BigDecimal.valueOf BigDecimal 1 BigDecimal num = new BigDecimal(N); num new BigDecimal(N) for(int i=1;i<=N;i++)
		{
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		} {
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		} if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			} i<K i K {
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			} n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2) n Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2) Math.log(K)/Math.log(2) Math.log(K) Math.log Math K Math.log(2) Math.log Math 2 Math.log(i)/Math.log(2) Math.log(i) Math.log Math i Math.log(2) Math.log Math 2 n = Math.ceil(n) n Math.ceil(n) Math.ceil Math n BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n))); comp new BigDecimal(Double.toString(Math.pow(0.5,n))) Ans = Ans.add(comp) Ans Ans.add(comp) Ans.add Ans comp {
				Ans = Ans.add(One);
			} Ans = Ans.add(One) Ans Ans.add(One) Ans.add Ans One Ans = Ans.divide(num,12,BigDecimal.ROUND_HALF_UP) Ans Ans.divide(num,12,BigDecimal.ROUND_HALF_UP) Ans.divide Ans num 12 BigDecimal.ROUND_HALF_UP BigDecimal BigDecimal.ROUND_HALF_UP System.out.println(Ans) System.out.println System.out System System.out Ans String[] args args
import java.util.*;
import java.math.*;

class Main
{
	public static void main(String[] args)
	{
		int K;
		double N,n=0,m;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		BigDecimal Ans = BigDecimal.valueOf(0);
		BigDecimal One = BigDecimal.valueOf(1);
		BigDecimal num = new BigDecimal(N);
		for(int i=1;i<=N;i++)
		{
			if(i<K)
			{
				n = Math.log(K)/Math.log(2)-Math.log(i)/Math.log(2);
				n = Math.ceil(n);
				BigDecimal comp = new BigDecimal(Double.toString(Math.pow(0.5,n)));
				Ans = Ans.add(comp);
			}
			else
			{
				Ans = Ans.add(One);
			}
		}
		Ans = Ans.divide(num,12,BigDecimal.ROUND_HALF_UP);
		System.out.println(Ans);
	}
}
