Snake bites (i.e pinch flats) depend on tyre strength, tube thickness (in case you use tubes), rider weight, riding style, terain and luck (or unluck). You really need to experiment with the pressures. For example test if 25/30 PSI (front/rear) feels good and see how long you can go with that without a pinch flat. If you get a pinch flat on the rear once a year then I guess you can continue using 25/30. But if you, like me, get them once a week then you definitelly need to increase the pressure. Note that pinch flats usually happen on the rear. In the last 3 years I've had 2 pinch flats on the front and like 20 on the rear.
If in the end of this iterative process you have increased the pressure too much (e.g 45+ PSI) then there is a high possibility that the specific bike and tyres you use are not meant to do what you make them do. i.e you need heavier tyres or more suspension.
Note that if you switch to tubeless you'll be able to run the same PSI and most probably completely avoid pinch flats. Note though that pinch flats are still possible.
Also, make sure you read:
For the other specific questions:
Can this be expressed as a function of the recommended minimum and maximum pressure?
No. Also, not many people agree with the min/max numbers. Some people say that the max is a warning to never exceed that and just a number to reach when initially inflating the tyre in order to let it seat correctly. Then you deflate to your desired number.
Is it different for the front and rear tire?
Definitelly. Some people say around 5 PSI more on the rear.