Probability & Statistics UDFs (methods_udfs / m)
High-performance statistical functions for continuous PDFs, confidence intervals, sample sizes, and normal quantiles.
methods_udfs\binom_min_n(k, p, target)
k: Success threshold integer in \(\Pr(X \ge k)\)p: Success probability per trial \(p \in (0, 1)\)target: Target cumulative probability threshold (e.g. \(0.95\) or \(95\))
Exam question example:
A botanist inspects sampled fruit trees. The probability that an inspected tree has fruit fly is $p = 0.08$.
Find the minimum number of trees that must be inspected so that the probability of finding at least one tree with fruit fly is greater than 0.95.
CAS Output:
methods_udfs\conf_interval(p1, p2, c, mode)
p1: Sample proportion \(\hat{p}\) or lower boundary of confidence intervalp2: Sample size \(n\) or upper boundary of confidence intervalc: Confidence level (e.g. \(0.95\) or \(95\))mode: Optional mode:"ci"to calculate CI,"n"to calculate required sample size
Exam question example:
An approximate 95% confidence interval for the proportion of students who commute by bicycle is calculated as $[0.248, 0.552]$.
Find the sample proportion $\hat{p}$ and the sample size $n$ used to compute this interval.
CAS Output:
methods_udfs\cont_pdf_stats(f, x, a, b)
f: Probability density function expression \(f(x)\)x: Continuous random variablea: Support domain lower boundb: Support domain upper bound
Exam question example:
The continuous random variable $X$ has probability density function:
\[ f(x) = \begin{cases} \frac{x^2(30-x)}{67500}, & 0 \le x \le 30 \\ 0, & \text{otherwise} \end{cases} \]Find the mean $E(X)$, standard deviation $\text{sd}(X)$, and median $m$ of $X$.
CAS Output:
methods_udfs\normal_2quant(x1, p1, x2, p2)
x1: First quantile score value \(x_1\)p1: Cumulative probability \(\Pr(X \le x_1)\) (as probability or percentage)x2: Second quantile score value \(x_2\)p2: Cumulative probability \(\Pr(X \le x_2)\)
Exam question example:
The mass $X$ of avocados packed into boxes is normally distributed with mean $\mu$ and standard deviation $\sigma$.
Given that $\Pr(X < 180) = 0.086$ and $\Pr(X < 200) = 0.325$, find the values of $\mu$ and $\sigma$, correct to one decimal place.
CAS Output: