Linear inequalities throughout a convex region
Linear inequalities throughout a convex region
The listed points are all vertices of a nonempty, bounded, closed convex triangle or quadrilateral. For f(x,y)=ax+by, decide whether f≤c and f≥c each hold throughout the region, then find both extrema and the first listed vertex attaining each.
- 178 bytes
- CMPLX mode
Worked examples
Example 1
Original exercise 1. The listed points are all vertices of a nonempty, bounded, closed convex triangle or quadrilateral. For f(x,y)=ax+by, decide whether f≤c and f≥c each hold throughout the region, then find both extrema and the first listed vertex attaining each. Data: A=a = 2; B=b = 1; C=N, vertex count = 3; vertex 1: x = 0; vertex 1: y = 0; vertex 2: x = 4; vertex 2: y = 0; vertex 3: x = 1; vertex 3: y = 3; X=c = 8.
- (a)Calculate all requested quantities in the stated order. Output order: f≤c: 1: yes; 0: no; f≥c: 1: yes; 0: no; minimum; minimum vertex index; maximum; maximum vertex index.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. P=Σⱼ λⱼVⱼ; λⱼ≥0; Σⱼλⱼ=1.
- Written solution: f(V1)=(2)(0)+(1)(0)=0; f(V2)=(2)(4)+(1)(0)=8; f(V3)=(2)(1)+(1)(3)=5.
- minimum=0, V1; maximum=8, V2.
- ∀P: 0≤f(P)≤8; [max f≤8]=1; [min f≥8]=0. 1: yes; 0: no
- Retain exact fractions in written work; round only the final answer.
Example 2
Original exercise 2. The listed points are all vertices of a nonempty, bounded, closed convex triangle or quadrilateral. For f(x,y)=ax+by, decide whether f≤c and f≥c each hold throughout the region, then find both extrema and the first listed vertex attaining each. Data: A=a = 1; B=b = 2; C=N, vertex count = 4; vertex 1: x = 0; vertex 1: y = 0; vertex 2: x = 3; vertex 2: y = 0; vertex 3: x = 3; vertex 3: y = 2; vertex 4: x = 0; vertex 4: y = 2; X=c = 6.
- (a)Calculate all requested quantities in the stated order. Output order: f≤c: 1: yes; 0: no; f≥c: 1: yes; 0: no; minimum; minimum vertex index; maximum; maximum vertex index.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. P=Σⱼ λⱼVⱼ; λⱼ≥0; Σⱼλⱼ=1.
- Written solution: f(V1)=(1)(0)+(2)(0)=0; f(V2)=(1)(3)+(2)(0)=3; f(V3)=(1)(3)+(2)(2)=7; f(V4)=(1)(0)+(2)(2)=4.
- minimum=0, V1; maximum=7, V3.
- ∀P: 0≤f(P)≤7; [max f≤6]=0; [min f≥6]=0. 1: yes; 0: no
- Retain exact fractions in written work; round only the final answer.
Example 3
Original exercise 3. The listed points are all vertices of a nonempty, bounded, closed convex triangle or quadrilateral. For f(x,y)=ax+by, decide whether f≤c and f≥c each hold throughout the region, then find both extrema and the first listed vertex attaining each. Data: A=a = -2; B=b = 3; C=N, vertex count = 3; vertex 1: x = -1; vertex 1: y = 1; vertex 2: x = 3; vertex 2: y = 4; vertex 3: x = 5; vertex 3: y = -2; X=c = -12.
- (a)Calculate all requested quantities in the stated order. Output order: f≤c: 1: yes; 0: no; f≥c: 1: yes; 0: no; minimum; minimum vertex index; maximum; maximum vertex index.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. P=Σⱼ λⱼVⱼ; λⱼ≥0; Σⱼλⱼ=1.
- Written solution: f(V1)=(-2)(-1)+(3)(1)=5; f(V2)=(-2)(3)+(3)(4)=6; f(V3)=(-2)(5)+(3)(-2)=-16.
- minimum=-16, V3; maximum=6, V2.
- ∀P: -16≤f(P)≤6; [max f≤-12]=0; [min f≥-12]=0. 1: yes; 0: no
- Retain exact fractions in written work; round only the final answer.
When to use it
The listed points are all vertices of a nonempty, bounded, closed convex triangle or quadrilateral. For f(x,y)=ax+by, decide whether f≤c and f≥c each hold throughout the region, then find both extrema and the first listed vertex attaining each.
Input order
- A=a
- B=b
- C=N, vertex count
- j=1,…,N: xⱼ, yⱼ
- X=c
- Every displayed input is required unless a blank is explicitly specified. Empty EXE keeps a stored value, whereas typing 0 replaces it with zero. The listed domain conditions must be checked even when the program does not test all of them.
Output order
- f≤c: 1: yes; 0: no
- f≥c: 1: yes; 0: no
- minimum
- minimum vertex index
- maximum
- maximum vertex index
- Record the value and press EXE.
- The program has ended. Press AC to leave; EXE runs it again.
Conditions and limitations
- N∈{3,4}; a,b,c,xⱼ,yⱼ∈ℝ.
- f(x,y)=ax+by; f+r≤t ⇔ f≤t−r.
- Math ERROR: N∉{3,4}.
- Use CMPLX, but enter real numbers only. Imaginary components are used internally as markers; do not enter card values, coordinates or thresholds with an imaginary part. Use the displayed real result as instructed.
- Supply every actual vertex yourself; the program neither finds intersections nor checks feasibility or convexity. Only a linear objective on the stated closed convex region is covered. If a constant r appears on the left, replace c by c−r first. Tied extrema retain the first input index.
- Every displayed input is required unless a blank is explicitly specified. Empty EXE keeps a stored value, whereas typing 0 replaces it with zero. The listed domain conditions must be checked even when the program does not test all of them.
- Use consistent units throughout.
- Finite precision can lose small differences between large numbers or probabilities extremely near 0 or 1. An error marker is never a valid answer.
Checking access…