  Sortition, i.e., random appointment for public duty, has been employed by
societies throughout the years, especially for duties related to the judicial
system, as a firewall designated to prevent illegitimate interference between
parties in a legal case and agents of the legal system. In judicial systems of
modern western countries, random procedures are mainly employed to select the
jury, the court and/or the judge in charge of judging a legal case, so that
they have a significant role in the course of a case. Therefore, these random
procedures must comply with some principles, as statistical soundness; complete
auditability; open-source programming; and procedural, cryptographical and
computational security. Nevertheless, some of these principles are neglected by
some random procedures in judicial systems, that are, in some cases, performed
in secrecy and are not auditable by the involved parts. The assignment of cases
in the Brazilian Supreme Court (Supremo Tribunal Federal) is an example of such
procedures, for it is performed by a closed-source algorithm, unknown to the
public and to the parts involved in the judicial cases, that allegedly assign
the cases randomly to the justice chairs based on their caseload.
  In this context, this article presents a review of how sortition has been
employed historically by societies, and discusses how Mathematical Statistics
may be applied to random procedures of the judicial system, as it has been
applied for almost a century on clinical trials, for example. Based on this
discussion, a statistical model for assessing randomness in case assignment is
proposed and applied to the Brazilian Supreme Court in order to shed light on
how this assignment process is performed by the closed-source algorithm.
Guidelines for random procedures are outlined and topics for further researches
presented.
