import java.util.Scanner;

/**
 * https://beta.atcoder.jp/contests/abc077/tasks/arc084_b
 */
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc double ans = 0; ans 0 for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		} {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		} int score=i; score i double p=1; p 1 while(score<K) {
				score*=2;
				p/=2;
			} score<K score K {
				score*=2;
				p/=2;
			} score*=2 score 2 p/=2 p 2 ans += p ans p System.out.println(ans/N) System.out.println System.out System System.out ans/N ans N String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	}

} Main
import java.util.Scanner;

/**
 * https://beta.atcoder.jp/contests/abc077/tasks/arc084_b
 */
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();
		
		double ans = 0;
		for(int i=1; i<=N; i++) {
			int score=i;
			double p=1;
			while(score<K) {
				score*=2;
				p/=2;
			}
			ans += p;
		}
		System.out.println(ans/N);		
	}

}
