Determining whether a set of ordered pairs represents a function