Case (i): only 1 black hat
The one with black hat should notice by himself (because it is given at least 1 black hat, and he find nobody wearing black hats). Then, he must show up during the 1st light off, which is a contradiction to the problem. Hence, there should be at least 2 black hats.
Case (ii): only 2 black hats
Each of the one who wears black hat will notice the other one wearing a black hat, and they will think that the other one is the only one who wear black hat. Hence, during the 1st light off, nobody will show up. Then, both of them will realize that themselves also wear black hat (because if there is only 1 black hat, it become case (i) and the other one must show up during 1st light off). Thus, they will show up during the 2nd light off, which is also a contradiction to the problem. Hence, there should be at least 3 black hats.
Case (iii): only 3 black hats
Each of the one who wears black hat will notice 2 people wearing a black hat. So, the immediate thought to them is that there are only 2 people wearing black hats. Hence, both of them will not show up for the 1st and 2nd light off. Then, both of them will realize that themselve also wear a black hat (because if there are only 2 black hats, it become case (ii) and they must already show up in 2nd light off). Thus, they will show up during the 3rd light off, which is the situation of this problem.
Similarly, we can deduce that when there are n people wearing black hats, it need n round of light off for them to realize and show off.
Case (i): only 1 black hat
The one with black hat should notice by himself (because it is given at least 1 black hat, and he find nobody wearing black hats). Then, he must show up during the 1st light off, which is a contradiction to the problem. Hence, there should be at least 2 black hats.
Case (ii): only 2 black hats
Each of the one who wears black hat will notice the other one wearing a black hat, and they will think that the other one is the only one who wear black hat. Hence, during the 1st light off, nobody will show up. Then, both of them will realize that themselves also wear black hat (because if there is only 1 black hat, it become case (i) and the other one must show up during 1st light off). Thus, they will show up during the 2nd light off, which is also a contradiction to the problem. Hence, there should be at least 3 black hats.
Case (iii): only 3 black hats
Each of the one who wears black hat will notice 2 people wearing a black hat. So, the immediate thought to them is that there are only 2 people wearing black hats. Hence, both of them will not show up for the 1st and 2nd light off. Then, both of them will realize that themselve also wear a black hat (because if there are only 2 black hats, it become case (ii) and they must already show up in 2nd light off). Thus, they will show up during the 3rd light off, which is the situation of this problem.
Similarly, we can deduce that when there are n people wearing black hats, it need n round of light off for them to realize and show off.