From f8b76aac30ca5886bf91177f13a3e7b58b728417 Mon Sep 17 00:00:00 2001 From: REETESH TOMAR <54767198+Reetesh-Tomar@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:14:00 +0530 Subject: [PATCH 01/10] readme --- .../10 days of statistics Hackerrank/readme.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/readme.txt diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/readme.txt b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/readme.txt new file mode 100644 index 0000000..377ed7a --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/readme.txt @@ -0,0 +1 @@ +Added readme file From 38afef0dccba50fbd653a382fb054da2c6ae14ca Mon Sep 17 00:00:00 2001 From: REETESH TOMAR <54767198+Reetesh-Tomar@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:15:07 +0530 Subject: [PATCH 02/10] geometric distribution 2 --- .../geometric distribution 2.cpp | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution 2.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution 2.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution 2.cpp new file mode 100644 index 0000000..21fd700 --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution 2.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + float n,d; + cin>>n>>d; + int t; + cin>>t; + double p=(n*1.000)/(d*1.0000); + + double q=1-p; + double g=0.000; + for(int i=1;i Date: Tue, 18 Oct 2022 01:15:57 +0530 Subject: [PATCH 03/10] geometric distribution --- .../geometric distribution.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution.cpp new file mode 100644 index 0000000..ef6bf32 --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/geometric distribution.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + float n,d; + cin>>n>>d; + int t; + cin>>t; + double p=(n*1.000)/(d*1.0000); + + double q=1-p; + double g=pow(q,t-1)*p; + + cout << fixed < Date: Tue, 18 Oct 2022 01:16:57 +0530 Subject: [PATCH 04/10] least square regression --- .../least square regression.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/least square regression.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/least square regression.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/least square regression.cpp new file mode 100644 index 0000000..f7ae3b1 --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/least square regression.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + +//least square regression +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + double x,y; + double sumx=0.00,sumy=0.00; + double sq_sumx=0.00,sq_sumy=0.00,sum_xy=0.00; + + for(int i=0;i<5;++i) + { cin>>x>>y; + sumx=sumx+x; + sumy=sumy+y; + sq_sumx=sq_sumx+pow(x,2); + sum_xy=sum_xy+x*y; + } + double meanx=sumx/5; + double meany=sumx/5; + + double b=(5*sum_xy-(sumx*sumy))/(5*sq_sumx-pow(sumx,2)); + double a=meany-b*meanx; + double Y=a+(b*80)-1; + cout< Date: Tue, 18 Oct 2022 01:17:29 +0530 Subject: [PATCH 05/10] mean, median and mode --- .../mean, median and mode.cpp | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/mean, median and mode.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/mean, median and mode.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/mean, median and mode.cpp new file mode 100644 index 0000000..039f40d --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/mean, median and mode.cpp @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + int n; + cin>>n; + int ar[n]; + float s=0.0; + for(int i=0;i>ar[i]; + for(int i=0;imc) + { + mc=c; + mode=ar[i]; + } + } + cout< Date: Tue, 18 Oct 2022 01:18:00 +0530 Subject: [PATCH 06/10] normal distribution --- .../normal distribution.cpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/normal distribution.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/normal distribution.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/normal distribution.cpp new file mode 100644 index 0000000..57de880 --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/normal distribution.cpp @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + + +int main() +{ + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + double mean,sd; + cin>>mean>>sd; + double q1; + cin>>q1; + double q2l,q2u; + cin>>q2l>>q2u; + double N1=0.000; + + for(double x=19.5;x>=0;--x) + { + N1=N1+pow(2*2.506*pow(2.718,pow(x-20,2)/8),-1); + } + cout< Date: Tue, 18 Oct 2022 01:18:28 +0530 Subject: [PATCH 07/10] quartile --- .../quartile program.cpp | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/quartile program.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/quartile program.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/quartile program.cpp new file mode 100644 index 0000000..e0750be --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/quartile program.cpp @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + int n; + cin>>n; + int ar[n]; + for(int i=0;i>ar[i]; + sort(ar,ar+n); + int q1,q2,q3,index,c=0,d=0; + if(n%2!=0) + { + index=n/2; + q2=ar[index]; + for(int i=0;i Date: Tue, 18 Oct 2022 01:18:52 +0530 Subject: [PATCH 08/10] weighted mean --- .../weighted mean.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/weighted mean.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/weighted mean.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/weighted mean.cpp new file mode 100644 index 0000000..698a91f --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/weighted mean.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + int n; + cin>>n; + int x[n],w[n]; + for(int i=0;i>x[i]; + for(int i=0;i>w[i]; + float product=0.0; + float sum_w=0.0; + for(int i=0;i Date: Tue, 18 Oct 2022 01:19:30 +0530 Subject: [PATCH 09/10] poisson distribution --- .../poisson distribution.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution.cpp new file mode 100644 index 0000000..eb03c69 --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution.cpp @@ -0,0 +1,22 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + double mean; + cin>>mean; + int k; + cin>>k; + long long int k_f=1; + for(long long int i=1;i<=k;++i) + k_f=(k_f*i); + double pd=(pow(mean,k)*pow(2.71828,-(mean)))/k_f; + cout< Date: Tue, 18 Oct 2022 01:20:05 +0530 Subject: [PATCH 10/10] poisson dist 2 --- .../poisson distribution2.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution2.cpp diff --git a/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution2.cpp b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution2.cpp new file mode 100644 index 0000000..0528bcf --- /dev/null +++ b/Hackerrank + Geeks for Geeks + DS Courseware/10 days of statistics Hackerrank/poisson distribution2.cpp @@ -0,0 +1,22 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + /* Enter your code here. Read input from STDIN. Print output to STDOUT */ + double X,Y; + cin>>X>>Y; + + double Ca=160+40*(X+pow(X,2)); + + double Cb=128+40*(Y+pow(Y,2)); + cout<