A beat-to-beat alternation in the action potential duration (APD) of myocytes, i.e. alternans, is believed to be a direct precursor of ventricular fibrillation in the whole heart. A common approach for the prediction of alternans is to construct the restitution curve, which is the nonlinear functional relationship between the APD and the preceding diastolic interval (DI). It was proposed that alternans appears when the magnitude of the slope of the restitution curve exceeds one, known as the restitution hypothesis. In this thesis we aim at understanding the spatio-temporal formation of alternans. Our goal is threefold. First we show, in silico with periodic pacing, that APD and calcium alternans develops locally in a small region before spreading to the rest of the domain and that the slope of the restitution curve for cells in the said small region is different than the restitution curve of cells which exhibit alternans at a later time. These results are in agreement with experimental data. The restitution hypothesis was derived under the assumption of periodic stimulation, when there is a dependence of the DI on the immediate preceding APD (i.e. feedback). However, under physiological conditions, the heart rate exhibits substantial variations in time, known as heart rate variability (HRV). Our second goal is to investigate the role of HRV in the alternans formation in isolated cardiac myocytes using numerical simulations of an ionic model of the cardiac action potential. We use two different pacing protocols: a periodic pacing protocol with feedback and a protocol without feedback and show that when HRV is incorporated in the periodic pacing protocol, it facilitates alternans formation in the isolated cell. Furthermore we show that the magnitude of alternans does not change significantly. In the case of the pacing protocol without feedback, alternans formation is prevented, even in the presence of HRV. Lastly, we derive a probabilistic model that incorporates HRV in a restitution curve. We show that this model conserves probability and that it has eigenvalue \lambda=1 for all parameters and eigenvalue \lambda=-1 under certain conditions. We derive a numerical scheme that conserves probability and present numerical results using a simple restitution curve.