Let's consider each scenario, starting with Hal first.
For Hal to be in the picture, our restriction lies on the premise that Ida can't be in it.
Let's stand Hal first.
He was five different places to stand.
H _ _ _ _
Now, since Ida cannot be in the picture, we need to remove him from our list. The other people can be arranged accordingly in any order we choose.
Thus, for Hal, we have 5 different ways.
Now, we have 7 people to choose 4. Since there were originally 9 people, we need to remove Ida from the list, and since Hal has already sat, then there lies only 7 people to pick 4 different people to stand.
So, we can say that there are 5 · P(7, 4) to arrange five people with restriction.
This premise is exactly the same with Ida. Because each element is distinct, there is exactly the same amount of arrangements to arrange Ida without Hal in the picture.
We can then conclude that there are 2 · 5 · P(7, 4) = 8, 400 different ways.