Even though a person has the authority to do with his property as he wishes and to give them to whomever he desires, this is when he gives them with the language of a gift through a kinyan, and when he is a shekhiv mera even without a kinyan. However, with the language of inheritance, such as if he says, "So-and-so shall inherit from me," he has said nothing, for the language of inheritance is not the language of a gift; rather, it is the statute of the Torah for one who is fit to inherit from him. But for one who is not fit to inherit from him, this is nothing more than mere words. In what case does this apply? When he spoke regarding one who is not fit to inherit from him at all, such as if he had sons and said, "My daughter shall inherit from me," or if his heirs were his daughters and he said, "My brother shall inherit from me." But if he increased for one of his heirs—for example, if he had two sons and said, "So-and-so my son shall inherit everything" or "shall inherit three parts"—his words stand, as it is said: "And it shall be on the day he causes his sons to inherit," which implies explicitly that he causes them to inherit through his speech. And if it were not within his power to add to one and diminish from another, he would not be the one causing the inheritance, but rather the Torah would be causing them to inherit; rather, certainly the Torah gave him authority to add and to diminish. And so the Torah said: regarding those to whom this inheritance pertains, the one causing the inheritance has the authority to add to one of the heirs and to diminish from another, or to give everything to one and transfer the other from his inheritance. However, even this is specifically when he says the matter explicitly, such as if he says, "So-and-so shall inherit half my property and the rest of the sons the other half," his words stand. But if he said, "So-and-so my son shall not inherit except such-and-such," or if he said, "Reuven my son shall inherit his portion and the portion of Shimon," or if he said, "Shimon shall not inherit, only Reuven," he has said nothing, as the reason will be explained. And know that according to what I wrote in siman 5, section 10, according to the opinion of the Rambam, he specifically requires a beit din and during the day when he increases for one of the heirs and diminishes for another; see there.
אע"פ שיש רשות לאדם לעשות בנכסיו ברצונו וליתנם למי שירצה זהו כשנותנם בלשון מתנה בקנין וכשהוא שכ"מ אף בלא קנין אבל בלשון ירושה שיאמר פלוני יירשני לא אמר כלום דלשון ירושה אינה לשון מתנה אלא הוא חק התורה למי שראוי ליורשו אבל למי שאינו ראוי ליורשו אין זה רק פטומי מילי בעלמא בד"א כשאמר על מי שאינו ראוי ליורשו כלל כגון שהיה לו בנים ואמר בתי תירשני או שהיו יורשיו בנותיו ואמר אחי יירשני אבל אם ריבה לאחד מיורשיו כגון שהיו לו שני בנים ואמר פלוני בני יירש הכל או יירש ג' חלקים דבריו קיימים שנאמר והיה ביום הנחילו את בניו משמע להדיא שהוא מנחיל אותם בדבורו ואם אין ביכלתו להוסיף לאחד ולגרוע לאחד הלא הוא אינו המנחיל והתורה מנחלת אותם אלא ודאי נתנה לו התורה רשות להוסיף ולגרוע וכך אמרה תורה דמי ששייכים בירושה זו יש רשות ביד המנחיל להוסיף לאחד מן היורשים ולגרוע לאחד או ליתן לאחד הכל ואת השני יעביר מנחלתו אמנם גם זהו דוקא כשיאמר הדבר מפורש כגון שאומר פלוני יירש חצי נכסי ושארי הבנים החצי דבריו קיימים אבל אם אמר פלוני בני לא יירש אלא כך וכך או שאמר ראובן בני יירש חלקו וחלקו של שמעון או שאמר לא יירש שמעון אלא ראובן לא אמר כלום כמו שיתבאר הטעם ודע דלפמ"ש בסי' ה' סעי' י' לדעת הרמב"ם צריך ב"ד וביום דוקא כשמרבה לאחד מן היורשים וממעט לאחד ע"ש: