A consistent and standard code of behavior within a closed system. Rules are arbitrarily created by the owner(s) of a closed system, and followed by people or objects within that system. In which extent the followers were able to influence the rules is a measure for democracy. Instructions are considered to be rules too.
Rules are useful when forming mathematical theories and in games. A formalised set of decision rules can be represented with algorithms using mathematical formula, statistics and logic. Research into Artificial Intelligence, is a good example that is based strongly on the idea of rules. More generally classification, enforcement, etiquette, democracy, gaming, moderation and protocol are all guided by a set of standard rules to aid decision making. See also science.
Trademark and copyright systems are based on a set or rules. In democratic theory a system of hierarchy with government at the apex is designed to make the rules and provide security. A wiki, including this wiki has a set of lose rules, including this Style Guide and Text Formatting Rules