The tragedy of the commons is a term used in social science to describe a situation in a shared-resource system…