To find the number of black horses in the herd, we start with the total number of horses, which is 88. We're given that there are 31 white horses.
To find the number of black horses, we can use the following formula:
\[ \text{Number of black horses} = \text{Total horses} - \text{Number of white horses} \]
Substituting the numbers we have:
\[ \text{Number of black horses} = 88 - 31 = 57 \]
Now, to find the ratio of black horses to all horses, we have:
\[ \text{Ratio of black horses to all horses} = \frac{\text{Number of black horses}}{\text{Total horses}} = \frac{57}{88} \]
Thus, the number of black horses in the herd is 57, and the ratio of black horses to all horses is \( \frac{57}{88} \).