import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;
		for(int i=1;i<=n;i++){
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;
		for(int i=1;i<=n;i++){
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		}
		System.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 ans=0;
		for(int i=1;i<=n;i++){
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		}
		System.out.println(ans);
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;
		for(int i=1;i<=n;i++){
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		}
		System.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 ans=0; ans 0 for(int i=1;i<=n;i++){
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		} {
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		} int score=i; score i double bunbo=n; bunbo n double ans2=1/bunbo; ans2 1/bunbo 1 bunbo int count=0; count 0 while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			} true {
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			} if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break; score<k score k {
					score*=2;
					count++;
					ans2*=0.5;
				} score*=2 score 2 count++ count ans2*=0.5 ans2 0.5 break; ans+=ans2 ans ans2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;
		for(int i=1;i<=n;i++){
			int score=i;
			double bunbo=n;
			double ans2=1/bunbo;
			int count=0;
			while(true){
				if(score<k){
					score*=2;
					count++;
					ans2*=0.5;
				}else
					break;
			}
			ans+=ans2;
		}
		System.out.println(ans);
	}
}