Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
 
PREVIOUS NEXT
Tagged: #expected #number #trials #consecutive #heads
ADD COMMENT
Topic
Name
9+2 =