Analytical PFD and PFD Avg Equations

Analytical PFD and PFD Avg Equations

Theoretical post about PFD equations derivation

It’s long past time we derived the analytical equations for the common voting configurations. This post won’t have a ton of exposition, we are just going to get down to the work of deriving the various equations, and then finding their averages. Cataloging these will come in useful down the road, so let’s hit it.

Tables of Results

If you just care about the results and none of the math:

Same Lambda

PFD equations assuming all devices in the voting scheme have the same lambda:

VotingPFDPFD Avg
1oo11eλt1 - e^{-\lambda t}1+eλT1λT1 + \frac{e^{-\lambda T}-1}{\lambda T}
1oo212eλt+e2λt1 - 2e^{-\lambda t} + e^{-2\lambda t}1+2eλT2λT+1e2λT2λT1 + \frac{2e^{-\lambda T}-2}{\lambda T} + \frac{1-e^{-2\lambda T}}{2\lambda T}
2oo21e2λt1 - e^{-2\lambda t}1+e2λT12λT1 + \frac{e^{-2\lambda T}-1}{2\lambda T}
1oo313eλt+3e2λte3λt1 - 3 e^{- \lambda t} + 3 e^{- 2 \lambda t} - e^{- 3 \lambda t}1116λT+3eλTλT3e2λT2λT+e3λT3λT1 - \frac{11}{6 \lambda T} + \frac{3 e^{- \lambda T}}{\lambda T} - \frac{3 e^{- 2 \lambda T}}{2 \lambda T} + \frac{e^{- 3 \lambda T}}{3 \lambda T}
2oo313e2λt+2e3λt1 - 3 e^{- 2 \lambda t} + 2 e^{- 3 \lambda t}156λT+3e2λT2λT2e3λT3λT1 - \frac{5}{6 \lambda T} + \frac{3 e^{- 2 \lambda T}}{2 \lambda T} - \frac{2 e^{- 3 \lambda T}}{3 \lambda T}
3oo31e3λt1 - e^{- 3 \lambda t}113λT+e3λT3λT1 - \frac{1}{3 \lambda T} + \frac{e^{- 3 \lambda T}}{3 \lambda T}

Unique Lambdas

These don’t render in a table nicely because they tend to be longer, please just jump to the relevant section to see the results for unique lambdas.

Derivations

1oo1 Analytical PFD

This one we already know and love. We derived it from scratch in a previous post, if you’re interested. We will just take it as a given here: PFD=1eλt\begin{equation} PFD = 1 - e^{-\lambda t} \end{equation}

1oo1 Analytical PFD average

Finding the average of a function involves integrating the function, then dividing by the time interval. Check out Wikipedia for an overview. Thankfully for us, functions involving exponentials tend to be easy to integrate. It often helps to think about them backwards, i.e. what function do I need to write down, so that when I take it’s derivative, I get the original exponential function. Typically this just amounts to dividing the original exponential by the derivative of whatever is in the exponent, like so: PFDavg=1T0T1eλtdt=1T[t+eλtλ]0T=1T[T+eλTλ1λ]=1+eλT1λT\begin{align} PFD_{avg} &= \frac{1}{T} \int_{0}^{T} 1 - e^{-\lambda t} \,dt \\ \\ &= \frac{1}{T} * \left[t + \frac{e^{-\lambda t}}{\lambda} \right] _0^T \\ \\ &= \frac{1}{T} * \left[T + \frac{e^{-\lambda T}}{\lambda} - \frac{1}{\lambda} \right] \\ \\ &= 1 + \frac{e^{-\lambda T}-1}{\lambda T} \end{align}

Where “T” is the time interval over which we want to calculate the average PFD.

1oo2 Analytical PFD

Referencing the table in our multiple elements post, we see that the logic for 1oo2 voting is: PAPB\begin{equation} P_AP_B \end{equation}

Substituting in the basic equation for the PFD of a 1oo1 system for each probability: PAPB=(1eλAt)(1eλBt)\begin{equation} P_AP_B = (1-e^{-\lambda_A t})(1-e^{-\lambda_B t}) \end{equation}

Where λA and λB are the failure rates of the two devices. These are often taken to be the same, but lets keep them separate for now so as to be a bit more general.

Multiplying through: PAPB=(1eλAt)(1eλBt)=1eλAteλBt+e(λA+λB)t\begin{align} P_AP_B &= (1-e^{-\lambda_A t})(1-e^{-\lambda_B t}) \\ \\ &= 1 -e^{-\lambda_A t} - e^{-\lambda_B t} + e^{-(\lambda_A+\lambda_B) t} \end{align}

Combining terms if lambda is assumed to be the same for each device: PFD=12eλt+e2λt\begin{equation} PFD = 1 - 2e^{-\lambda t} + e^{-2\lambda t} \end{equation}

1oo2 Analytical PFD average

Finding the average, assuming different lambdas for each device: PFDavg=1T0T1eλAteλBt+e(λA+λB)tdt=1T[t+eλAtλA+eλBtλBe(λA+λB)tλA+λB]0T=1T[T+eλATλA+eλBTλBe(λA+λB)TλA+λB1λA1λB+1λA+λB]=1+eλAT1λAT+eλBT1λBT+1e(λA+λB)T(λA+λB)T\begin{align} PFD_{avg} &= \frac{1}{T} \int_{0}^{T} 1 -e^{-\lambda_A t} - e^{-\lambda_B t} + e^{-(\lambda_A+\lambda_B) t} \,dt \\ \\ &= \frac{1}{T} * \left[t + \frac{e^{-\lambda_A t}}{\lambda_A} + \frac{e^{-\lambda_B t}}{\lambda_B} - \frac{e^{-(\lambda_A+\lambda_B) t}}{\lambda_A+\lambda_B} \right] _0^T \\ \\ &= \frac{1}{T} * \left[T + \frac{e^{-\lambda_A T}}{\lambda_A} + \frac{e^{-\lambda_B T}}{\lambda_B} - \frac{e^{-(\lambda_A+\lambda_B) T}}{\lambda_A+\lambda_B} - \frac{1}{\lambda_A} - \frac{1}{\lambda_B} + \frac{1}{\lambda_A+\lambda_B} \right] \\ \\ &= 1 + \frac{e^{-\lambda_A T}-1}{\lambda_A T} + \frac{e^{-\lambda_B T}-1}{\lambda_B T} + \frac{1-e^{-(\lambda_A+ \lambda_B )T}}{(\lambda_A+\lambda_B) T} \end{align}

Where “T” is the time interval over which we want to calculate the average PFD.

Assuming the lambdas are the same: PFDAvg=1+2eλT2λT+1e2λT2λT\begin{equation} PFD_{Avg} = 1 + \frac{2e^{-\lambda T}-2}{\lambda T} + \frac{1-e^{-2\lambda T}}{2\lambda T} \end{equation}

2oo2 Analytical PFD

Referencing the table in our multiple elements post, we see that the logic for 2oo2 voting is: PA+PBPAPB\begin{equation} P_A+P_B-P_AP_B \end{equation}

Substituting in the basic equation for the PFD of a 1oo1 system for each probability: PA+PBPAPB=(1eλAt)+(1eλBt)(1eλAt)(1eλBt)\begin{align} P_A+P_B-P_AP_B = (1-e^{-\lambda_A t})+(1-e^{-\lambda_B t})-(1-e^{-\lambda_A t})(1-e^{-\lambda_B t}) \end{align}

Where λA and λB are the failure rates of the two devices. These are often taken to be the same, but lets keep them separate for now so as to be a bit more general. Multiplying through: PFD=2eλAteλBt[1eλAteλBt+e(λA+λB)t]=1e(λA+λB)t\begin{align} PFD &= 2 - e^{-\lambda_A t} - e^{-\lambda_B t} - [1 -e^{-\lambda_A t} - e^{-\lambda_B t} + e^{-(\lambda_A +\lambda_B) t}] \\ \\ &= 1 - e^{-(\lambda_A +\lambda_B) t} \end{align}

Taking the lambdas to be the same we get: PFD=1e2λt\begin{equation} PFD = 1 - e^{-2\lambda t} \end{equation}

2oo2 Analytical PFD Average

Finding the average, assuming different lambdas for each device: PFDavg=1T0T1e(λA+λB)tdt=1T[t+e(λA+λB)tλA+λB]0T=1T[T+e(λA+λB)TλA+λB1λA+λB]=1+e(λA+λB)T1(λA+λB)T\begin{align} PFD_{avg} &= \frac{1}{T} \int_{0}^{T} 1 -e^{-(\lambda_A+\lambda_B) t} \,dt \\ \\ &= \frac{1}{T} * \left[t + \frac{e^{-(\lambda_A+ \lambda_B) t}}{\lambda_A+\lambda_B} \right] _0^T \\ \\ &= \frac{1}{T} * \left[T + \frac{e^{-(\lambda_A+ \lambda_B) T}}{\lambda_A+\lambda_B} - \frac{1}{\lambda_A+\lambda_B} \right] \\ \\ &= 1 + \frac{e^{-(\lambda_A+ \lambda_B) T}-1}{(\lambda_A+\lambda_B) T} \end{align}

