TITLE: Approximation to unsolvable system of equations
QUESTION [8 upvotes]: 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).

REPLY [2 votes]: None of the answers thus far have dealt with the integer constraint on $(A,B)$.
If we define two vectors, one integer and one real,
$$\eqalign{
a &= [\, A \,\, B \,]^T \cr
x &= [\, C \,\, D \,]^T \cr
}$$
Then the problem is to minimize the function $$f=\|M-ax^T\|^2_F$$
where $M = [\, 1/2 \,\,\, 5/6;\, 1/8 \,\,\,1/2 \,]$.
Assume that the integer vector, $a$, is known or given. Then by setting the gradient zero, we can solve explicitly for the optimum real vector
$$\eqalign{ x &= \frac{M^Ta}{a^Ta} }$$
Now all we need to do is write a program to search through lots of integer vectors.

#!/usr/bin/env  julia
M = [ 1/2 5/6; 1/8 1/2 ];
n=999; fmin=5.0;
for i=1:n, j=1:n
   a = [i j]';
   x = M'*a/(a'*a);
   f = vecnorm(M-a*x');
   if f < fmin
      @printf("(%d,%d), ", i,j)
      fmin = f
   end
end
(1,1), (2,1), (15,8), (17,9), (19,10), (21,11), (23,12), (25,13),
(27,14), (29,15), (147,76), (176,91), (205,106), (234,121),
(263,136), (292,151), (555,287), (847,438)


Note that the ratio  (i/j) is approximately $1.9$ for all these solutions.  To speed things up, we can use this ratio to limit the range on the second index, and extend the search range to even larger integers.

#!/usr/bin/env  julia
M = [ 1/2 5/6; 1/8 1/2 ];
i,j = (847,438);
a=[i j]'; x=M'*a/(a'*a);
n=99999; fmin=vecnorm(M-a*x');
for i=1:n, j=round(Int,i/2.1):round(Int,i/1.7)
   a = [i j]'
   x = M'*a/(a'*a)
   f = vecnorm(x*a'-M')
   if f < fmin
      @printf("(%d,%d), ", i,j)
      fmin = f
   end
end
(1139,589), (3125,1616), (4264,2205),
(5403,2794), (9667,4999), (52599,27200)


The solution corresponding to the penultimate index pair is
$$\eqalign{
  a &= [\, 9667 \,\,\, 4999 \,]^T \cr
  x &= [\, 4.6085224452467385 \,\,\, 8.91189971076149 \,]^T \times 10^{-5} \cr
  f &= 0.017838286620463398 \cr
}$$
The best of the small ($\le 100$) index pairs is 
$$\eqalign{
  a &= [\, 29 \,\,\, 15 \,]^T \cr
  x &= [\, 0.015361163227016885 \,\,\, 0.029706066291432145 \,]^T \cr
  f &= 0.01783829737335834 \cr
}$$