# Question:Is it possible to instantiate all the attributes of a random variable?

## Question:Is it possible to instantiate all the attributes of a random variable?

Maple 2015

Hi,

When creating a user random variable, I would like to instanciate some of its attributes, for instance ParentName.
But it seems that it's not always possible.

​​​​​​​Is it a Maple's limitation or am I not doing the things correctly ?
​​​​​​​
Example:

 > restart:
 > with(Statistics):
 > U := RandomVariable(Uniform(0, 1)):
 > interface(warnlevel=0):
 > A := attributes(U)[3]
 (1)
 > AllAttributes := with(A);
 (2)
 > A:-ParentName
 (3)
 > # Define a user random variable v := Distribution(PDF = (z -> piecewise(0 <= t and t < 1, 1, 0))): V := RandomVariable(v): A := attributes(V)[3]; AllAttributes := with(A); A:-Conditions;
 (4)
 > # its definition can be augmented by adding some recognized attributes... # even if the result returned by Mean is strange v := Distribution(PDF = (z -> piecewise(0 <= t and t < 1, 1, 0)), 'Mean'=1/Pi, 'Median'=exp(-1)): V := RandomVariable(v): A := attributes(V)[3]; AllAttributes := with(A); [Median, Mean](V)
 (5)
 > # but not all the recognized attributes seem to be able to be instanciated: v := Distribution(PDF = (z -> piecewise(a <= t and t < b, 1/(b-a), 0)), 'Parameters'=[a, b]); v := Distribution(PDF = (z -> piecewise(a <= t and t < b, 1/(b-a), 0)), 'ParentNames'=MyDistribution);
 >