When an interval is “flipped”, it forms the “compliment of an interval”; the number of the two intervals always adds up to nine.
For example, when a 5th is flipped, it becomes a 4th. When a 7th is flipped, it becomes a 2nd. And so on…
Note for those who are more advanced: The illustration only shows white keys, but sharps and flats do not change the number of the interval, and we are not yet concerned about the “quality” of the interval, expressed with these words: Perfect, Major, minor, augmented, diminished. It is my habit to capitalize “Perfect” and “Major”. These words may always be written lower-case.