【線性規劃:可行區域及最大值、最小值】Linear Programming: Feasible Region and the Maximum or Minimum Value

SketchMath 數學團隊 SketchMath Maths Team | 更新 Updated 2026-10-20

逐條畫出不等式,塗出所有條件同時成立的可行區域,求出它的頂點,再把頂點代入目標函數 P = ax + by。最大值及最小值必定出現在頂點。Draw each inequality, shade the feasible region where all hold, find its vertices (corner points), and evaluate the objective function P = ax + by at each one. The maximum and minimum occur at vertices.

用 AI 逐步解線性規劃題目 Solve it with AI練習 37 條 DSE 模擬題 Practise 37 DSE-style questions
拖動 k:直線 2x + 3y = k 掃過塗了色的可行區域。它最後接觸的點是頂點 (4, 4),此時 k = 20,即例題 1 的最大值。 Drag k: the line 2x + 3y = k sweeps across the shaded feasible region. The last point it touches is the vertex (4, 4), where k = 20 is the maximum of Example 1. 自己試試 → Try it yourself →

線性規劃步驟 Linear Programming Steps

邊界線Boundary lines≤, ≥ 用實線;<, > 用虛線Solid for ≤, ≥; dashed for <, >
哪一邊?Which side?代入測試點,例如 (0, 0)Test a point such as (0, 0)
頂點Vertices解在每個角相交的兩條邊界方程Solve the two boundary equations that meet at each corner
最優值Optimum比較所有頂點的 PCompare P at all vertices
↑ 返回頁頂 Back to top

第一步:塗出符合不等式的一邊 Step 1: Shade the Side That Satisfies the Inequality

邊界線把平面分成兩邊。代入測試點,例如 (0, 0):若符合不等式,便塗出該點所在的一邊。≤, ≥ 用實線,<, > 用虛線。

A boundary line splits the plane in two. Test a point such as (0, 0): if it satisfies the inequality, shade its side. Use a solid line for ≤, ≥ and a dashed line for <, >.

移動測試點 P:在塗了色的一邊符合 x + y ≤ 8,在另一邊則不符合。 Slide the test point P: it satisfies x + y ≤ 8 on the shaded side and fails on the other.
↑ 返回頁頂 Back to top

直線方程不等式 Two-Variable Inequalities Linear Inequalities in Two Variables

若 a、b、c 為實數,且 a、b 不同時為 0,則 ax + by + c = 0 為二元一次方程式;亦因為佢嘅圖像為一條直線,所以又稱為直線方程式。以直線 2x + y = 2 為例,直線上的任意一點 (x, y) 都滿足方程式 2x + y = 2。因此,當點 P 的 x 坐標為 x₀,y 坐標則為 2 − 2x₀。

當我們將方程式其中的等號「=」改成不等號「>」、「≥」、「<」或「≤」就稱為二元一次不等式,例如 2x + y > 2 或 2x + y ≤ 2。既然係咁,滿足二元一次不等式嘅解又會形成點樣嘅圖形?一齊睇埋落去!

If a, b, c are real numbers and a, b are not both 0, then ax + by + c = 0 is a linear equation in two unknowns. Its graph is a straight line, so it is also called the equation of a straight line. For the line 2x + y = 2, every point (x, y) on the line satisfies the equation. So if a point P has x-coordinate x₀, its y-coordinate is 2 − 2x₀.

When the equals sign "=" is changed to ">", "≥", "<" or "≤", it becomes a linear inequality in two unknowns, for example 2x + y > 2 or 2x + y ≤ 2. What shape do the solutions of such an inequality make? Read on.

↑ 返回頁頂 Back to top

判別直線不等式範圍 Finding the Region of a Line Inequality

直線 2x + y = 2 將平面分成二個半平面,成為兩個半平面的界線。以直線上的座標 P 為例,當 P 的 x 坐標或 y 坐標「加大」時(例如 x 坐標 + 10、y 坐標 + 20),座標 P 會先向右移 10 個單位,再向上移 20 個單位,最後落在直線的右邊範圍。因此可得知,當不等式為「大於」時,範圍為右手邊;相反,當不等式為「小於」時,範圍為左手邊!

注意!用左/右去判別範圍就可以(先把 x 的係數寫成正數),唔好係咁思考「上還是下,左還是右」!

