Re: CSMA
for your first question, use lagrange coefficients to evaluate the optimum value of p within 0 and 1. for more info search google.com
Added after 3 minutes:
for your second question, there sure will be collision in practice, there are 2 techniques in csma, one is collision detection which is used on ethernet cables and the other one is collision avoidance which is used on wireless systems like ieee 802.11.
the number of terminals on this network depends on the capacity of the network. the more terminals in network, the more collision you will have.