The aims of this paper are to analyze the performance of a one-dimensional ALOHA ad hoc network and to investigate the impact of the access probability of the ALOHA protocol on the network performance. As a performance metric we consider the average number of nodes that successfully receive a packet from an arbitrary node. To mathematically model the random locations of nodes and he interference in the ad hoc network, we use stochastic geometry theory. With the help of stochastic geometry theory, we model the ad hoc network, derive an analytic form of the performance metric, and finally obtain the optimal access probability that maximizes the performance metric. Numerical examples are provided to validate our analysis and to investigate the performance behavior.