#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
 
int main(){
    double N,M,A=0,b,c=0;
    cin >> N >>M;
   
 for(int i=1;i<=N;i++){
     A=1/N;
     b=i;
    while(b<M){
        b*=2;
        A/=2;
    }
    c+=A;
 }

printf("%.12f",c);
}