I have forgotten

• http://facebook.com/
• https://www.google.com/accounts/o8/id
• https://me.yahoo.com COST (GBP) 1.00 0.00 0

# Prob

Calculates the probability that values in a range are between two limits.
Controller: CodeCogs Contents  C++

## Prob

 template doubleprob( int n T* data double* prob int x int y` = INT_MAX` )
Returns the probability that values in a range are between two limits. If upper limit y is not supplied, then it returns the probability that values in data are equal to lower limit. If the data array does not sum to 1 or if one of its components are null, the function exits.

### Example 1

```#include <codecogs/statistics/moments/prob.h>
#include <iostream>
int main()
{
int x={1, 2, 3, 4, 5};
double y ={0.1, 0.2, 0.3, 0.2, 0.2};
double rez = Stats::Moments::prob<int>(5,x,y,2,4);
std::cout << "The probability is: " << rez << std::endl;
return 0;
}```
Output:
`The probability is: 0.7`

### Parameters

 n the size of the data and of the prob data is the range of numeric values of x with which there are associated probabilities prob is a set of probabilities associated with values in data x is the lower bound on the value for which you want a probability. y Default Value = INT_MAX

### Returns

returns the probability that values in a range are between two limits
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.