Pattern practice problem question nr 7 and 8

I am not able to think the logic what is the logic for this question