blob: 848a30dfe0a3ee514c5c4a0e2de2fd995541732c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# coding=utf-8
name = 'linear_opt/3'
slug = 'linear optimization'
description = '''\
<p>A set of points in the plane is defined by the inequalities</p>
<ul>
<li>0 ≤ <code>X</code> ≤ 5,</li>
<li><code>Y</code> ≥ 0,</li>
<li><code>X</code> + <code>Y</code> ≤ 7,</li>
<li><code>X</code> + 2*<code>Y</code> ≥ 4 and</li>
<li><code>Y</code> ≤ <code>X</code> + 5.</li>
</ul>
<p>The predicate <code>linear_opt(X, Y, MaxE)</code> should return the point (<code>X</code>, <code>Y</code>) where the expression <code>E = -0.4*X + 3.2*Y</code> has the largest value.</p>'''
hint = {}
|