The Magid Mishna asks that the Rambam is seemingly in contradiction with his ruling in Hilchos Shabbos (16:16) regarding a wall that exactly half of the wall is solid and the other half is opened, it is regarded as a wall. This is because the Rambam rules in accordance with Rabbi Papa who maintains that a fifty percent wall is sufficient. This principle is known as 'porutz keomed' - if the porutz, the opening is precisely the same measurement as the omed, the standing (wall), it is considered a wall. Why does the Rambam rule by the s'chach that it is invalid?
The Magid Mishna answers based on a Gemora 22b which rules that if a sukkah consists of precisely fifty percent s'chach which is valid and the other half is left empty, the sukkah is disqualified. The reason given is because there will be more sunlight on the ground than shade. The Gemora explains that sunlight that shines through a hole on top which is the size of a small coin will spread to the size of a larger coin on the ground. Therefore, explains the Magid Mishna, the Rambam is viewing the invalid s'chach as if it would be completely opened and the valid s'chach is not producing even half the shade, therefore the sukkah is disqualified.
The mefarshim ask on the analogy of the Magid Mishna. The Ran explicitly states that the two cases are not comparable. When the entire sukkah is covered with s'chach, there is shade on the ground and consequently the sukkah should be valid for the kosher s'chach is producing fifty percent of the shade?
The Steipler explains the Magid Mishna with a mathematical demonstration. If a sukkah would have two hundred tefachim and there would be only one hundred tefachim of valid s'chach, it would produce ninety-nine tefachim of shade. The same would be obviously true if the sukkah was covered with one hundred tefachim of invalid s'chach. In our situation that the entire sukkah is covered with s'chach, however half of it is s'chach which is invalid, the remaining two tefachim that now has shade must be coming from a combination of the valid s'chach and the invalid s'chach. This would be considered as if there would be a mixture of valid s'chach with invalid s'chach, which the Rambam rules is invalid. Therefore, the Rambam is forced to disqualify this sukkah even though he maintains that a fifty percent covering is sufficient, here there is not enough shade being produced by the fifty percent valid s'chach.
It would seem to me that one can ask on the Steipler's logic. He assumes that one hundred tefachim s'chach produces ninety-nine tefachim of shade even in a case when there is no open areas and therefore he explains the remaining two tefachim (ninety-nine from the valid s'chach and ninety-nine from the invalid s'chach) as being produced from a mixture of the two s'chachs. Can't we say that one hundred tefachim of s'chach produces one hundred tefachim of shade except when there is one hundred tefachim of open area and there the sunlight overrides the shade and therefore in our case there is fifty percent shade coming from the valid s'chach and hence the sukkah should be valid?