```
findExtremeOps(list_) :=
(If(add(list) >= sub(list), maxNum = add(list) && maxOp = "addition",
maxNum = sub(list) && maxOp = "subtraction");
If(mult(list) > max(list),
maxNum = mult(list) && maxOp = "multiplication",
If(div(list) > max(list), maxNum = div(list) && maxOp = "division",
If(exp(list) > max(list),
maxNum = exp(list) && maxOp = "exponentiation",
checkExtremeOps(list, maxNum, maxOp)))))
checkExtremeOps(list_, maxNum_, maxOp_) :=
(If(maxOp ==
"addition", (If(maxNum == sub(list), addSub = true, null);
If(maxNum == mult(list),
If(addSub == true, addSub = false && addSubMult = true,
addMult = true), null);
If(maxNum == div(list),
If(addSub == true, addSub = false && addSubDiv = true,
If(addSubMult == true,
addSubMult = false && addSubMultDiv = true,
If(addMult == true, addMult = false && addMultDiv = true,
addDiv = true))), null);
If(maxNum == exp(list),
If(addSub == true, addSub = false && addSubExp = true,
If(addMult == true, addMult = false && addMultExp = true,
If(addSubMult == true,
addSubMult = false && addSubMultExp = true,
If(addDiv == true, addDiv = false && addDivExp = true,
If(addSubMultDiv == true,
addSubMultDiv = false && addSubMultExp = true,
addExp = true))))))), null);
If(maxOp ==
"subtraction", (If(MaxNum == mult(list), subMult = true, null);
If(maxNum == div(list),
If(subMult == true, subMult = false && subMultDiv = true,
subDiv = true), null);
If(maxNum == exp(list),
If(subMult == true, subMult = false && subMultExp = true,
If(subDiv == true, subDiv = false && subDivExp = true,
If(subMultDiv == true,
subMultDiv = false && subMultDivExp = true,
subExp = true))))), null);
If(maxOp ==
"multiplication", (If(MaxNum == div(list), multDiv = true, null);
If(maxNum == exp(list),
If(multDiv == true, multDiv = false && multDivExp = true,
multExp = true))), null);
If(maxOp == "division",
If(MaxNum == exp(list), DivExp = true, null), null);
displayExtremeOps(maxNum, maxOp, addSub, addSubMult, addSubMultDiv,
addSubMultDivExp, addMult, addMultDiv, addMultDivExp, addDiv,
addDivExp, addExp, subMult, subMultDiv, subMultDivExp, subDiv,
subDivExp, subExp, multDiv, multDivExp, multExp, divExp))
displayExtremeOps(maxNum_, maxOp_, addSub_, addSubMult_,
addSubMultDiv_, addSubMultDivExp_, addMult_, addMultDiv_,
addMultDivExp_, addDiv_, addDivExp_, addExp_, subMult_, subMultDiv_,
subMultDivExp_, subDiv_, subDivExp_, subExp_, multDiv_,
multDivExp_, multExp_, divExp_) :=
(StringForm(
"The operation that produces the greatest value is `` with a value
of ``.", maxOp, maxNum);
(*still need to check for same numbers*))
add(list_) :=
(For(i = 1, i <= length(list), i++, sum += list((i));
Return(sum)))
sub(list_) :=
(diff = list((1));
For(i = 2, i <= length(list), i++, diff -= list((i));
Return(diff)))
mult(list_) :=
(prod = list((1));
For(i = 2, i <= length(list), i++, prod *= list((i));
Return(prod)))
div(list_) :=
(quot = list((1));
For(i = 2, i <= length(list), i++, quot /= list((i));
Return(quot)))
exp(list_) :=
(res = list((1));
For(i = 2, i <= length(list), i++, res ^= list((i));
Return(res)))
```

Things got messy when I realized I had to check for same numbers. I probably did not take the best route but this is just for a school project. Not sure what I’m doing wrong here. Here’s what I get when I test it. Note: I still need to add the portion in the display function where I check which values are same, if at all.

Input: findExtremeOps({1, 2, 3, 4, 5})

Output:

```
If(Null > max({1, 2, 3, 4, 5}),
maxNum = mult({1, 2, 3, 4, 5}) && maxOp = "multiplication",
If(div({1, 2, 3, 4, 5}) > max({1, 2, 3, 4, 5}),
maxNum = div({1, 2, 3, 4, 5}) && maxOp = "division",
If(exp({1, 2, 3, 4, 5}) > max({1, 2, 3, 4, 5}),
maxNum = exp({1, 2, 3, 4, 5}) && maxOp = "exponentiation",
checkExtremeOps({1, 2, 3, 4, 5}, maxNum, maxOp))))
```

Thanks for your help!