# Define a function then define it's 'type'

I've been asked to define a function getEmployees that maps each role into the set of names who have that role within a business. I need to define both the type and mapping of this function.

So say I have a few sets - {Checkout}, {Manager}, {Shelf Stacker}, and say I have one name in each, maybe {John Doe} intersects both {Checkout} and {Shelf Stacker}.

I'm just a bit confused with what is meant by type, I thought they may mean to write the function, map it, and state whether it's surjective, injective etc?

I've just been told "no that's not the case..but I'm not saying any more!"

Could someone please help me try to figure this out? Or point me in the right direction? I'm lost!

• Are you sure that your question is about Matehmatics? Nov 29, 2018 at 19:56
• @TitoEliatron Discrete Maths within Comp Sci - sorry for the grey area Nov 29, 2018 at 20:00

Let $$E$$ denote the set of employees and $$R$$ the set of roles, and $$X$$ the set of ordered pairs $$(e,\,r)$$ with $$e\in E,\,r\in R$$ such that $$e$$ has role $$r$$. The getEmployees method is $$r\mapsto\{e\in E|(e,\,r)\in X\}$$. Similarly, a getRoles method would be $$e\mapsto\{r\in R|(e,\,r)\in X\}$$.
• @CerKL Presumably the types of an employee are that employee's roles. The term "type" in this context might have meant the type of a variable in programming, e.g. List<Role> or any number of similar things in C#.