Dr. O'Neil wants to study how sleep can affect working memory. So she has 3 groups of participants. Group 1 gets 8 hours of sleep. Wouldn't that be nice? Group 2 gets 6 hours of sleep, and Group 3 gets 4 hours of sleep.
She then measures how participants perform on a working memory test. In Dr. O'Neil's experiment, the independent variable and the dependent variable are to be identified based on their roles in the research. The independent variable is the factor that is changed or controlled in a scientific experiment to test the effects on the dependent variable, which is the variable being tested and measured.
So, we are hypothesizing that sleep is going to affect working memory. Thus, the working memory variable is dependent on the sleep variable. This means the dependent variable is working memory, and the independent variable is sleep, or more specifically, the amount of sleep that a participant is getting, which should theoretically be affecting working memory. And there you go.