expected number of trials to get n consecutive heads
#include "bits/stdc++.h"
using namespace std;
// Driver Code
int main()
{
int N = 3;
// Formula for number of trails for
// N consecutive heads
cout << pow(2, N + 1) - 2;
return 0;
}