#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
double p[MAX];
int main() {
  ios::sync_with_stdio(false);
  int n, t;
  cin >> n >> t;
  double prob = 1.0 / n;
  double ans = 0.0;
  for (int i = 1; i <= n; i++)
    ans += (pow(prob * i, t) - pow(prob * (i - 1), t)) * i;
  cout << setprecision(10) << fixed << ans << endl;
  return 0;
}
