import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int dice=scn.nextInt();
        int win=scn.nextInt();
        int cnt=0;
        double probability=0;
        for(int i=1;i<=dice;i++){
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        }
        System.out.println(probability);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int dice=scn.nextInt();
        int win=scn.nextInt();
        int cnt=0;
        double probability=0;
        for(int i=1;i<=dice;i++){
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        }
        System.out.println(probability);
    }
} Main public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int dice=scn.nextInt();
        int win=scn.nextInt();
        int cnt=0;
        double probability=0;
        for(int i=1;i<=dice;i++){
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        }
        System.out.println(probability);
    } main {
        Scanner scn=new Scanner(System.in);
        int dice=scn.nextInt();
        int win=scn.nextInt();
        int cnt=0;
        double probability=0;
        for(int i=1;i<=dice;i++){
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        }
        System.out.println(probability);
    } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int dice=scn.nextInt(); dice scn.nextInt() scn.nextInt scn int win=scn.nextInt(); win scn.nextInt() scn.nextInt scn int cnt=0; cnt 0 double probability=0; probability 0 for(int i=1;i<=dice;i++){
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        } int i=1; int i=1; i 1 i<=dice i dice i++ i++ i {
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        } {
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        } int score=i; score i while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            } true {
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            } if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                } win>score win score {
                    score*=2;
                    cnt++;
                } score*=2 score 2 cnt++ cnt {
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                } probability+=1.0/dice*Math.pow(0.5,(double)cnt) probability 1.0/dice*Math.pow(0.5,(double)cnt) 1.0/dice 1.0 dice Math.pow(0.5,(double)cnt) Math.pow Math 0.5 (double)cnt cnt=0 cnt 0 break; System.out.println(probability) System.out.println System.out System System.out probability String arg[] arg
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int dice=scn.nextInt();
        int win=scn.nextInt();
        int cnt=0;
        double probability=0;
        for(int i=1;i<=dice;i++){
            int score=i;
            while(true){
                if(win>score){
                    score*=2;
                    cnt++;
                }else{
                    probability+=1.0/dice*Math.pow(0.5,(double)cnt);
                    cnt=0;
                    break;
                }
            }
        }
        System.out.println(probability);
    }
}