コード例 #1
0
 /**
  * Axiom: |S| = n, then |P(S)| = 2ⁿ
  * The cardinality (count) of a power set of S is 2ⁿ if the cardinality of S is n.
  * @dataProvider dataProviderForSingleSet
  */
 public function testCardinalityOfPowerSet(Set $A)
 {
     $P⟮S⟯ = $A->powerSet();
     $n = count($A);
     $this->assertEquals(pow(2, $n), count($P⟮S⟯));
     $this->assertEquals(pow(2, $n), count($P⟮S⟯->asArray()));
 }