I am working on a project and need to find the "closest" numerical values that satisfy the following equations:
\begin{equation} \left\{ \begin{array}{} A \cdot C = \frac{1}{2} \\ A \cdot D = \frac{5}{6} \\ B \cdot C = \frac{1}{8} \\ B \cdot D = \frac{1}{2} \end{array} \right. \end{equation}
Where $A$ and $B$ are under the constraint that they are non-negative integers and that $C$ and $D$ must be greater than zero but less than or equal to $1$.
From what I have tried so far, it seems no analytical solution exists. For my purposes an approximate solution will suffice (matches the left-hand side of the equation to several decimal points). Having obtained my BS in engineering, my guilty pleasure is Excel's Solver add-in. Using this tool to the best of my ability, I have yet to obtain a satisfactory approximate solution.
I am not asking anyone to "solve" this for me (though I wouldn't object), but would appreciate being pointed in the right direction. To summarize:
- I need to find values for $A$, $B$, $C$, and $D$ which fall under the constraints mentioned above and provide the closest values to the actual values on the left-hand side of the above equations.
- If the closest values are still unsatisfactory, is there someway of proving that they are indeed the "best" set of values (assuming the method used to find them does not inherently identify the "best" set).
- If there is a matter of tradeoff in accuracy vs integer size, I would prefer the smallest value integers possible that still provide reasonably close solutions to the equations (several decimal points).
Let
$$x_1 := \log_2 (a) \qquad \qquad x_2 := \log_2 (b) \qquad \qquad x_3 := \log_2 (c) \qquad \qquad x_4 := \log_2 (d)$$
Thus, the original system of bilinear equations can be transformed into a system of linear equations
$$\begin{bmatrix} 1 & 0 & 1 & 0\\ 1 & 0 & 0 & 1\\ 0 & 1 & 1 & 0\\ 0 & 1 & 0 & 1\end{bmatrix} \begin{bmatrix} x_1\\ x_2\\ x_3\\ x_4\end{bmatrix} = \begin{bmatrix} -1\\ \log_2 \left(\frac 5 6\right)\\ -3\\ -1\end{bmatrix}$$
Find the least-squares solution $(\hat x_1, \hat x_2, \hat x_3, \hat x_4)$ and then compute the corresponding $(\hat a,\hat b,\hat c,\hat d)$.
In MATLAB:
Unfortunately, the matrix is singular:
We then find one solution to the "normal equations":
The corresponding $(\hat a,\hat b,\hat c,\hat d)$ is, thus:
We introduce a new matrix:
The absolute error is:
which is quite large.