import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	}
} import java.math.BigDecimal; BigDecimal java.math import java.math.RoundingMode; RoundingMode java.math import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int count = 0; count 0 int a =0; a 0 int now =0; now 0 int beforeK=0; beforeK 0 while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		} K>0 K 0 {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		} count *=2 count 2 if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			} N>=K N K {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			} if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				} beforeK==0 beforeK 0 {
					count +=N-K+1;
				} count +=N-K+1 count N-K+1 N-K N K 1 {
					count +=beforeK-K;
				} count +=beforeK-K count beforeK-K beforeK K beforeK=K beforeK K if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			} K>1 K 1 {
				K=K/2+K%2;
			} K=K/2+K%2 K K/2+K%2 K/2 K 2 K%2 K 2 {
				K/=2;
			} K/=2 K 2 a++ a a-- a int total = (int) Math.pow(2, a); total (int) Math.pow(2, a) Math.pow Math 2 a total *=N total N BigDecimal result = new BigDecimal(count); result new BigDecimal(count) result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP) result result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP) result.divide result new BigDecimal(total) 12 RoundingMode.HALF_UP RoundingMode RoundingMode.HALF_UP System.out.println(result.toPlainString()) System.out.println System.out System System.out result.toPlainString() result.toPlainString result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	}
} Main
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int a =0;
		int now =0;
		int beforeK=0;
		while (K>0) {
			count *=2;
			if (N>=K) {
				if (beforeK==0) {
					count +=N-K+1;
				} else {
					count +=beforeK-K;
				}
				beforeK=K;
			}
			if (K>1) {
				K=K/2+K%2;
			} else {
				K/=2;
			}
			a++;
		}
		a--;
		int total = (int) Math.pow(2, a);
		total *=N;
		BigDecimal result = new BigDecimal(count);

		result = result.divide(new BigDecimal(total), 12,RoundingMode.HALF_UP);
		System.out.println(result.toPlainString());
	}
}