(random() > 0.5 ? -1 : 1) * (rand(9) + 1) (random() > 0.5 ? -1 : 1) * (rand(9) + 1)

Select the expression that matches the following phrase:

The sum of B and the product of A and x.

expr(["+", ["*", A, "x"], B])

  • expr(["+", ["*", -A, "x"], B])
  • expr(["+", ["*", A, "x"], -B])
  • expr(["+", ["*", B, "x"], A])
  • expr(["+", ["*", -B, "x"], -A])

What is the product of A and x?

What is the sum of B and expr(["*", A, "x"])?

Take the quantity A times x, and then add B.

What is the quantity of A times x?

What does adding B do?

B plus the product of A and x.

What is the product of A and x?

What is B plus expr(["*", A, "x"])?

The sum of B and the quantity A times x.

What is the quantity A times x?

What is the sum of B and expr(["*", A, "x"])?

Let's break this problem into smaller and easier pieces.

A \times x = \color{orange}{expr(["*", A, "x"])}

Ax{} + B

So, the original phrase can be written as expr(["+", ["*", A, "x"], B]).