Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CV
//g++ 7.4.0 //Coefficient of Variation: finding out the consistent and stable series between two //created by Rezaul Hoque on December 22,2020 //contact at jewelmrh@yahoo.com #include <iostream> #include <cmath> using namespace std; int main() { int n=10,n2=10,sum=0,sum2=0,bsum=0, bsum2=0; int a[n]={105,120,115,118,130,127,109,110,104,112}; int b[n2]={108,117,120,130,100,125,125,120,110,135}; float mean, SD, preSD,mean2,SD2,preSD2,var2,cv,cv2,var; for(int i=0;i<n;i++) { sum += a[i]; } mean = sum/n; for(int i=0; i<n; i++) { sum2 += (a[i]-mean)*(a[i]-mean); } preSD= sum2/n; SD= sqrt(preSD); var = SD*SD; //for series 2 for(int i=0;i<n2;i++) { bsum += b[i]; } mean2 = bsum/n2; for(int i=0; i<n2; i++) { bsum2 += (b[i]-mean2)*(b[i]-mean2); } preSD2= bsum2/n2; SD2= sqrt(preSD2); var2 = SD2*SD2; cv=SD/mean*100; cv2=SD2/mean2*100; //for series 1 cout<<"Series1 Mean:\t"<<mean; cout<<endl; cout<<" Series1 Standard Deviation:\t"<<SD; cout<<endl; cout<<"Series1 Coefficient of variation:\t"<<cv; cout<<endl; //for series 2 cout<<"Series2 Mean:\t"<<mean2; cout<<endl; cout<<" Series2 Standard Deviation:\t"<<SD2; cout<<endl; cout<<"Series2 Coefficient of variation:\t"<<cv2; cout<<endl; if(cv>cv2) cout<<"Series 2 is more stable, consistent,homogeneous and uniform."; else cout<<"Series 1 is more stable, consistent,homogeneous and uniform."; return 0; }
run
|
edit
|
history
|
help
0
Microsoft - MaxEmployeeAttendence (R repititions - 1st step towards DP solution)
Ultimate gauss
Continuous Sub Set with given sum
Exempel 2
Pointer to class members
pangram
Best buy/sell day in stock
Programa 3(Creo que ya esta)
Get all anagrams from given words
WeekAgenda