In: Computer Science
A company creates a database for its customers in which each customer is identified by their phone number. In this discussion, explore whether or not this is a function with your classmates. In your first post, address the following:
Function:-
A function is a relation between sets that associates to every element of a first set exactly one element of the second set.
Set means a collection of well-defined objects.
In our case, the first set is the collection of all phone numbers of customers(domain) and the second set is the collection of records of the customers(range).
In the database, to uniquely identify each record(details of a customer) there must be a unique key. In our case, the unique key is phone number.
To be called a function the criteria is that each element of the first set(in our case, the phone number of customers) is associated with exactly one element of the second set(in our case, the details of the customer).
It is not possible that two customers have the same phone number. That means the criteria for being a function is satisfied.
In the above example, variable p is assigned as the input and variable c is assigned as the output. So when we give a phone number p to a function f, it will give output c(customer).
Pitfalls in this setup:-
It is possible that a person can change his/her phone number, in that case, the database should be updated.
It is also possible that a person can have more than one phone number. So there can be multiple records in the database for the same person.
An alternative identification system for the company’s database:-
The company can use the email id of the person to uniquely identify the customers. No two person can have the same email id.
The company can also use the registration number when the customer comes for the first time.