Taking the lambdas to be the same: PFDAvg=1+e2λT12λT\begin{equation} PFD_{Avg} = 1 + \frac{e^{-2\lambda T}-1}{2\lambda T} \end{equation}

SymPy

I think we are getting the idea at this point. To avoid the tedium and inevitable mistakes from doing all this algebra, we are going to use SymPy to finish things up. SymPy is a computer algebra system written for python. The installation is pretty easy to follow along with if you are familiar with python, and if you aren’t, keep in mind that SymPy has a live shell you can use without installing anything.

The computer can sometimes represent formulas in ways that seem odd to a person. I will try and clean it up as much as possible, but sometimes it’s good to be flexible. For example, when having it compute the 1oo2 PFD Avg formula, it produces: PFDAvg=132λT+2eλTλTe2λT2λT\begin{equation} PFD_{Avg} = 1 - \frac{3}{2 \lambda T} + \frac{2 e^{- \lambda T}}{\lambda T} - \frac{e^{- 2\lambda T}}{2 \lambda T} \end{equation}

Comparing this with our result above we see that: PFDAvg=1+2eλT2λT+1e2λT2λT=1+2eλTλT2λT+12λTe2λT2λT=1+2eλTλT21λT+121λTe2λT2λT=1+2eλTλT321λTe2λT2λT\begin{align} PFD_{Avg} &= 1 + \frac{2e^{-\lambda T}-2}{\lambda T} + \frac{1-e^{-2\lambda T}}{2\lambda T} \\ \\ &= 1+\frac{2e^{-\lambda T}}{\lambda T} - \frac{2}{\lambda T}+ \frac{1}{2\lambda T}- \frac{e^{-2\lambda T}}{2\lambda T} \\ \\ &= 1+\frac{2e^{-\lambda T}}{\lambda T} - 2*\frac{1}{\lambda T}+ \frac{1}{2}*\frac{1}{\lambda T}- \frac{e^{-2\lambda T}}{2\lambda T} \\ \\ &= 1+\frac{2e^{-\lambda T}}{\lambda T} - \frac{3}{2}*\frac{1}{\lambda T}- \frac{e^{-2\lambda T}}{2\lambda T} \end{align}

And we see that the two formulas are the same.

I will provide the SymPy script at the end of this post.

1oo3 Analytical PFD

We are going to skip writing out the steps at this point. The general idea is the same as above, use the logic from the multiple elements post to obtain the pfd equation, and then find it’s average.

Results from SymPy: PFD=1eλCteλBt+eλBteλCteλAt+eλAteλCt+eλAteλBteλAteλBteλCt\begin{equation} PFD= 1 - e^{- \lambda_{C} t} - e^{- \lambda_{B} t} + e^{- \lambda_{B} t} e^{- \lambda_{C} t} - e^{- \lambda_{A} t} + e^{- \lambda_{A} t} e^{- \lambda_{C} t} + e^{- \lambda_{A} t} e^{- \lambda_{B} t} - e^{- \lambda_{A} t} e^{- \lambda_{B} t} e^{- \lambda_{C} t} \end{equation}

Assuming lambdas are the same: PFD=13eλt+3e2λte3λt\begin{equation} PFD=1 - 3 e^{- \lambda t} + 3 e^{- 2 \lambda t} - e^{- 3 \lambda t} \end{equation}

1oo3 Analytical PFD Average

Results from SymPy: PFDAvg=T+1+eλATeλBTeλCTλA+λB+λC+1eλATeλBTλA+λB+1eλATeλCTλA+λC+1eλBTeλCTλB+λC+1+eλCTλC+1+eλBTλB+1+eλATλAT\begin{equation} PFD_{Avg} = \frac{T + \frac{-1 + e^{- \lambda_{A} T} e^{- \lambda_{B} T} e^{- \lambda_{C} T}}{\lambda_{A} + \lambda_{B} + \lambda_{C}} + \frac{1 - e^{- \lambda_{A} T} e^{- \lambda_{B} T}}{\lambda_{A} + \lambda_{B}} + \frac{1 - e^{- \lambda_{A} T} e^{- \lambda_{C} T}}{\lambda_{A} + \lambda_{C}} + \frac{1 - e^{- \lambda_{B} T} e^{- \lambda_{C} T}}{\lambda_{B} + \lambda_{C}} + \frac{-1 + e^{- \lambda_{C} T}}{\lambda_{C}} + \frac{-1 + e^{- \lambda_{B} T}}{\lambda_{B}} + \frac{-1 + e^{- \lambda_{A} T}}{\lambda_{A}}}{T} \end{equation}

Assuming lambdas are the same: PFDAvg=1116λT+3eλTλT3e2λT2λT+e3λT3λT\begin{equation} PFD_{Avg}= 1 - \frac{11}{6 \lambda T} + \frac{3 e^{- \lambda T}}{\lambda T} - \frac{3 e^{- 2 \lambda T}}{2 \lambda T} + \frac{e^{- 3 \lambda T}}{3 \lambda T} \end{equation}

3oo3 Analytical PFD

Results from SymPy: PFD=1eλAteλBteλCt\begin{equation} PFD=1 - e^{- \lambda_{A} t} e^{- \lambda_{B} t} e^{- \lambda_{C} t} \end{equation}

Assuming lambdas are the same: PFD=1e3λt\begin{equation} PFD=1 - e^{- 3 \lambda t} \end{equation}

3oo3 Analytical PFD Average

Results from SymPy: PFDAvg=T+eλATλBTλCT1λA+λB+λCT\begin{equation} PFD_{Avg}=\frac{T + \frac{e^{- \lambda_{A} T - \lambda_{B} T - \lambda_{C} T} - 1}{\lambda_{A} + \lambda_{B} + \lambda_{C}}}{T} \end{equation}

Assuming lambdas are the same: PFDAvg=113λT+e3λT3λT\begin{equation} PFD_{Avg}=1 - \frac{1}{3 \lambda T} + \frac{e^{- 3 \lambda T}}{3 \lambda T} \end{equation}

2oo3 Analytical PFD

Results from SymPy: PFD=1eλBteλCteλAteλCteλAteλBt+2eλAteλBteλCt\begin{equation} PFD=1 - e^{- \lambda_{B} t} e^{- \lambda_{C} t} - e^{- \lambda_{A} t} e^{- \lambda_{C} t} - e^{- \lambda_{A} t} e^{- \lambda_{B} t} + 2 e^{- \lambda_{A} t} e^{- \lambda_{B} t} e^{- \lambda_{C} t} \end{equation}

Assuming lambdas are the same: PFD=13e2λt+2e3λt\begin{equation} PFD=1 - 3 e^{- 2 \lambda t} + 2 e^{- 3 \lambda t} \end{equation}

2oo3 Analytical PFD Average

Results from SymPy: PFDAvg=T+22eT(λA+λB+λC)λA+λB+λC+eλBTλCT1λB+λC+eλATλCT1λA+λC+eλATλBT1λA+λBT\begin{equation} PFD_{Avg}=\frac{T + \frac{2 - 2 e^{- T \left(\lambda_{A} + \lambda_{B} + \lambda_{C}\right)}}{\lambda_{A} + \lambda_{B} + \lambda_{C}} + \frac{e^{- \lambda_{B} T - \lambda_{C} T} - 1}{\lambda_{B} + \lambda_{C}} + \frac{e^{- \lambda_{A} T - \lambda_{C} T} - 1}{\lambda_{A} + \lambda_{C}} + \frac{e^{- \lambda_{A} T - \lambda_{B} T} - 1}{\lambda_{A} + \lambda_{B}}}{T} \end{equation}

Assuming lambdas are the same: 156λT+3e2λT2λT2e3λT3λT\begin{equation} 1 - \frac{5}{6 \lambda T} + \frac{3 e^{- 2 \lambda T}}{2 \lambda T} - \frac{2 e^{- 3 \lambda T}}{3 \lambda T} \end{equation}

SymPy Script

Here is the script that I used to calculate these:

from sympy import *

init_printing()

# here "L" is being used for lambda, T is test interval
t, L, L_A, L_B, L_C, T = symbols('t L L_A L_B L_C T', positive=True)


# 1oo1
pfd_1oo1 = 1 - exp(-L * t)  # by assumption
integral_1oo1 = integrate(pfd_1oo1, (t, 0, T))  # integrate over test interval
avg_1oo1 = simplify(integral_1oo1 / T)
print("PFD_1oo1: " + str(latex(pfd_1oo1)))  # generate latex for pfd
print("PFD_Avg_1oo1: " + str(latex(avg_1oo1)))  # generate latex for pfd avg


# 1oo2 unique lambdas
pfd_1oo1_A = 1 - exp(-L_A * t)  # 1oo1 device with lambda = L_A
pfd_1oo1_B = 1 - exp(-L_B * t)  # 1oo1 device with lambda = L_B
pfd_1oo2 = expand(pfd_1oo1_A * pfd_1oo1_B)  # logic for probability of 1oo2
# integrate over test interval, collect like terms
integral_1oo2 = collect(integrate(pfd_1oo2, (t, 0, T)), [1 / L_A, 1 / L_B])
args = list(integral_1oo2.args)  # get the list of terms in the integrated expression
args[2] = factor(integral_1oo2.args[2])  # need to factor this term to make it look pretty
# remake the integral with the factored term, collect like terms
integral_1oo2 = collect(integral_1oo2.func(*tuple(args)), 1 / (L_A + L_B))
avg_1oo2 = integral_1oo2 / T
print("PFD_1oo2 unique lambdas: " + str(latex(pfd_1oo2)))  # generate latex for pfd
print("PFD_Avg_1oo2 unique lambdas: " + str(latex(avg_1oo2)))  # generate latex for pfd avg


# 1oo2 same lambdas
pfd_1oo2 = expand(pfd_1oo1 * pfd_1oo1)  # logic for probability of 1oo2
integral_1oo2 = integrate(pfd_1oo2, (t, 0, T))  # integrate over test interval
avg_1oo2 = simplify(integral_1oo2 / T)
print("PFD_1oo2 same lambdas: " + str(latex(pfd_1oo2)))  # generate latex for pfd
print("PFD_Avg_1oo2 same lambdas: " + str(latex(avg_1oo2)))  # generate latex for pfd avg


# 2oo2 unique lambdas
pfd_2oo2 = expand(pfd_1oo1_A + pfd_1oo1_B - pfd_1oo1_A * pfd_1oo1_B)  # logic for probability of 2oo2
integral_2oo2 = collect(integrate(pfd_2oo2, (t, 0, T)), 1 / (L_A + L_B))  # integrate over test interval
avg_2oo2 = integral_2oo2 / T
print("PFD_2oo2 unique lambdas: " + str(latex(pfd_2oo2)))  # generate latex for pfd
print("PFD_Avg_2oo2 unique lambdas: " + str(latex(avg_2oo2)))  # generate latex for pfd avg


# 2oo2 same lambdas
pfd_2oo2 = expand(pfd_1oo1 + pfd_1oo1 - pfd_1oo1 * pfd_1oo1)  # logic for probability of 2oo2
integral_2oo2 = collect(integrate(pfd_2oo2, (t, 0, T)), 1 / (2 * L))  # integrate over test interval
avg_2oo2 = integral_2oo2 / T
print("PFD_2oo2 same lambdas: " + str(latex(pfd_2oo2)))  # generate latex for pfd
print("PFD_Avg_2oo2 same lambdas: " + str(latex(avg_2oo2)))  # generate latex for pfd avg


# 1oo3 unique lambdas
pfd_1oo1_C = 1 - exp(-L_C * t)  # 1oo1 device with lambda = L_C
pfd_1oo3 = expand(pfd_1oo1_A * pfd_1oo1_B * pfd_1oo1_C)  # logic for probability of 1oo3
# integrate over test interval
integral_1oo3 = integrate(pfd_1oo3, (t, 0, T))
args = list(integral_1oo3.args)  # get the list of terms in the integrated expression
# factor each term individually
factored_args = []
for arg in args:
    factored_args.append(factor(arg))
# remake the integral with the factored terms, collect like terms
integral_1oo3 = collect(integral_1oo3.func(*tuple(factored_args)),
                        [1 / L_A, 1 / L_B, 1 / L_C, 1 / (L_A + L_B), 1 / (L_B + L_C), 1 / (L_A + L_C),
                         1 / (L_A + L_B + L_C)])
avg_1oo3 = integral_1oo3 / T
print("PFD_1oo3 unique lambdas: " + str(latex(pfd_1oo3)))  # generate latex for pfd
print("PFD_Avg_1oo3 unique lambdas: " + str(latex(avg_1oo3)))  # generate latex for pfd avg


# 1oo3 same lambdas
pfd_1oo3 = expand(pfd_1oo1 * pfd_1oo1 * pfd_1oo1)  # logic for probability of 1oo3
# integrate over test interval
integral_1oo3 = integrate(pfd_1oo3, (t, 0, T))
avg_1oo3 = simplify(integral_1oo3 / T)
print("PFD_1oo3 same lambdas: " + str(latex(pfd_1oo3)))  # generate latex for pfd
print("PFD_Avg_1oo3 same lambdas: " + str(latex(avg_1oo3)))  # generate latex for pfd avg


# 3oo3 unique lambdas
pfd_3oo3 = expand(pfd_1oo1_A + pfd_1oo1_B + pfd_1oo1_C - pfd_1oo1_A * pfd_1oo1_B - pfd_1oo1_A * pfd_1oo1_C -
                  pfd_1oo1_B * pfd_1oo1_C + pfd_1oo1_A * pfd_1oo1_B * pfd_1oo1_C)  # logic for probability of 3oo3
# integrate over test interval
integral_3oo3 = integrate(pfd_3oo3, (t, 0, T))
args = list(integral_3oo3.args)  # get the list of terms in the integrated expression
# factor each term individually
factored_args = []
for arg in args:
    factored_args.append(factor(arg))
# remake the integral with the factored terms, collect like terms
integral_3oo3 = powsimp(collect(integral_3oo3.func(*tuple(factored_args)), 1 / (L_A + L_B + L_C)))
avg_3oo3 = (integral_3oo3 / T)
print("PFD_3oo3 unique lambdas: " + str(latex(pfd_3oo3)))  # generate latex for pfd
print("PFD_Avg_3oo3 unique lambdas: " + str(latex(avg_3oo3)))  # generate latex for pfd avg


# 3oo3 same lambdas
pfd_3oo3 = expand(pfd_1oo1 + pfd_1oo1 + pfd_1oo1 - pfd_1oo1 * pfd_1oo1 - pfd_1oo1 * pfd_1oo1 -
                  pfd_1oo1 * pfd_1oo1 + pfd_1oo1 * pfd_1oo1 * pfd_1oo1)  # logic for probability of 3oo3
# integrate over test interval
integral_3oo3 = integrate(pfd_3oo3, (t, 0, T))

avg_3oo3 = simplify(integral_3oo3 / T)
print("PFD_3oo3 same lambdas: " + str(latex(pfd_3oo3)))  # generate latex for pfd
print("PFD_Avg_3oo3 same lambdas: " + str(latex(avg_3oo3)))  # generate latex for pfd avg


# 2oo3 unique lambas
# logic for probability of 2oo3
pfd_2oo3 = expand(pfd_1oo1_A * pfd_1oo1_B + pfd_1oo1_A * pfd_1oo1_C +
                  pfd_1oo1_B * pfd_1oo1_C - 2 * pfd_1oo1_A * pfd_1oo1_B * pfd_1oo1_C)
# integrate over test interval
integral_2oo3 = integrate(pfd_2oo3, (t, 0, T))
args = list(integral_2oo3.args)  # get the list of terms in the integrated expression
# factor each term individually
factored_args = []
for arg in args:
    factored_args.append(factor(arg))
# remake the integral with the factored terms, collect like terms
integral_2oo3 = powsimp(collect(integral_2oo3.func(*tuple(factored_args)),
                                [1 / (L_A + L_B + L_C), 1 / (L_A + L_B), 1 / (L_A + L_C), 1 / (L_B + L_C)]))
avg_2oo3 = (integral_2oo3 / T)
print("PFD_2oo3 unique lambdas: " + str(latex(pfd_2oo3)))  # generate latex for pfd
print("PFD_Avg_2oo3 unique lambdas: " + str(latex(avg_2oo3)))  # generate latex for pfd avg


# 2oo3 same lambas
# logic for probability of 2oo3
pfd_2oo3 = expand(pfd_1oo1 * pfd_1oo1 + pfd_1oo1 * pfd_1oo1 +
                  pfd_1oo1 * pfd_1oo1 - 2 * pfd_1oo1 * pfd_1oo1 * pfd_1oo1)
# integrate over test interval
integral_2oo3 = integrate(pfd_2oo3, (t, 0, T))
avg_2oo3 = simplify(integral_2oo3 / T)
print("PFD_2oo3 same lambdas: " + str(latex(pfd_2oo3)))  # generate latex for pfd
print("PFD_Avg_2oo3 same lambdas: " + str(latex(avg_2oo3)))  # generate latex for pfd avg


© 2022. All rights reserved.