Question 1062099

We first need to find the work-per-person (sometimes this type of thing is called "normalization"), once we know that, its easy to mix and match number of people and number of walls.
—
The 9 people paint 8/16 = 1/2 wall every minute
Each person does 1/9 of that:  Work_per_person = (1/2)*(1/9) = 1/18 wall/minute
—

4 people paint 6 walls:    (6 walls/4 persons) / (1/18 ) wall/minute/person
                                    =  6*18/4 minutes
                                    = 27 minutes.

—
Another, more direct, way to do this:
                    16 minutes * 9 people/4 people * 6 walls/8 walls = 27 minutes

I just set each fraction according to the qualitative nature of the 2nd configuration, with respect to "will it take longer or shorter?"   That  decides how to set the numerator and denominator.   
I specified the units because they help prevent forgetting something. 
--