In electrical and mechanical trades and manufacturing, each half of a pair of mating connectors or fasteners is conventionally assigned the designation male or female. The "female" connector is generally a receptacle that receives and holds the "male" connector.
The assignment is by direct analogy with genitalia and sexual intercourse; the part bearing one or more protrusions, or which fits inside the other, being designated male in contrast to the part containing the corresponding indentations, or fitting outside the other, being designated female. Extension of the analogy results in the verb to mate being used to describe the process of connecting two corresponding parts together.
In some cases (notably electrical power connectors), the gender of connectors is selected according to rigid rules, to enforce a sense of one-way directionality (e.g. a flow of power from one device to another). This gender distinction is implemented to enhance safety or ensure proper functionality by preventing unsafe or non-functional configurations from being set up.
In terms of mathematical graph theory, an electrical power distribution network made up of plugs and sockets is a directed tree, with the directionality arrows corresponding to the female-to-male transfer of electrical power through each mated connection. This is an example where male and female connectors have been deliberately designed and assigned to physically enforce a safe network topology.
In other contexts, such as plumbing, one-way flow is not enforced through connector gender assignment. Flows through piping networks can be bidirectional, as in underground water distribution networks which have designed-in redundancy. In plumbing situations where one-way flow is desired, it is implemented through other means (e.g. gravity flow, one-way check valves), and not through male-female gender schemes.