import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	} main {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	} try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		} catch (Exception e) {
			// TODO: handle exception
		} Exception e {
			// TODO: handle exception
		} {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int N N K; K N = sc.nextInt() N sc.nextInt() sc.nextInt sc K = sc.nextInt() K sc.nextInt() sc.nextInt sc double sum = 0; sum 0 for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			} {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			} int score = i; score i double tmpSum = 1; tmpSum 1 while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				} score < K score K {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				} score *= 2 score 2 tmpSum *=  0.5 tmpSum 0.5 sum += tmpSum sum tmpSum sum = (double)(sum / N) sum (double)(sum / N) sum N System.out.println(String.format("%.9f", sum)) System.out.println System.out System System.out String.format("%.9f", sum) String.format String "%.9f" sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try (Scanner sc = new Scanner(System.in)) {
			int N, K;
			N = sc.nextInt();
			K = sc.nextInt();
			
			double sum = 0;
			
			for (int i = 1; i <= N; i++) {
				int score = i;
				double tmpSum = 1;
//				System.out.println("K = " + i + ";");
				while (score < K) {
					score *= 2;
					tmpSum *=  0.5;
//				System.out.println(score);
					
				}
				sum += tmpSum;
			}
			
			sum = (double)(sum / N);
			
			System.out.println(String.format("%.9f", sum));
			
		} catch (Exception e) {
			// TODO: handle exception
		}

	}

}
