This is correct math but not practical for actually measuring carpet for a room. So if the objective here is to show how calculate floor suface area of a room then great but if it is to show how to measure a room for carpet purchase then it will cause shortage issues. To measure a room for carpet you use the longest and widest points of the entire room then devide by 9. In this case you will end up with more than 25sqy of carpet. Also in some cases you even have to round measurement up to the dimensions that carpet is manufactured in to avoid multiple seams which affect the quality of the install. So good math but not practical for real world aplication.
My boss calculates carpet this exact way. She accounts for the roll width and calculates to eliminate as much waste as possible. It’s also different if you have a pattern match carpet.