MINYAN HA'RA'UY EXEMPTS [Ma'aser Behemah :Minyan ha'Ra'uy]
Gemara
59b (Rava): Minyan ha'Ra'uy exempts.
I learn from "Ya'avor", which excludes an animal that already left before. If it was part of 10 that left and Ma'aser was taken, we do not need a verse for this!
Rather, it was exempted through Minyan ha'Ra'uy.
Support (Beraisa): If Reuven had 10 lambs and brought them into a pen, and counted five and one died:
If one of the counted ones died, he completes the count for Ma'aser;
If one of the remaining ones died, the counted ones are exempt. The rest join for Ma'aser in the next Goren.
(Rava): If Reuven had 14 lambs, and brought them into a pen with two openings:
If six left from opening 1 and then four left from opening 2, and four remained --
If the last four leave from opening 1, the last is Ma'aser. The four that left from opening 2 will join (for Ma'aser) in the next Goren.
If not, the six are exempt, and the other eight join in the next Goren.
If four left from opening 1 and then six left from opening 2, and four remained --
If the last four leave from opening 2, the last is Ma'aser. The four that left from 1 are (also) exempt;
If not, the first 10 that left are exempt, and the last four join in the next Goren.
If four left from opening 1 and then four left from opening 2, and six remained --
If the last six all leave from opening 1, or all from 2, the last is Ma'aser, and the four that left from the other opening are exempt;
If not, the first eight are exempt, and the six join in the next Goren.
Question: Rava already taught that Minyan ha'Ra'uy exempts!
Answer: Here he teaches that even a Safek Minyan ha'Ra'uy exempts.
(Rava): If Reuven has 15 lambs, he may not say "I will bring 10 into the pen and take (one to be) Ma'aser, and the others will be exempt." Rather, he brings all into the pen, takes Ma'aser, and the remaining five join in the next Goren.
Support (Beraisa #1): If Reuven has 15 lambs, he brings all into the pen and takes Ma'aser. The remaining five join in the next Goren;
Contradiction (Beraisa #2): If Reuven has 19 lambs, he brings all into the pen and takes Ma'aser. The remaining nine are exempt.
Resolution (Rav Huna bar Sechorah): In Beraisa #2, there were two openings in the pen. Nine left from each;
All are exempt, because the last could have left from either opening.
Bava Metzi'a 6b (Abaye): A Safek is not tithed:
(Mishnah): If an animal already counted (during tithing) jumped back into the pen and was mixed with the uncounted animals, they are all exempt.
If Sefeikos could be tithed, we could tithe without any problem --
If 10 animals leave the pen and none of them were counted before, the 10th is truly Ma'aser;
If one of them was already counted, the 10th is not really Ma'aser (we do not offer it; we eat it after it gets a Mum), but all are exempted due to Minyan ha'Ra'uy.
Rishonim
Rambam (Hilchos Bechoros 8:10): If one of the animals in the pen died, those that were counted are exempt, because Minyan ha'Ra'uy exempts, even though he did not separate on them. He leaves those in the pen for another Goren, when others will join with them. If one had 14 lambs, and brought them into a pen, and four left from an opening (1) and he counted them, and six left from another opening (2), and four remained, if the last four leave from opening 2, he takes one for Ma'aser and the others are exempt. The four that left from opening 1 are exempt due to Minyan ha'Ra'uy. If the last four left from opening 1, the six that left from opening 2 are exempt, for each was counted in a way proper for Ma'aser, since there remained in the pen others to complete the count and tithe. However, the four that remained, even though they left from opening 1, are not a Minyan ha'Ra'uy. Therefore they join for another Goren.
Lechem Mishneh: The Gemara also teaches that if six left from opening 1 and then four left from opening 2, and four remained, the six are exempt, and the other eight join in the next Goren. If the four that left also left from opening 1, he takes one for Ma'aser, and the four that remain join in the next Goren. This is obvious. It is due to the same law that the Rambam taught.
Rambam: If four left from opening 1 and then four left from opening 2, and six remained, if the last six all leave from opening 1 or all from 2, the last is Ma'aser, and all of them are exempt. If the six left from the two openings (some from each), the six join for the next Goren, and the first eight are exempt, for each four were part of a Minyan ha'Ra'uy to complete the count of 10 and tithe them, since six remained in the pen.
Lechem Mishneh: The Gemara just said 'if not' (they did not all leave from opening 1, and not all for opening 2). Rashi explains that they left through an opening by themselves. I.e. they left through a third opening. The Rambam explains that some left through opening 1, and some through opening 2. They do not have a Minyan ha'Ra'uy. The Rambam's Perush is better.
Note: According to the Rambam, I do not understand why all six join for the next Goren. The first of the six that left should be exempt due to Minyan ha'Ra'uy, for the other five could have left through the same opening!
Kiryat Sefer: In any case that the 10th died in the pen, since it was proper to leave, it is as if it left and exempted the nine before it.
Or Some'ach (on Halachah 5:3): If one counted animals from one to 10, the 10th is Kodesh even if it did not leave, for it is destined to leave 10th under the staff. Similarly, Minyan ha'Ra'uy exempts because it was destined that all 10 leave, therefore they are exempt. The Kedushah and the exemption are because later it will leave 10th.
Question (Tosfos Bava Metzi'a 6b DH Lefatro): Our Gemara is astounding. Minyan ha'Ra'uy applies only when there are only 10 and he began counting, and one of them died, and 10 do not remain. Even so, those that remain are exempt, and they do not join to another Goren, since when they began leaving it was possible to complete the Minyan. Here, there are many in the herd. They can complete the Minyan, and there will be a 10th and 11th. He calls both of them Asiri due to the Safek whether a previously counted animal is among them. He does so for every Asiri (calls also the next one Asiri). What remains at the end joins for the next Goren.
Answer (Rabbeinu Meir, in Tosfos ha'Rosh 6b DH v'Iy): The Torah said "Kol Asher Ya'avor", and not what already passed. If one passed twice, everything after that animal is not part of a count. If one would know for sure that the animal that jumped back came out seventh or eighth, he would not complete the count until 10. That animal interrupted the count. He must start again 1,2,3... Therefore, if an exempt animal left seventh or eighth, those before and after it are exempt due to Minyan ha'Ra'uy. Those that left before were part of a count that could have been completed to 10. Those that left after could have been counted among 10, had we started again (1,2,3...) after the one that jumped back in.
Ritva (6b DH Hadar): Ha'Rav ha'Chasid says that when the Safek is among the 10, it nullifies the count. We say that the 10th is Kodesh by itself only when it was amidst a count after nine joined. If the Safek is amidst the nine, it is as if they were not counted and never entered the pen to be tithed, to say that the 10 is Kodesh.
Toras Chayim (DH Lefatro): We cannot count them with intent to make the 10th and 11th Kodesh. The Torah said that the 10th is Kodesh, and not was leaves 11th!
Poskim
Question: If there are nine men in each of two adjacent rooms, and one man is between the rooms, can he be considered a 10th man to complete both Minyanim?
Answer (the questioner in Minchas Yitzchak 9:161:8): If four animals left from opening 1 and four left from opening 2, and six remained, one might have thought that the six do not exempt both sets, for we cannot attribute them to both openings. Rava taught that we do! (Here also, the 10th can complete both Minyanim.)
Rejection (Minchas Yitzchak): This is a wondrous Beki'us (breadth of knowledge), to settle the question from there! However, we can say that there is different, for a verse taught that Minyan ha'Ra'uy exempts, and even Safek Minyan ha'Ra'uy. There is no verse to teach this about Tefilah.