Distribution with Quantity Parameters
Approximate height distribution with normal distribution with mean of 70 inches and standard deviation of 6.5 inches. The distribution can be constructed using Quantity as a corresponding mean and standard deviation parameters and will yield an appropriate QuantityDistribution.
In[1]:=
![Click for copyable input](assets.en/distribution-with-quantity-parameters/In_11.png)
height\[ScriptCapitalD] =
NormalDistribution[Quantity[70, "Inches"], Quantity[6.5, "Inches"]]
Out[1]=
![](assets.en/distribution-with-quantity-parameters/O_10.png)
The distribution represents a random variable in the specified units.
In[2]:=
![Click for copyable input](assets.en/distribution-with-quantity-parameters/In_12.png)
averageHeight = Mean[height\[ScriptCapitalD]]
Out[2]=
![](assets.en/distribution-with-quantity-parameters/O_11.png)
Compute with the distribution using appropriate quantity arguments.
In[3]:=
![Click for copyable input](assets.en/distribution-with-quantity-parameters/In_13.png)
CDF[height\[ScriptCapitalD], Quantity[170, "Centimeters"]]
Out[3]=
![](assets.en/distribution-with-quantity-parameters/O_12.png)
Compute probability that a person's height is between 65 and 72 inches.
In[4]:=
![Click for copyable input](assets.en/distribution-with-quantity-parameters/In_14.png)
Probability[Quantity[65, "in"] < x < Quantity[72, "in"],
x \[Distributed] height\[ScriptCapitalD]]
Out[4]=
![](assets.en/distribution-with-quantity-parameters/O_13.png)
Assuming this height distribution, find an average time of a hat falling from a person's head on Earth.
In[5]:=
![Click for copyable input](assets.en/distribution-with-quantity-parameters/In_15.png)
NExpectation[Sqrt[(2 h)/Entity["Planet", "Earth"]["Gravity"]],
h \[Distributed] height\[ScriptCapitalD]]
Out[5]=
![](assets.en/distribution-with-quantity-parameters/O_14.png)