# dilworthNumber -- computes the Dilworth number of a poset

## Synopsis

• Usage:
d = dilworthNumber P
• Inputs:
• P, an instance of the type Poset,
• Outputs:
• d, an integer, the maximum length of an antichain

## Description

The Dilworth number of a poset is the maximum length of an antichain.

The Dilworth number of a chain is always 1.

 i1 : n = 5; i2 : dilworthNumber chain n o2 = 1

The Dilworth number of the $n$ booleanLattice is $n*(n-1)/2$.

 i3 : dilworthNumber booleanLattice n o3 = 10 i4 : n*(n-1)//2 o4 = 10