The Torah in Parashat Bo (12:40) states that Beneh Yisrael spent a total of 430 years in Egypt. Already Rashi notes the seeming contradiction between this verse and G-d's prophecy to Abraham Abinu that his descendants would endure a 400-year period of exile and oppression (Bereshit 15:13). Why did G-d predict a period of 400 years, if Beneh Yisrael were going to spend 430 years in exile? Rashi explains that the number depends on the starting point. The period from the birth of Yishak until the Exodus was 400 years, but Abraham received this prophecy thirty years prior to Yishak's birth, for a total of 430 years. The Shela Ha'kadosh (Rav Yeshaya Horowitz, d. 1630) offered a different answer, boldly asserting that G-d added thirty years to the period of exile. G-d informed Abraham that his descendants would live as foreigners for 400 years – but as a result of Mechirat Yosef, the sale of Yosef as a slave by his brothers, thirty years were added. The Shela explains that Yosef was brought out of the dungeon in Egypt and appointed the country's vizier at the age of thirty (Bereshit 41:46). In a sense, then, his first thirty years were stolen from him because of his brothers' cruelty. Therefore, it was decreed that Beneh Yisrael would endure an additional thirty years of oppression. The Shela's theory sheds light on the Gemara's comments in Masechet Sanhedrin (92) regarding the mistake made by the tribe of Efrayim. The Gemara says about the people of Efrayim, "Manu Le'ketz Ve'ta'u" – they miscalculated the end of the Egyptian exile. When they erroneously thought that the time for redemption had arrived, they left Egypt. But when they reached the Philistine region of Gat, they were attacked by the Philistines, and many were killed, while some managed to escape back to Egypt. The Gemara says that the remains of those people from Efrayim were the "dry bones" that were miraculously brought back to life in Yehezkel's famous prophecy. On the basis of the Shela's analysis, we can understand more clearly why the tribe of Efrayim made this mistake. If, indeed, an extra thirty years were added on account of the sin of Mechirat Yosef, then it stands to reason that the tribe of Efrayim – who descended from Yosef – assumed that they did not need to wait the additional thirty years. Since this period was a punishment for the crime committed against Yosef, they figured, it did not affect them, the descendants of Yosef. They therefore left Egypt thirty years early, at the end of the period of exile that was initially decreed. The question then becomes, why were the people of Efrayim wrong? Why were they killed for leaving Egypt early? The answer emerges from a passage in the Zohar regarding another consequence of Mechirat Yosef. Each year, on Tisha B'Ab, we recite a special Kinna (dirge) about the "Asara Harugeh Malchut" – the ten great Rabbis who were brutally murdered by the Romans. The Zohar teaches that these great Rabbis were Gilgulim (reincarnations) of the brothers, and they were killed to atone for the sin of Mechirat Yosef. Now in truth, only nine of the twelve brothers participated in Mechirat Yosef: Yosef, of course, was the victim; Binyamin, the youngest, was home and not involved; and Reuben was not present when the other brothers decided to sell Yosef, and in fact tried to rescue him. Why, then, were ten Rabbis killed to atone for the sin committed by only nine brothers? The answer is that Yosef himself bore a degree of guilt. While his brothers of course acted wrongly by selling him as a slave, he was partially responsible for their hostility. He reported to Yaakob about their alleged wrongdoing, and provoked them, arousing their hatred. Therefore, he, too, was accountable. This, then, was the tribe of Efrayim's mistake. The additional thirty years were decreed also for them, the descendants of Yosef, because he was partially responsible for what happened. Their decision to leave Egypt was thus a mistake, as they, too, were required to spend an additional thirty years in Egypt.