Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FindMissingBinom
//g++ 7.4.0 //Interpolation: Binomial Expansion Method //code is created by Rezaul Hoque on January 12,2021 //please contact at jewelmrh@yahoo.com // if x advances by equal interval and corresponding x value for the value of y to be interpolated is one of the class limits of x series then binomial expansion method is suitable for interpolation #include <iostream> using namespace std; int main() { int n=6; int x[n]={1982,1983,1984,1985,1986,1987}; int y[n]={150,235,365,000,525,780}; //Detecting the missing value for (int i=0; i<n; i++) if(y[i]==000) cout<<"The missing value is at "<<i<<endl; //Since number of known value is 5, leading 5 differences will be zero. // Based on y[i]-i*y[i-1]+(i*(i-1)*y[i-2])/factorial (2)-(i*(i-1)*(i-2)*y[i-3])/factorial(3)+(i*(i-1)*(i-2)*(i-3)*y[i-4])/factorial(4)-(i*(i-1)*(i-2)*(i-3)*(i-4)*y[i-5])/factorial(5)+(i-1)*(i-2)*(i-3)*(i-4)*(i-5)*y[i-6])/factorial(6); // // So y[5]-5*y[4]+10*y[3]-10*y[2]+5*y[1]-y[0]=0; y[3]=(y[0]-5*y[1]+10*y[2]+5*y[4]-y[5])/10; cout<<"The missing value is :\t"<<y[3]; return 0; }
run
|
edit
|
history
|
help
0
HelloWorldExample
PyramidTransitionMatrix_recursive
BintTree vertical sum
Test 6(2020)
Ploshtina na krug
no copy elision
2015(M2)Mod.
count pairs with given sum hashing
Full System Specifications
dijkstra