system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How can we estimate the age of a star based on its size?

I have a homework problem that boils down to this: globular clusters have stars of a certain size in them, and when you plug that size into a formula, it says they are about 30 billion years old. (The universe is only 14 bil) I just don't understand the entire concept of getting a star's age from its size... why couldn't the stars be made yesterday just because they are a certain size?

I get that a big star dies younger and therefore couldn't be more than x years old etc, but how on earth could we know when a star was "born" just based on how big it is, outside of setting a limit on how long the star could have lasted?
gpt
Well you can't estimate the age of a star by its mass alone and if you are getting a value greater than the age of the universe you obviously went wrong somewhere.

You can use the size in combination with its luminosity to estimate its age, because stars get brighter as they age. Obviously bigger stars give of more light than smaller ones so we have to account for that too. We can say things like: a star of this size should be this bright when it is young and that bright when it is much older.

This does not work for all star though. There are different types of stars that age in different ways.