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());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	}

} 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());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	}

} 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());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);

		int n=Integer.parseInt(sc.next());

		int k=Integer.parseInt(sc.next());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	} 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 int t t cnt=0; cnt 0 double y y ans=0; ans 0 for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		} {
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		} t=1 t 1 cnt=0 cnt 0 y=1.0 y 1.0 while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			} (i*t)<k (i*t) i t k {
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			} t=t*2 t t*2 t 2 y=(double)(y/2) y (double)(y/2) y 2 cnt+=1 cnt 1 ans+=(double)(y/n) ans (double)(y/n) y n System.out.println(ans) System.out.println System.out System System.out ans 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());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	}

} 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());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	}

} 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());
		int t,cnt=0;
		double y,ans=0;

		for(int i=1;i<=n;i++){
			t=1;
			cnt=0;
			y=1.0;
			while((i*t)<k){
				t=t*2;
				y=(double)(y/2);
				cnt+=1;
			}
			ans+=(double)(y/n);
		}
		System.out.println(ans);
	}

}