Answers for "expected number of trials to get n consecutive heads"

C++
1

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;
}
Posted by: Guest on April-17-2021

Code answers related to "expected number of trials to get n consecutive heads"

Browse Popular Code Answers by Language