# randomPoset -- generates a random poset with a given relation probability

## Synopsis

• Usage:
P = randomPoset n
P = randomPoset G
P = randomPoset(n, Bias => RR)
P = randomPoset(G, Bias => RR)
• Inputs:
• n, an integer, the number of vertices in the poset
• G, a list, the ground set of the poset
• Optional inputs:
• Bias => , default value .5, the probability that a given relation will be present
• Outputs:
• P, an instance of the type Poset,

## Description

This method generates a random poset with a given ground set ($\{1, \ldots, n\}$, if $n$ is specified).

 i1 : randomPoset 10 o1 = Relation Matrix: | 1 0 0 1 0 1 1 1 1 1 | | 0 1 0 0 1 1 1 1 1 1 | | 0 0 1 1 0 1 1 1 1 1 | | 0 0 0 1 0 0 0 1 0 0 | | 0 0 0 0 1 1 1 0 1 1 | | 0 0 0 0 0 1 1 0 1 0 | | 0 0 0 0 0 0 1 0 1 0 | | 0 0 0 0 0 0 0 1 0 0 | | 0 0 0 0 0 0 0 0 1 0 | | 0 0 0 0 0 0 0 0 0 1 | o1 : Poset

The option Bias determines the probability that a given relation will be present. A higher Bias will lead to more relations.

 i2 : randomPoset(10, Bias => 0.1) o2 = Relation Matrix: | 1 0 0 0 1 0 1 1 0 0 | | 0 1 0 0 0 0 0 0 0 0 | | 0 0 1 0 0 0 0 0 0 0 | | 0 0 0 1 1 0 0 0 0 0 | | 0 0 0 0 1 0 0 0 0 0 | | 0 0 0 0 0 1 0 0 0 1 | | 0 0 0 0 0 0 1 1 0 0 | | 0 0 0 0 0 0 0 1 0 0 | | 0 0 0 0 0 0 0 0 1 0 | | 0 0 0 0 0 0 0 0 0 1 | o2 : Poset i3 : randomPoset(10, Bias => 0.9) o3 = Relation Matrix: | 1 1 1 1 1 1 1 1 1 1 | | 0 1 1 1 1 1 1 1 1 1 | | 0 0 1 1 1 1 1 1 1 1 | | 0 0 0 1 1 1 1 1 1 1 | | 0 0 0 0 1 1 1 1 1 1 | | 0 0 0 0 0 1 1 1 1 1 | | 0 0 0 0 0 0 1 1 1 1 | | 0 0 0 0 0 0 0 1 1 1 | | 0 0 0 0 0 0 0 0 1 1 | | 0 0 0 0 0 0 0 0 0 1 | o3 : Poset