Let the number of white shirts be m, and the number of blue shirts be n. Hence, the total cost of the shirts = (1000m+1125n), and the number of shirts is (m+n)
The average price of the shirts is $ \frac{1000m+1125n}{m+n} $.
It is given that he set a fixed market price which was 25% higher than the average cost of all the shirts. He sold all the shirts at a discount of 10%.
Hence, the average selling price of the shirts = $ \left(\frac{1000m+1125n}{m+n}\right) \times \frac{5}{4} \times \frac{9}{10} = \frac{9}{8}\left(\frac{1000m+1125n}{m+n}\right) $
The average profit of the shirts = $ \frac{9}{8}\left(\frac{1000m+1125n}{m+n}\right) - \frac{1000m+1125n}{m+n} = \frac{1}{8}\left(\frac{1000m+1125n}{m+n}\right) $
The total profit of the shirts = $ \frac{1}{8}\left(\frac{1000m+1125n}{m+n}\right) \times (m+n) = \frac{1}{8}(1000m + 1125n) $
Now, $ \Rightarrow \frac{1}{8}(1000m + 1125n) = 51000 $
$ \Rightarrow 1000m + 1125n = 51000 \times 8 = 408000 $
Now to get the maximum number of shirts, we need to minimize n (since the coefficient of n is greater than the coefficient of m), but it can't be zero. Therefore, m has to be maximum.
$ m = \frac{408000-1125n}{1000} $
The maximum value of m such that m, and both are integers is m = 399, and n = 8 (by inspection)
Hence, the maximum number of shirts = m+n = 399+8 = 407