線形計画問題です。この問題を解いてください

1件の回答

回答を書く

1115171

2026-06-26 16:55

+ フォロー

masさんの回答を図にしてみました。ベストアンサーは彼へ。

ところで代数的解法て何のことかな。シンプレックス法のこと?



---

参考

グラフはPythonで作成しました。



# Pythonのプログラムの始まり

import matplotlib.pyplot as plt

import numpy as np



# x = x1, y = x2と置く



def f1(x):

# x + 2y \u0026lt;= 14 ⇒ 2y \u0026lt;= -x + 14 ⇒ y \u0026lt;= -x/2 + 7

    return -x/2 + 7

def f2(x):

# x + y \u0026lt;= 8 ⇒ y \u0026lt;= -x + 8

    return -x + 8

def f3(x):

# 3x + y \u0026lt;= 18 ⇒ y \u0026lt;= -3x + 18

    return -3*x + 18

def fz(x):

# z = -2x -y ⇒ y = -2x -z

# z = -12と置く

    return -2*x -(-12)



x = np.linspace(0, 8, 100)

y1 = f1(x)

y2 = f2(x)

y3 = f3(x)

yz= fz(x)



plt.plot(x, y1, label='$f1: x + 2y \u0026lt;= 14$', color='red')

plt.plot(x, y2, label='$f2: x + y \u0026lt;= 8$',   color='orange')

plt.plot(x, y3, label='$f3: 3x + y \u0026lt;= 18$', color='green')

plt.plot(x, yz, label='$fz: z(=-12) = -2x -y$', color='black')



plt.xlabel('$x$')

plt.ylabel('$y$')

plt.grid(True, linestyle=':', color='black')

plt.legend()

plt.show()

# Pythonのプログラムの終わり



この図をExcelに貼り付けて水色の斜め線と幾つかの文と矢印を追加して画像を作成しました。

うったえる有益だ(0シェアするブックマークする

Copyright © 2026 AQ188.com All Rights Reserved.

博識 著作権所有