def bfs(N, que, dic): if N == 0: return que, dic tmp = [] dic = {} while len(que) != 0: x = que.pop(0) a = x + 1 b = x * 2 c = 0 if a not in dic: dic[a] = 1 tmp.append(a) else: dic[a] += 1 if b not in dic: dic[b] = 1 tmp.append(b) else: dic[b] += 1 if c not in dic: dic[c] = 1 tmp.append(c) else: dic[c] += 1 for i in tmp: que.append(i) return bfs(N - 1, que, dic) if __name__ == '__main__': N, M = map(int, raw_input().split()) dic = {} que = [] que.append(N) rt1, rt2 = bfs(M, que, dic) key = rt2.keys() tmp = 0 for i in key: tmp += rt2[i] print float(float(sum(rt1)) / float(tmp))