So we've just been discussing the schemes for how we would assign the presentation order of techniques in our study to avoid carryover effects that introduce confounds to our results. The study we're considering again is a within-subjects design where subjects use three different techniques to find contacts in a smart phone contacts manager, and we measure the time it takes, the errors they make, and the effort rating that they give each of those techniques. So let's talk about how we assigned order of presentation more generally, and how that helps us avoid confounds due to carryover effects. There are three strategies that we'll consider. I'll write them down here. We're going to look at full counterbalancing. We're going to look at Latin squares. And we're going to look at something called the balanced Latin square. Let's start with full counterbalancing. Full counterbalancing is where every possible ordering of conditions is expressed in your study. And it is, when you can do it, the best way to counterbalance the presentation order of your factors. So with full counterbalancing we have every order expressed. Let's say we have two levels of a within-subjects factor, so two conditions. Let's call them A and B. Full counterbalancing would present A and then B, and then B and then A to subjects. Because we have two sequences, we could say half the subjects, or every other subject coming in, first would see A, then would see B. The other half would see B and then A. So with two levels we need two factorial sequences, or just two sequences. You can see with this factorial operator things are going to grow quickly. With three conditions, we'd need A, B, and C. We'd need A, C, and B. B A C. B C A. C A B. And C, B, A. Whoa, that went big fast. We now have six. With three, we have six sequences that need to be expressed. We'd need a study that had subjects that are multiples of 6 in number, so 6 subjects or 12 or 18 or 24 subjects, to make sure we have a balanced expression across all six sequences. With 4 conditions I won't even draw them, but we'd need 24 sequences. With 5 we'd need 120. And with 6 it gets obviously very unwieldy. That's full counterbalancing, expressing every order of conditions that can happen. And we'd need a lot of subjects to make sure we cover all of those orders. So if you can do full counterbalancing, that's the best thing to do. Let's consider something called Latin squares. Latin squares just needs n sequences for n conditions, and therefore multiples of n subjects. So that sounds nice. And it has the property where each condition occupies each position in the order exactly the same number of times. We'll go with five conditions and we'll call them A, B, C, D, and E. And what you do is you start off with your top sequence, and then you kind of rotate them around. So B C D E and A. C D E A B. D E A B C. And E A B C D. You can see with this Latin square of five conditions, every condition occupies each position in the sequence the same number of times. For example, they're all first once, they're all second once, they're all third once, and so on. There's still a challenge here, though, which is that not all conditions follow the other conditions in exactly the same number of times. For example, C follows A here and not here, not here, but here and here. That wouldn't be the case for E following A, for example, where things are different. So we still could have carryover effects, and we'll look into solving that with the balanced Latin square. So we're discussing counterbalancing strategies for within-subjects variables. And we've talked about full counterbalancing, a Latin square. Now I want to discuss a balanced Latin square. The way it works is this. Let's first assume we have an even number of conditions. Let's say we'll do an example with six that I've drawn up here. But let me point out how this is structured. The way it works is the top row starts with a formula. And instead of using letters like we did before, to make it easier to see how this works we're using numbers, but they're really the same thing. So you have condition 1, then 2, then n. So if you have a 6 level factor, it'd be 6. Then 3, then n-1, 4, n- 2, and so on. And so you kind of see 1, 2, and then you're counting up, 3, 4, eventually 5 and so on, and then you're counting down. n, n-1, n-2, in every other. So for a 6 level factor, the balanced Latin square looks like this in the first row, 1, 2, 6, 3, 5, and 4. Then after that, each row is added one to the number above it. So 1 becomes 2, 2 becomes 3, 6 wraps around to 1, 3 becomes 4, 5 to 6, and 4 to 5, and so on throughout the rest of the table. The property that a balanced Latin square has is that every condition follows every other exactly the same number of times, which is a very nice property for counterbalancing. Now this is if you have an even number of conditions. If you have an odd number, it's not too much more complicated. You simply build the same initial table and then you double the size of that table by reversing all of the rows that you just established, and that gets you your property. So if we had 5 conditions, we'd have 1, 2, 5, 3, and 4. And then we would reverse that in the beginning of the second half of the table. Now this is an even number of conditions table, so we wouldn't do it here, but let me show you what that reversal looks like. It just looks like adding rows like this. So 4, 5, 3, 6, 2, and 1, and so on reversing each row. 5 6 4 1 3 2 and so on. Again, we wouldn't do that for an even number of conditions because we've already satisfied that property where each condition follows every other exactly the same number of times. But for an odd number of conditions, we'd need to do that sort of mirror image to double the size of our table. And notice with six conditions we'd need six multiples of six subjects. With five conditions, we'd need multiples of not five but ten because we'd double our table with this sort of second half reversed. And that's how we create a balanced Latin square.