Esempio n. 1
0
std::vector<double> twinkle::assignSetsProbability(std::vector<setInformation> sets, std::vector<double> pData, int totRows)
{
    double center = pData[1];
    std::vector<double> setP;
    for(uint i=0; i<sets.size(); i++)
    {
        setP.push_back(computeProbability(sets[i], center, totRows));
    }

    return setP;
}
int main()
{
	double lambda;
	printf("Enter the value of the parameter \"lambda\" : ");
	scanf("%lf",&lambda);
	int i;
	printf("Enter the value of i : ");
	scanf("%d",&i);
	computeProbability(lambda, i);
	printf("Expectation of poisson random variable : %lf\n",computeExpectation(lambda));
	printf("Variance of poisson random variable : %lf\n",computeVariance(lambda));
	return 0;
}