Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions Contrib/LaTech/DiscreteMath/ch1s1_propositions/ifthen1.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## DESCRIPTION
## Gives the if-then statement "If you strike me down, then I become more powerful."
## and asks for its propositional variations from a popup menu of statements.
## ENDDESCRIPTION

## DBsubject(Discrete Math)
## DBchapter(Logic)
## DBsection(Propositional Logic)
## Date(06/03/2026)
## Institution(Louisiana Tech University)
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','propositional logic','converse','contrapositive')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"PGcourse.pl",
"PGML.pl"
);

## Create an array of possible statement variations
$a = ["You don't strike me down or I become more powerful.",
"You strike me down and I don't become more powerful.",
"If I don't become more powerful, then you don't strike me down.",
"If I become more powerful, then you strike me down.",
"I become more powerful if you strike me down.",
"You strike me down if I become more powerful.",
"I don't become more powerful and you don't strike me down.",
"You strike me down and I become more powerful."];

## Create the popup menus with the correct answers
$pop1 = PopUp(["Choose...",$a], 1);
$pop2 = PopUp(["Choose...",$a], 2);
$pop3 = PopUp(["Choose...",$a], 3);
$pop4 = PopUp(["Choose...",$a], 4);
$pop5 = PopUp(["Choose...",$a], 5);

## Display question
TEXT(beginproblem());

BEGIN_PGML
Consider the following statement:

*"If you strike me down, then I become more powerful."*

Choose the equivalent statement that uses the words "and" or "or": [_]{$pop1}

Choose the negation of the statement: [_]{$pop2}

Choose the contrapositive of the statement: [_]{$pop3}

Choose the converse of the statement: [_]{$pop4}

Choose the equivalent statement that uses the words "if" or "then": [_]{$pop5}

END_PGML

BEGIN_PGML_SOLUTION
Solutions:

Choose the equivalent statement that uses the words "and" or "or": [$pop1]

Choose the negation of the statement: [$pop2]

Choose the contrapositive of the statement: [$pop3]

Choose the converse of the statement: [$pop4]

Choose the equivalent statement that uses the words "if" or "then": [$pop5]

END_PGML_SOLUTION

ENDDOCUMENT();
77 changes: 77 additions & 0 deletions Contrib/LaTech/DiscreteMath/ch1s1_propositions/ifthen2.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## DESCRIPTION
## Gives the if-then statement "If it bleeds, then we can kill it."
## and asks for its propositional variations from a popup menu of statements.
## ENDDESCRIPTION

## DBsubject(Discrete Math)
## DBchapter(Logic)
## DBsection(Propositional Logic)
## Date(06/03/2026)
## Institution(Louisiana Tech University)
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','propositional logic','converse','contrapositive')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"PGcourse.pl",
"PGML.pl"
);

## Create an array of possible statement variations
$a = ["We can kill it or it doesn't bleed.",
"We can't kill it and it bleeds.",
"If we can't kill it, then it doesn't bleed.",
"If we can kill it, then it bleeds.",
"We can kill it if it bleeds.",
"It bleeds if we can kill it.",
"It doesn't bleed and we can't kill it.",
"It bleeds and we can kill it."];

## Create the popup menus with the correct answers
$pop1 = PopUp(["Choose...",$a], 1);
$pop2 = PopUp(["Choose...",$a], 2);
$pop3 = PopUp(["Choose...",$a], 3);
$pop4 = PopUp(["Choose...",$a], 4);
$pop5 = PopUp(["Choose...",$a], 5);

## Display question
TEXT(beginproblem());

BEGIN_PGML
Consider the following statement:

*"If it bleeds, then we can kill it."*

Choose the equivalent statement that uses the words "and" or "or": [_]{$pop1}

Choose the negation of the statement: [_]{$pop2}

Choose the contrapositive of the statement: [_]{$pop3}

Choose the converse of the statement: [_]{$pop4}

Choose the equivalent statement that uses the words "if" or "then": [_]{$pop5}

END_PGML

BEGIN_PGML_SOLUTION
Solutions:

Choose the equivalent statement that uses the words "and" or "or": [$pop1]

Choose the negation of the statement: [$pop2]

Choose the contrapositive of the statement: [$pop3]

Choose the converse of the statement: [$pop4]

Choose the equivalent statement that uses the words "if" or "then": [$pop5]

END_PGML_SOLUTION

ENDDOCUMENT();
85 changes: 85 additions & 0 deletions Contrib/LaTech/DiscreteMath/ch1s1_propositions/prop1.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## DESCRIPTION
## Generates statements with logical connectives and asks whether they are true or false.
## ENDDESCRIPTION

