[Archive!] Pure mathematics, physics, chemistry, etc.: brain-training problems not related to trade in any way - page 538

 

Clearly, there will almost always be no exact solution, as the number of equations will be greater than the number of unknowns.

Well, that's what the MOC is for. And the problem in Yusuf's formulation is exactly this method: draw a line through some cloud of points, and optimally from the point of view of MNA. He doesn't just talk about normal equations.

 
I see.
 
Neutron:

So what's the solution to this scheme?


It is obvious.
 
Except that the conditions of the problem don't say that everyone has only six acquaintances:) Maybe something like this: (X-1)^6 = All the population of the globe. x is the number of acquaintances each person has. A very real value should be X.
 

does anyone know where to find a general solution to the equation?

x^0+x^1+x^2+x^3+.........x^n=A

^ is a power sign ;A is a constant

 

No way, only numerical methods. You can simplify by summing the geom. progression:

( x^(n+1) - 1 ) / ( x - 1 ) = A

Give a specific range of A, let's try to solve approximation with acceptable accuracy.

And with what precision should you find x, and in what range is n?

Also: x is hopefully positive?

P.S. If A, x > 0, it is easy to estimate x from below:

x = ( x^(n+1) + A - 1 ) / A > 1 - 1 / A

And then iterate (draw a graph of the functions y=x^(n+1)-1 and y=A(x-1) to see):

x(0) = 1 - 1 / A

x(k+1) = ( x(k)^(n+1) - 1 + A ) / A

Check at n = 10, A = 5:

x(0)=0.8, and the 12th iteration results in a number of 0.823679 to the nearest 0.000001.

A check shows that the left-hand side of the equality differs from the right-hand side by 0.000005.

 
Mathemat:

No way, only numerical methods. You can simplify by summing the geom. progression:

( x^(n+1) - 1 ) / ( x - 1 ) = A

Give me a specific range A, and we'll try to solve it approximatively, with acceptable accuracy.

And with what accuracy should I find x and in what range is n?

Also: x - hopefully positive?


Yes, x is positive. I spent half a day thinking how to solve it...- take out X to relieve the EA from cycles a bit)))

In my EA, I have arranged for a solution with a certain error in the result. Like consecutive increments.

So, there is no other way... I won't puzzle over it now, thank you).

 
I finished the post, there is an iterative solution. If you write a function, it will count quickly.
 
jelizavettka:


Yes, x is positive. I spent half a day thinking how to solve it...- to output X in order to relieve the Expert Advisor from cycles a bit)))

I have organised in the EA the selection of a solution with a certain margin of error in the result. Like consecutive increments...

So there is no other way... now I won't be puzzled, thank you).


Show me.

Here is my variant:

int start(){

   int n=12; // максимальная степень
   double A=125879;

   double x;
   int k;
   
   Alert("Начало: A="+DoubleToStr(A,8));
   
      if(Function(n,A,x,k)){
         Alert("x="+DoubleToStr(x,8)+". Проверка: A="+DoubleToStr(Formula(x,n),8)+". Итераций: "+k);
      }
      else{
         Alert("Переполнение");
      }
  
   return(0);
   
}


bool Function(int n,double A,double & x,int & k){
   double inf=MathPow(10,309);
   x=0;       
   double Step=10; // Начальный шаг, стоит поэкспериментировать со значением
   k=0;
      while(true){
         k++;
         double val=Formula(x,n);
            if(val>A || val==inf){
               x-=Step;
               Step/=2;
                  if(Step<0.000000000000001){ // 0.000000000000001 - определяет точность, увеличивать можно (снижать точность), уменьшать некуда
                     if(val==inf){
                        return(false);
                     }
                     else{
                        return(true);
                     }
                  }
            }
         x+=Step;               
      }  
}

double Formula(double x,int n){
   // x^0+x^1+x^2+x^3+.........x^n=A
   double sum=1+x;
      for(int i=2;i<=n;i++){
         sum+=MathPow(x,i);
      }
   return(sum);
}
 
Integer:


Show me.

Here is my variant:

I don't know much about other people's codes, but...
I've got something similar...

The step of the unknown is set first, and when the result passes over A, the part of the range of the pass with the decremented step.... is taken as A.

The accuracy is defined as the % of deviation of the resulting value "A" from the set value.

If the specified accuracy is not achieved, the step is reduced...

I have it all in Hebrew and not so pretty))