Problems of petrologic mixing have been solved using a two-stage computer-based calculation. First, linear programming is used to obtain an approximate solution and to identify non-negative solution values. Then a conventional least squares calculation is performed using the analyses represented by non-negative solution values as input to yield an optimum set of solution values. The error attached to each solution value is estimated by an empirical procedure. Petrologic application of the program has been demonstrated with three types of calculations: chemical mode, magma mixing, and liquid line of descent.