Start with just one step. The riser would be 21" and the tread 48" or 4'.
With 2 steps, the riser 4 would be 21/2 and the tread 48/2.
With n steps, the riser would be 21/n and the tread 48/n.
So the calculation depends on the number of steps.
To fit the average foot comfortably on to the tread the tread would be about 12". 48/n=12 so n=4.
If n=4 then the riser is 21/4=5.25". To make the riser shorter requires a corresponding shortening of the tread. For a 6" tread, for example, n=8 and the riser is 2.625".