First, a little background. I have a master's in computer science and have had basic courses in linear algebra, calculus and discrete mathematics, number theory, etc.

Solving a linear system with 4 unknowns and 4 equations is of course trivial for me, although it's been a while since the last time I did gaussian elimination by hand

I have come across an annoying problem at work. I have reduced the problem to 4 equations with 4 unknowns, but two of the equations and unknowns have a condition attached to them. That is, if the condition is false, one of the unknowns is 0. If it is true, I have an equation expressing this unknown as a function of the other three, giving me one of the 4 equations. The same is true of one of the other unknowns and equations, albeit with another condition.

This basically gives four different linear systems, depending on the whether each of the two conditions are true or false. These four systems I have solved.

The real problems is that the conditions themselves involve the unknowns! So I don't know which linear system is the right one unless I already know the solution. Catch 22.

In other words:

a1*x1 + a2*x2 + a3*x3 + a4*x4 = a5

b1*x1 + b2*x2 + b3*x3 + b4*x4 = b5

if (f(x1,x2,x3,x4) < g(x1,x2,x3,x4))

then

c1*x1 + c2*x2 + c3*x3 + c4*x4 = c5

else

x3 = 0

if (h(x1,x2,x3,x4) < i(x1,x2,x3,x4))

then

d1*x1 + d2*x2 + d3*x3 + d4*x4 = d5

else

x4 = 0

where f, g, h, i are linear functions of the unknowns.

Of course my real problem is not as general as this, but the specific coefficients and functions are at work and I am at home now.

I just hope that somebody can shed some light on how to attack this kind of problem. Maybe it can be turned into something well known? I feel like I am missing some piece of information...