Assignment #51. Write ISETL funcs to return the size of the sample space of the experiments RandTup, RandSet, and RandPerm. The full code is in the file of the same name. Your funcs should be named:NumTups := func(sizeTup,sizeSpace);$ requires: both parameters are positive integers$ effects : returns the number, of tuples of length sizeTup from a set$ of sizeSpace elements.NumSets := func(sizeSet,sizeSpace);$ requires: both parameters are positive integers$ effects : returns the number, of subsets of sizeSet elements from a set$ of sizeSpace elements.NumPerms := func(sizePerm,sizeSpace);$ requires: both parameters are positive integers$ effects : returns the number, of perms of length sizeSet from a set$ of sizeSpace elements.2. A bag is an unordered collection with repetition allowed. Choose a suitable representation (there is more than one) for bags and write the funcs below.Is_Bag := func(b);$ requires: nothing$ effects : returns true if b is a bag and false otherwiseBagSize := func(b);$ not needed if #b is correct for your representation.$ requires: b is a bag$ effects : returns the number of elements in the bag b$ an element is counted each time it appearsRandBag := func(size,space);$ requires: size is a positive integer, space is a set$ effects : returns a random (more or less) bag of size elements from spaceNumBags := func(sizeBag,sizeBag);$ requires: both parameters are positive integers$ effects : returns the number of bags of sizeBag elements from a set$ of sizeSpace elements.3. Find the exact probabilities that the funcs below return 0,1, and 2. Find the mean and variance of each distribution.RoundDouble := func(); return round( 2* random(1.0));end;RoundTwo := func(); return round( random (2.0) );end;RoundSum := func(); return round(random(1.0) + random(1.0));end;DoubleRound := func(); return 2*round(random (1.0));end;RoundTwice := func(); return round(random(1.0)) + round(random(1.0));end;