import java.util.*;
import static java.lang.System.*;

public class Main{
  public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  
	  int N = sc.nextInt();
	  int K = sc.nextInt();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	}
  }	 import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main{
  public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  
	  int N = sc.nextInt();
	  int K = sc.nextInt();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	}
  } Main public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  
	  int N = sc.nextInt();
	  int K = sc.nextInt();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	} main {
	  Scanner sc = new Scanner(System.in);
	  
	  int N = sc.nextInt();
	  int K = sc.nextInt();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	} 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 double[] persentList  = new double[N+1]; persentList new double[N+1] N+1 N 1 double sum = 0; sum 0 int k = K; k K if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  } N >= K N K {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } for(int i = K; i<=N; i++) 
		  persentList[i] = 1; int i = K; int i = K; i K i<=N i N i++ i++ i persentList[i] = 1; persentList[i] = 1 persentList[i] persentList i 1 {
		  k = N;
	  } k = N k N for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  } int i=1; int i=1; i 1 i<=k i k i++ i++ i {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  } {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  } double persent = 1; persent 1 int count = 0; count 0 int n = i; n i while(n < K) {
			  n *= 2;
			  count++;
		  } n < K n K {
			  n *= 2;
			  count++;
		  } n *= 2 n 2 count++ count for(int j=0; j<count; j++) {
			  persent /= 2;
		  } int j=0; int j=0; j 0 j<count j count j++ j++ j {
			  persent /= 2;
		  } {
			  persent /= 2;
		  } persent /= 2 persent 2 persentList[i] = persent persentList[i] persentList i persent for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
		  sum += persentList[i];
	  } {
		  sum += persentList[i];
	  } sum += persentList[i] sum persentList[i] persentList i double ans = sum  / N; ans sum  / N sum N out.println(ans) out.println out ans 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();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	}
  } public class Main{
  public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  
	  int N = sc.nextInt();
	  int K = sc.nextInt();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	}
  } Main
import java.util.*;
import static java.lang.System.*;

public class Main{
  public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  
	  int N = sc.nextInt();
	  int K = sc.nextInt();
	double[] persentList  = new double[N+1]; //各数字ごとの勝利率
	  double sum = 0;
	  int k = K;

	  //1回目で勝ち確定
	  if(N >= K) {
	  for(int i = K; i<=N; i++) 
		  persentList[i] = 1;
	  } else {
		  k = N;
	  }
	  
	  //それ以外
	  for(int i=1; i<=k; i++) {
		  double persent = 1;
		  int count = 0;
		  int n = i;
		  while(n < K) {
			  n *= 2;
			  count++;
		  }
		  for(int j=0; j<count; j++) {
			  persent /= 2;
		  }
		  persentList[i] = persent;
		  
	  }
	  for(int i=1; i<=N; i++) {
		  sum += persentList[i];
	  }
	  
	  double ans = sum  / N;
	  out.println(ans);
	  		  
	}
  }	