Levodopa-treated Parkinson's disease is often complicated by the occurrence of motor fluctuations, which can be predictable ('wearing-off') or unpredictable ('on-off'). In contrast, untreated dopa-responsive dystonia (DRD) is usually characterized by predictable diurnal fluctuation. The pathogenesis of motor fluctuations in treated Parkinson's disease and diurnal fluctuation in untreated DRD is poorly understood. We have developed a mathematical model indicating that all these fluctuations in motor function can be explained by presynaptic mechanisms. The model is predicated upon the release of dopamine being subject to probabilistic variations in the quantity of dopamine released by exocytosis of vesicles. Specifically, we propose that the concentration of intravesicular dopamine undergoes dynamic changes according to a log-normal distribution that is associated with different probabilities of release failure. Changes in two parameters, (i) the proportion of vesicles that undergo exocytosis per unit of time and (ii) the proportion of dopamine subject to re-uptake from the synapse, allowed us to model different curves of levodopa response, for the same degree of nigrostriatal damage in Parkinson's disease. The model predicts the following periods of levodopa clinical benefit: 4 h for stable responders, 3 h for wearing-off fluctuators, and 1.5 h for on-off fluctuators. The model also predicts that diurnal fluctuation in untreated DRD should occur some 8 h after getting up in the morning. All these results fit well with clinical observations. Additionally, we calculated the probability of obtaining a second ON period after a single dose of levodopa in Parkinson's disease (the 'yo-yoing' phenomenon). The model shows that the yo-yoing phenomenon depends on how fast the curve crosses the threshold that separates ON and OFF states, which explains why this phenomenon is virtually exclusive to patients with on-off fluctuations. The model supports the idea that presynaptic mechanisms play a key role in both short-duration and long-duration responses encountered in Parkinson's disease. Dyskinesias may also be explained by the same mechanisms.