## DBsubject(Discrete Math)
## DBchapter(Logic)
## DBsection(Propositional Logic)
## Date(06/03/2026)
## Institution(Louisiana Tech)
## Author(Jason Terry)
## Level(2)
## KEYWORDS('discrete math','logic','propositional logic','and','or','implication','negation','true','false')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"PGcourse.pl",
"PGML.pl"
);

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create random parameters for a false statement
$a = random(-5,-1,1);
$b = random(1,5,1);

## Create random parameters for a true statement
$n = random(2,5,1);
$nf = fact($n);

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());

BEGIN_PGML
Determine the truth value of the following statements. *To discourage random guessing, you must answer all problems correctly to receive credit.*

[_]{$popTrue}: "If Earth's sun is blue, then the atomic number of gold is 69."

[_]{$popTrue} :"It is not the case that: (Your math instructor's name is Obi-Wan Kenobi OR Earth's sun is blue)."

[_]{$popFalse} :"It is not the case that: (Your math instructor's name is Obi-Wan Kenobi if and only if Earth's sun is blue)."

[_]{$popTrue} :[`` ([$b]<[$a]) \vee ([$n]! = [$nf]) ``]

[_]{$popFalse} :[`` ([$b]<[$a]) \wedge ([$n]! = [$nf]) ``]

[_]{$popFalse} :[`` ([$n]! = [$nf]) \Rightarrow ([$b]<[$a]) ``]

[_]{$popTrue} :[`` ([$b]<[$a]) \Rightarrow ([$n]! = [$nf]) ``]

[_]{$popFalse} :[`` \neg (\neg (\pi = 3.14)) ``]

END_PGML

BEGIN_PGML_SOLUTION
Solutions:

[$popTrue]: "If Earth's sun is blue, then the atomic number of gold is 69."

[$popTrue] :"It is not the case that: (Your math instructor's name is Obi-Wan Kenobi OR Earth's sun is blue)."

[$popFalse] :"It is not the case that: (Your math instructor's name is Obi-Wan Kenobi if and only if Earth's sun is blue)."

[$popTrue] :[`` ([$b]<[$a]) \vee ([$n]! = [$nf]) ``]

[$popFalse] :[`` ([$b]<[$a]) \wedge ([$n]! = [$nf]) ``]

[$popFalse] :[`` ([$n]! = [$nf]) \Rightarrow ([$b]<[$a]) ``]

[$popTrue] :[`` ([$b]<[$a]) \Rightarrow ([$n]! = [$nf]) ``]

[$popFalse] :[`` \neg (\neg (\pi = 3.14)) ``]

END_PGML_SOLUTION

ENDDOCUMENT();
65 changes: 65 additions & 0 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable1.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## DESCRIPTION
## Generates a truth table to complete for the statement [P and T].
## ENDDESCRIPTION

## DBsubject(Discrete Math)
## DBchapter(Logic)
## DBsection(Equivalent Statements)
## Date(06/03/2026)
## Institution(Louisiana Tech University)
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());

BEGIN_PGML
Complete the following truth table.

[@
DataTable([
["\\(P\\)","\\( P \\wedge T\\)"],
["\\(T\\)",PGML('[____]{$popTrue}')],
["\\(F\\)",PGML('[____]{$popFalse}')]
],
midrules => 1, align => '| c | c |'
);
@]***

END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
["\\(P\\)","\\( P \\wedge T\\)"],
["\\(T\\)",PGML('[$popTrue]')],
["\\(F\\)",PGML('[$popFalse]')]
],
midrules => 1, align => '| c | c |'
);
@]***

END_PGML_SOLUTION

ENDDOCUMENT();
65 changes: 65 additions & 0 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable2.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## DESCRIPTION
## Generates a truth table to complete for the statement [P or F].
## ENDDESCRIPTION

## DBsubject(Discrete Math)
## DBchapter(Logic)
## DBsection(Equivalent Statements)
## Date(06/03/2026)
## Institution(Louisiana Tech University)
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());

BEGIN_PGML
Complete the following truth table.

[@
DataTable([
["\\(P\\)","\\( P \\vee F\\)"],
["\\(T\\)",PGML('[____]{$popTrue}')],
["\\(F\\)",PGML('[____]{$popFalse}')]
],
midrules => 1, align => '| c | c |'
);
@]***

END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
["\\(P\\)","\\( P \\vee F\\)"],
["\\(T\\)",PGML('[$popTrue]')],
["\\(F\\)",PGML('[$popFalse]')]
],
midrules => 1, align => '| c | c |'
);
@]***

END_PGML_SOLUTION

ENDDOCUMENT();
Loading