Determining the domain and range for a given relation