functional

functional

Not enough ratings
Set 1--set
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
919.000 B
1 Aug, 2021 @ 2:33am
1 Aug, 2021 @ 4:44am
4 Change Notes ( view )

Subscribe to download
Set 1--set

Description
Set is an unordered collection of elements.
A set of some type of elements is usually represented by a
boolean.
For example, empty set (the set which has no elements) is
represented by x: FALSE. A set of natural numbers which
only has elements 1 and 2 can be represented by a
function, which returns TRUE upon input 1, returns TRUE
upon input 2, returns FALSE upon input 0, and returns
FALSE upon input natural numbers larger than 2.
Write a function "BELONG" that, given a set and a natural
number, return TRUE if the number is in the set, and FALSE
if the number is not in the set.