Original Model: $$\max \quad z = x_1 + 3x_3$$ $$\text{Subject to: }\qquad\qquad\qquad\qquad\qquad\qquad$$ $$x_1 + 2x_2 + 7x_3 = 4$$ $$x_1 + 3x_2 + x_3 = 5$$ $$x_1, x_2, x_3 \ge 0$$
I am confused on how to put it into a simplex tableau because the constraints are already equations.
I know if the constraints were inequalities, I would add slack variables to turn the into equations, and those slack variables would be the basic variables I put on the left hand size of the tableau.
My other question is, what would I do if one of the equations was an inequality and the other was an equation. I would only have 1 basic variable.
As pointed out by Callculus$42$ in the comments is that in order to solve the model, we'll need to use artificial variables for each constraint that either has an equality or greater-than-or-equal-to inequality. Keep in mind too that in order for the Simplex algorithm to produce the most optimal result for the given model, it'll have as many basic variables as there are the number of constraints. Since we have two constraints for this model (we ignore the non-negativity constraints), we'll have two basic variables for the Simplex method to use.
There exists quite a few approaches for handling artificial variables:
To better explain these methods, let's proceed by demonstration starting with the Big-M approach:
Given the model: $$\max\quad z=x_1+3x_3$$ Subject to, $$x_1+2x_2+7x_3=4$$ $$x_1+3x_2+x_3=5$$ $$x_1,x_2,x_3\ge0$$
Let's convert it to standardized form as such:
$$\max\quad z-x_1-3x_3+M(a_1+a_2)=0$$ Subject to, $$x_1+2x_2+7x_3+a_1=4$$ $$x_1+3x_2+x_3+a_2=5$$ $$x_1,x_2,x_3,a_1,a_2\ge0$$
Transcribing this into our initial tableau would look like the following:
\begin{array} {|c|c|} \hline BV & z & x_1 & x_2 & x_3 & a_1 & a_2 & RHS & RT \\ \hline z & 1 & -1 & 0 & -3 & M & M & 0 & - \\ ? & 0 & 1 & 2 & 7 & 1 & 0 & 4 & - \\ ? & 0 & 1 & 3 & 1 & 0 & 1 & 5 & - \\ \hline \end{array}
As we can see, there are no basic variables for the second and third row, but however $a_1$ and $a_2$ are the closest variables to become basic variables. Thus, we shall solve for them by eliminating their objective row coefficients in the tableau to produce:
\begin{array} {|c|c|} \hline BV & z & x_1 & x_2 & x_3 & a_1 & a_2 & RHS & RT \\ \hline z & 1 & -2M-1 & -5M & -8M-3 & 0 & 0 & -9M & - \\ a_1 & 0 & 1 & 2 & 7 & 1 & 0 & 4 & \frac{4}{7} \\ a_2 & 0 & 1 & 3 & 1 & 0 & 1 & 5 & 5 \\ \hline \end{array}
From here, since $M$ is the "largest" number in $\Bbb R$, we'll pivot the $x_3$ column with the $a_1$ row and carry on with Simplex method like we normally would. However, keep in mind that in any point in the process that the Simplex method terminates, and there exists a $M$ in the output of the objective row function (which will happen if any artificial variables $a_j>0), then the model is infeasible.
$$$$ $$$$ Proceeding with the Two-Phase approach, we continue like we have done before, but instead of using $M$'s we simply change the objective function of the model like such:
Given the model: $$\max\quad z=x_1+3x_3$$ Subject to, $$x_1+2x_2+7x_3=4$$ $$x_1+3x_2+x_3=5$$ $$x_1,x_2,x_3\ge0$$
We put it into standard form in respect to the Two-Phase method: $$\max\quad z-x_1-3x_3=0$$ $$$$ $$\min\quad w = a_1+a_2$$ Subject to, $$x_1+2x_2+7x_3+a_1=4$$ $$x_1+3x_2+x_3+a_2=5$$ $$x_1,x_2,x_3\ge0$$
From here, we'll focus on solving the $w$ model first, and then once $a_1,a_2=0$ we'll drop their columns from the tableau, and replace the objective function row of that tableau with the standardized one with $z$, and then proceed normally via the Simplex method. Let's get started with the initial tableau:
\begin{array} {|c|c|} \hline BV & w & x_1 & x_2 & x_3 & a_1 & a_2 & RHS & RT \\ \hline w & 1 & 0 & 0 & 0 & -1 & -1 & 0 & - \\ ? & 0 & 1 & 2 & 7 & 1 & 0 & 4 & - \\ ? & 0 & 1 & 3 & 1 & 0 & 1 & 5 & - \\ \hline \end{array}
We'll solve for our basic variables to get the following: \begin{array} {|c|c|} \hline BV & w & x_1 & x_2 & x_3 & a_1 & a_2 & RHS & RT \\ \hline w & 1 & 2 & 5 & 8 & 0 & 0 & 9 & - \\ a_1 & 0 & 1 & 2 & 7 & 1 & 0 & 4 & - \\ a_2 & 0 & 1 & 3 & 1 & 0 & 1 & 5 & - \\ \hline \end{array}
After a few pivots we'll get the following tableau: \begin{array} {|c|c|} \hline BV & w & x_1 & x_2 & x_3 & a_1 & a_2 & RHS & RT \\ \hline w & 1 & 0 & 0 & 0 & -1 & -1 & 0 & - \\ x_3 & 0 & \frac{1}{19} & 0 & 1 & \frac{3}{19} & -\frac{14}{133} & \frac{2}{19} & - \\ x_2 & 0 & \frac{6}{19} & 1 & 0 & -\frac{1}{19} & \frac{7}{19} & \frac{31}{19} & - \\ \hline \end{array}
From which we'll drop the artificial columns and replace our objective row with the standardized row of our original model as such:
\begin{array} {|c|c|} \hline BV & z & x_1 & x_2 & x_3 & RHS & RT \\ \hline z & 1 & -1 & 0 & -3 & 0 & - \\ ? & 0 & \frac{1}{19} & 0 & 1 & \frac{2}{19} & - \\ x_2 & 0 & \frac{6}{19} & 1 & 0 & \frac{31}{19} & - \\ \hline \end{array}
and solve for our missing basic variable $x_3$ and proceed like we normally word with the Simplex Algorithm.