import java.util.Scanner;

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());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	}
} 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());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	}
} 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());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	} 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 double s=0; s 0 int p=0; p 0 double k=1; k 1 for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		} {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		} k=1 k 1 for(p=i;p<K;) {

				p *= 2;
				k/=2;

			} p=i; p=i p i p<K p K {

				p *= 2;
				k/=2;

			} {

				p *= 2;
				k/=2;

			} p *= 2 p 2 k/=2 k 2 s+=k s k s*=(double)1/N s (double)1/N (double)1 N System.out.println(s) System.out.println System.out System System.out s 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());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	}
} 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());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	}
} Main
import java.util.Scanner;

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());

		double s=0;
		int p=0;
		double k=1;
		for(int i=1;i<=N;i++) {

			k=1;
			for(p=i;p<K;) {

				p *= 2;
				k/=2;

			}
			s+=k;
		}


		s*=(double)1/N;
		System.out.println(s);

	}
}