實際例子:範圍為 4x − y − 7 ≤ 0、3x − 4y + 11 ≥ 0、x + 3y − 5 ≥ 0。先看 4x − y − 7 ≤ 0,由於是「小於」,所以向左;再看 3x − 4y + 11 ≥ 0,由於是「大於」,所以向右;最後 x + 3y − 5 ≥ 0,由於是「大於」,所以向右。嚴格不等式(> 或 <)的界線用虛線,≥ 或 ≤ 的界線用實線。

The line 2x + y = 2 divides the plane into two half-planes, and the line is the boundary between them. Take a point P on the line and make its x- or y-coordinate larger (for example x + 10 and y + 20): P moves right 10 units and up 20 units and lands on the right of the line. So when the inequality is "greater than" the region is on the right-hand side; when it is "less than" the region is on the left-hand side.

Careful: judge by left / right only (with the x-coefficient written positive); do not keep thinking "up or down, left or right".

Example: the region 4x − y − 7 ≤ 0, 3x − 4y + 11 ≥ 0 and x + 3y − 5 ≥ 0. For 4x − y − 7 ≤ 0, "less than" means left; for 3x − 4y + 11 ≥ 0, "greater than" means right; for x + 3y − 5 ≥ 0, "greater than" means right. A strict inequality (> or <) has a dashed boundary line, a ≥ or ≤ has a solid one.

↑ 返回頁頂 Back to top

在線性範圍內求最大值/最小值 Finding a Maximum or Minimum in the Region

在滿足聯立不等式的條件下,我們還能考慮所求函數的極值問題,比如以上面的範圍(頂點 (−1, 2)、(3, 5)、(2, 1))作例子,求 f(x, y) = x − y 的最大值與最小值。

  1. 首先,設 x − y 為一條直線方程,可知 x − y = 0,即 x = y。利用 (1, 1)、(2, 2)、(3, 3) 三點,可以在圖上畫出 x = y 的圖像。
  2. 接著把直線向左向右推動,以觀察不同的頂點值,例如 (−1, 2)、(3, 5)、(2, 1)。
  3. 最後重新代入函數 f(x, y):(−1) − 2 = −3、3 − 5 = −2、2 − 1 = 1。

由此可見,最大值為 1,最大頂點為 (2, 1);最小值為 −3,最小頂點為 (−1, 2)。

Under the conditions of the system of inequalities we can also find the extreme values of a function. Using the region above (vertices (−1, 2), (3, 5) and (2, 1)), find the maximum and minimum of f(x, y) = x − y.

  1. Treat x − y as a line: x − y = 0, that is x = y. Use the points (1, 1), (2, 2), (3, 3) to draw it.
  2. Push the line left and right and watch which vertices it touches last: (−1, 2), (3, 5) and (2, 1).
  3. Put each vertex into f: (−1) − 2 = −3, 3 − 5 = −2, 2 − 1 = 1.

So the maximum is 1 at the vertex (2, 1), and the minimum is −3 at the vertex (−1, 2).

↑ 返回頁頂 Back to top

無需推線猜出最大值/最小值的方法 A Quick Way to Guess the Maximum and Minimum

假如覺得推線麻煩,可以有更快的方法猜到最大頂點/最小頂點嗎?當然有!同樣利用上面的範圍,求 f(x, y) = 2x − 3y 的最大值與最小值。

我們可以假設,x 與 y 分別是爸爸和媽媽,他們每天都會給你零用錢/問你拿家用,數量就視乎函數中 x 和 y 前面的數值,例如上述情況,每個 x 會給你 2 元,每個 y 則收取你 3 元;在這情況下,想自己得到最多的錢,就應該「x 有咁大攞咁大,y 有咁細攞咁細」;於是乎對於 (−1, 2)、(3, 5)、(2, 1) 呢三個頂點,我哋會見到 (2, 1) 係最大值,因為 x 係裡面最大,y 係裡面最細;至於另外兩個邊個係最小值就有啲難比較,所以都係代數入函數計算最穩陣:f(2, 1) = 1、f(−1, 2) = −8、f(3, 5) = −9。最大值為 1(在 (2, 1)),最小值為 −9(在 (3, 5))。

If pushing the line is a bother, there is a faster way to guess the best vertex. With the same region, find the maximum and minimum of f(x, y) = 2x − 3y.

Think of x and y as your father and mother: every day x gives you $2 for each unit of x, and y takes $3 for each unit of y. To end up with the most money you want "as much x as possible, as little y as possible". Among (−1, 2), (3, 5) and (2, 1), the vertex (2, 1) has the biggest x and the smallest y, so it gives the maximum. The other two are harder to compare by eye, so substituting into the function is the safest: f(2, 1) = 1, f(−1, 2) = −8, f(3, 5) = −9. The maximum is 1 at (2, 1) and the minimum is −9 at (3, 5).

