Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

powerset

Calculate a Set's Powerset


Description

Calculates and returns the powerset of a Set.

Usage

powerset(x, simplify = FALSE)

Arguments

x

Set

simplify

logical, if TRUE then tries to simplify the result to a Set otherwise creates an object of class PowersetSet.

Details

A powerset of a set, S, is defined as the set of all subsets of S, including S itself and the empty set.

Value

See Also

Examples

# simplify = FALSE is default
powerset(Set$new(1, 2))
powerset(Set$new(1, 2), simplify = TRUE)

# powerset of intervals
powerset(Interval$new())

# powerset of powersets
powerset(powerset(Reals$new()))
powerset(powerset(Reals$new()))$properties$cardinality

set6

R6 Mathematical Sets Interface

v0.2.1
MIT + file LICENSE
Authors
Raphael Sonabend [aut, cre] (<https://orcid.org/0000-0001-9225-4654>), Franz Kiraly [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.