Statistics for Random access over wireless links: optimal rate and activity probability selection