↑ 返回頁頂 Back to top

線性規劃例題詳解 Worked Examples

例題 1 Example 1:求最大利潤 Maximise a profit

在 x ≥ 0, y ≥ 0, x + y ≤ 8, x + 2y ≤ 12 的條件下,求 P = 2x + 3y 的最大值。Find the maximum value of P = 2x + 3y subject to x ≥ 0, y ≥ 0, x + y ≤ 8, x + 2y ≤ 12.

  1. 頂點:(0, 0)、(8, 0)、(0, 6),以及 x + y = 8 與 x + 2y = 12 的交點 (4, 4)Vertices: (0, 0), (8, 0), (0, 6), and the meeting point of x + y = 8 and x + 2y = 12: (4, 4)
  2. 各頂點的 P:0、16、18、20P at the vertices: 0, 16, 18, 20

答案: Answer: 最大值 P = 20(在 (4, 4))Maximum P = 20 at (4, 4)

例題 2 Example 2:另一個目標函數 Another objective

在 x ≥ 0, y ≥ 0, 2x + y ≤ 10, x + 3y ≤ 15 的條件下,求 x + y 的最大值。Find the greatest value of x + y subject to x ≥ 0, y ≥ 0, 2x + y ≤ 10, x + 3y ≤ 15.

  1. 頂點:(0, 0)、(5, 0)、(0, 5),以及由 2x + y = 10、x + 3y = 15 得出的 (3, 4)Vertices: (0, 0), (5, 0), (0, 5), and (3, 4) from 2x + y = 10, x + 3y = 15
  2. x + y 的值:0, 5, 5, 7Values of x + y: 0, 5, 5, 7

答案: Answer: 7(在 (3, 4))7 at (3, 4)

↑ 返回頁頂 Back to top

💡 應試陷阱與秘訣 Exam Traps & Secrets

⚠️ 不要漏掉兩條斜線的交點 Do not forget the vertex from two slanted lines最優值常出現在兩條限制線的交點,必須解聯立方程才能求出。The optimum is often at the point where two constraint lines cross, which you must find by solving simultaneous equations.
⚠️ 整數解 Integer answers若 x 及 y 必須是整數,要檢查最優頂點附近的整點;頂點本身可能不符合要求。If x and y must be whole numbers, check lattice points near the best vertex; the vertex itself may not be allowed.
↑ 返回頁頂 Back to top

✏️ 自我測試:互動練習 Self-Test: Interactive Practice

溫習方法:點擊以下任何題目,即時在坐標網格載入並核對計算步驟。How to study: click any question to load it on the coordinate grid and check your steps.

(求最大值 Maximise)塗出 x ≥ 0, y ≥ 0, 3x + 2y ≤ 18, x + 4y ≤ 16 的區域,並求 5x + 4y 的最大值。Shade the region x ≥ 0, y ≥ 0, 3x + 2y ≤ 18, x + 4y ≤ 16 and find the maximum of 5x + 4y.
(應用題 Word problem)某店售賣 A、B 兩款貨品。列出存貨及時間限制的不等式,並求最佳組合。A shop sells packs of A and B. Write the constraints for a stock and time limit and find the best mix.
(解釋 Explain)為何線性函數在多邊形區域上的最大值會在頂點出現?Why does the maximum of a linear function on a polygon occur at a vertex?
↑ 返回頁頂 Back to top

線性規劃練習題(DSE 模擬題) Exercises: DSE-Style Practice

SketchMath 題庫內的 DSE 風格練習,選擇題及長題目均附解答。 DSE-style practice from the SketchMath question bank, with solutions for every MC and long question.

不等式及線性規劃 · 中五
29 條選擇題 29 MC · 8 條長題目 8 long questions

常見問題 Frequently Asked Questions

↑ 返回頁頂 Back to top

相關主題 Related Topics

聯立方程 Simultaneous Equations函數圖像變換 Transformations of Graphs不等式及線性規劃 Inequalities & Linear ProgrammingHKDSE 數學全部課題 HKDSE Math: all topicsDSE 數學公式表(全課題) HKDSE Maths Formula SheetDSE 數學練習(按年級) DSE Maths Practice by Form
線性規劃 DSE 練習題 Try a DSE Practice Question