With the advent of event-related paradigms in functional MRI, there has been interest in finding the optimal stimulus timing, especially when the interstimulus interval is varied during the imaging run. Previous works have proposed stimulus timings to optimize either the estimation of the impulse response function (IRF) or the detection of signal changes. The purpose of this paper is to clarify that estimation and detection are fundamentally different goals and to determine the optimal stimulus timing and distribution with respect to both the accuracy of estimating the IRF and the power of detection assuming a particular hemodynamic model. Simulated stimulus distributions are varied systematically, from traditional blocked designs to rapidly varying event related designs. These simulations indicate that estimation of the hemodynamic impulse response function is optimized when stimuli are frequently alternated between task and control states, with shorter interstimulus intervals and stimulus durations, whereas the detection of activated areas is optimized by blocked designs. The stimulus timing for a given experiment should therefore be generated with the required detectability and estimation accuracy.