# An efficient way of finding max value under 2 scenarios.

#### Hirzik

##### New member
Hello.

My questions are:

Which section of math the problem falls under?

Is there a formula to find the number of possible solutions for either of the scenarios?

What is the most efficient way of solving this type of problem?

Thank you.

The problem

There are variables X1, X2, X3, and X4. Each variable is equidistant from the subsequent one (distance between variables is unrelated to their values). I need to find Y(max) under 2 scenarios. Scenario 1: Intervals cannot overlap, intervals have to be equidistant, and an interval can only be formed from right to left by subtraction. Scenario 2: Intervals cannot overlap, intervals don’t have to be equidistant, and an interval can only be formed from right to left by subtraction.

If I am not mistaken all possible solutions for scenario 1 are

 Y1 = (X2-X1) + (X3-X2) + (X4-X3) Y1 = (X2-X1) + (X4-X3) Y1 = (X3-X2) + (X4-X3) Y1 = (X2-X1) + (X3-X2) Y1 = (X3-X2) Y1 = (X3-X1) Y1 = (X4-X3) Y1 = (X4-X2) Y1 = (X4-X1) Y1 = (X2-X1)

Scenario 2 all possible solutions would be all of the above with addition of

 Y1 = (X2 - X1) + (X4 - X2) Y1 = (X3 - X1) + (X4 - X3)

So my questions are which section of math this type of problem falls under? Is there a formula to find the number of all possible solutions for either scenario? What is the most efficient way to solve these type of problems? (Excel or program etc) Thank you.

#### Hirzik

##### New member
deleting double post

Last edited:

#### JeffM

##### Elite Member
I cannot answer your question because it makes no sense to me at all.

"Each variable is equidistant from the subsequent one ... [but] is unrelated to their values" seems like complete gobbledygook. Moreover, there seem to be two different kinds of variables, x and y types. What is their relation. And so on.

#### Hirzik

##### New member
I cannot answer your question because it makes no sense to me at all.

"Each variable is equidistant from the subsequent one ... [but] is unrelated to their values" seems like complete gobbledygook. Moreover, there seem to be two different kinds of variables, x and y types. What is their relation. And so on.
Thank you for your response.

 Y​ X1 X2 X3 X4 c​ c​ c​

This would be a visual representation of the problem. Where by combining X variables I need to find Y max value. For example if X1=1 X2=2 X3=3 X4=4 Y max=3 and can be found 2 ways. The problem has several constrains.

Scenario 1 constrains are:

Intervals can only be formed from right to left by subtraction. In other words X2-X1 is allowed but X1-X2 is not.

Second constraint, when finding Y max by combining intervals formed by X, those intervals have to be equidistant, so (X2-X1)+(X3-X2) c+c is allowed but (X2-X1)+(X4-X2) c+2c is not allowed

Third: intervals cannot overlap, so (X2-X1)+(X3-X2) is ok but (X2-X1)+(X3-X1) is not (this example also violates equidistant constraint)

In scenario 2 the equidistant constraint is removed.

My questions regarding this problem are: which section of math this type of problem falls under: calculus, probability or some combination of which?

Is there a way to find a number of possible solution for either Scenario 1 or Scenario 2 with a formula without righting out all possible solutions and adding them?

What is the most efficient way of solving this type of problem? Is there a program available where I can input variable values and constraints, and it would produce Y max without me having to code all possible solutions first?

Thank you.

Last edited by a moderator: