  Bike-sharing systems are becoming important for urban transportation. In such
systems, users arrive at a station, take a bike and use it for a while, then
return it to another station of their choice. Each station has a finite
capacity: it cannot host more bikes than its capacity. We propose a stochastic
model of an homogeneous bike-sharing system and study the effect of users
random choices on the number of problematic stations, i.e., stations that, at a
given time, have no bikes available or no available spots for bikes to be
returned to. We quantify the influence of the station capacities, and we
compute the fleet size that is optimal in terms of minimizing the proportion of
problematic stations. Even in a homogeneous city, the system exhibits a poor
performance: the minimal proportion of problematic stations is of the order of
(but not lower than) the inverse of the capacity. We show that simple
incentives, such as suggesting users to return to the least loaded station
among two stations, improve the situation by an exponential factor. We also
compute the rate at which bikes have to be redistributed by trucks to insure a
given quality of service. This rate is of the order of the inverse of the
station capacity. For all cases considered, the fleet size that corresponds to
the best performance is half of the total number of spots plus a few more, the
value of the few more can be computed in closed-form as a function of the
system parameters. It corresponds to the average number of bikes in
circulation.
