Linear Inequality

Enter a linear inequality based on a description

Complete Code

Download file: LinearInequality.pg

POD for Macro Files

PG problem file

Explanation

DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'parserLinearRelation.pl',
    'PGcourse.pl');

Preamble

The macro file parserLinearRelation.pl must be loaded to be able to use the LinearRelation object.

Context("LinearRelation");

do {
    $a = random(2, 6);
    $b = random(2, 6);
} until ($a != $b);
$ab = $a * $b;

$lr = LinearRelation("$a x + $b y < $ab")->reduce;

Setup

This perl code sets up the problem.
BEGIN_PGML
The line [`L`] that passes through the point [`([$b],0)`] and [`(0,[$a])`]
divides the [`xy`]-plane into two regions.  What is the linear relation that
describes the half-plane containing the origin?  Note, do not include the points
on the line?

[__]{$lr}
END_PGML

Statement

This is the problem statement in PGML.
BEGIN_PGML_SOLUTION
[`[$lr]`]
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.