Among The Stars

peering the depths

View on GitHub
14 October 2025

Scoring competition participants on a curve (content warning: MATH 😱)

by ashley

I’ve been working on a scoring system that assigns points to participants in a competition based on their final placement in the event. The goal is to stack participants over a number of events based on their performance relative to other participants.

I want the system to be defined as a continuous increasing function such that each placement gains at least 1 point over the previous placement. So, 2nd-to-last place should gain at least 1 point over last place. Ideally, the system also rewards 1st place more than 2nd, 2nd more than 3rd, 3rd more than 4th, and so on until last place. The scoring function should be bounded between a minimum score and maximum score, and I should be able to vary the steepness of the curve.

That sounds a lot like…

The bezier curve!

B(a,b,r,t)=(1βˆ’t)2a+2(1βˆ’t)tr+t2b\Large B(a,b,r,t) = (1-t)^{2}a + 2(1 - t)tr + t^{2}b

The quadratic bezier is a second-order interpolant. Its basically a fancy parabola, where the intermediate control value rr varies the slope of the curve over tt. We can vary the inputs of B in order to shape the curve.

The score function

We need to be able to set:

theΒ numberΒ ofΒ participants:Β N0,{β€…N0∈Nβ€…β€Š|β€…β€Š2≀N0β€…}theΒ lowerΒ scoreΒ bound:Β S0,{β€…S0∈Nβ€…β€Š|β€…β€Š1≀Snβ€…}theΒ upperΒ scoreΒ bound:Β Sn,{β€…Sn∈Nβ€…β€Š|β€…β€ŠS0<Snβ€…}theΒ controlΒ coefficient:Β rc,{β€…rc∈Rβ€…β€Š|β€…β€Š0≀rc≀1β€…}\begin{align*} \text{the number of participants: } & N_0, \Set { N_0 \in \N | 2 \le N_0 } \\ \text{the lower score bound: } & S_0, \Set { S_0 \in \N | 1 \le S_n } \\ \text{the upper score bound: } & S_n, \Set { S_n \in \N | S_0 < S_n } \\ \text{the control coefficient: } & r_c, \Set { r_c \in \R | 0 \le r_c \le 1 } \\ \end{align*}

We can calculate the intermediate control rr as SrS_r:

{Sm=S0+Sn2Sr=(1βˆ’rc)Sm+rcS0\large \begin{cases} S_m & = \LARGE{\frac{S_0 + S_n}{2} } \\ S_r & = (1 - r_c)S_m + r_cS_0 \\ \end{cases}

And define the scoring functions:

{T(p)=(1βˆ’pβˆ’1N0βˆ’1){β€…p∈Nβ€…β€Š|β€…β€Š1≀p≀N0β€…}S(p)=B(S0,Β Sn,Β Sr,Β T(p)){β€…p∈Nβ€…β€Š|β€…β€Š1≀p≀N0β€…}\large \begin{cases} T(p) & = \bigg(1 - \frac{p - 1}{N_0 - 1}\bigg) & \Set{ p \in \N | 1 \leq p \leq N_0 } \\ S(p) & = B(S_0,\ S_n,\ S_r,\ T(p)) & \Set{ p \in \N | 1 \leq p \leq N_0 } \end{cases}

The scoring function so far is pretty simple. We can plot it and vary the inputs to get a curve with increasing steps between each place as pp approaches 1.

Constraining the step size

Depending on the values of our inputs, this function can provide a score for every placement. Lets define the differential score of two places as Ξ”S(p)\Delta S(p):

Ξ”S(p)=S(p)βˆ’S(p+1)Β forΒ allΒ {β€…p∈Nβ€…β€Š|β€…β€Š1≀p<N0β€…}\Large \Delta S(p) = S(p) - S(p + 1) \text{ for all } \Set{ p \in \N | 1 \le p < N_0 }

For example: Ξ”S(1)\Delta S(1) gives us the 1st and 2nd place differential score, and Ξ”S(N0βˆ’1)\Delta S(N_0-1) gives us the differential score for second-to-last and last place. Given any parameterization of the inputs, we need to ensure that for all values of pp in N\mathbb N, we must ensure the following Differential Constraint is always true:

{β€…p∈Nβ€…β€Š|β€…β€Š1≀p≀N0βˆ’1Β andΒ Ξ”S(p)β‰₯1β€…}\Large \Set{ p \in \N | 1 \le p \le N_0 - 1 \large{\text{ and }} \Large \Delta S(p) \ge 1 }

Variations in rc\large r_c can cause the Differential Constraint to fail given a small enough N0N_0, or small enough Snβˆ’S0S_n - S_0. So, we should find a set Rc\large R_c of all rc\large r_c for which the Differential Constraint is true:

Rc={β€…rc∈Rβ€…β€Š|β€…β€Š0≀rc≀1Β andΒ Ξ”S(p)β‰₯1β€…}\Large R_c = \Set{ r_c \in \R | 0 \le r_c \le 1 \large{\text{ and }} \Large \Delta S(p) \ge 1 }

Expanding Ξ”S(p)\Delta S(p) gives:

Ξ”S(p)=S(p)βˆ’S(p+1)=B(S0,Β Sn,Β Sr,Β T(p))βˆ’B(S0,Β Sn,Β Sr,Β T(p+1))=((1βˆ’T(p))2S0+2(1βˆ’T(p))T(p)Sr+T(p)2Sn)βˆ’Β Β Β Β Β ((1βˆ’T(p+1))2S0+2(1βˆ’T(p+1))T(p+1)Sr+T(p+1)2Sn)=((1βˆ’T(p))2S0+2(1βˆ’T(p))T(p)Sr+(T(p))2Sn)βˆ’Β Β Β Β Β ((1βˆ’T(p+1))2S0+2(1βˆ’T(p+1))T(p+1)Sr+(T(p+1))2Sn)=βˆ’2SrT(p+1)+2SrT(p)+2SrT(p+1)2βˆ’2SrT(p)2+Β Β Β Β Β Β 2S0T(p+1)βˆ’2S0T(p)βˆ’S0T(p+1)2+S0T(p)2βˆ’Β Β Β Β Β Β SnT(p+1)2+SnT(p)2\large \begin{equation*} \begin{split} \Delta S(p) &= S(p) - S(p + 1) \\ &= B(S_0,\ S_n,\ S_r,\ T(p)) - B(S_0,\ S_n,\ S_r,\ T(p + 1)) \\ &= \bigg((1 - T(p))^{2}S_0 + 2(1 - T(p))T(p)S_r + T(p)^{2}S_n\bigg) - {}\\ &\ \ \ \ \ \bigg((1 - T(p + 1))^{2}S_0 + 2(1 - T(p + 1))T(p + 1)S_r + T(p + 1)^{2}S_n\bigg) \\ &= \bigg((1 - T(p))^{2}S_0 + 2(1 - T(p))T(p)S_r + (T(p))^{2}S_n\bigg) - {}\\ &\ \ \ \ \ \bigg((1 - T(p + 1))^{2}S_0 + 2(1 - T(p + 1))T(p + 1)S_r + (T(p + 1))^{2}S_n\bigg) \\ &= -2S_rT(p + 1) + 2S_rT(p) + 2S_rT(p + 1)^2 - 2S_rT(p)^2 + {}\\ &\ \ \ \ \ \ 2S_0T(p + 1) - 2S_0T(p) - S_0T(p + 1)^2 + S_0T(p)^2 - {}\\ &\ \ \ \ \ \ S_nT(p + 1)^2 + S_nT(p)^2\\ \end{split} \end{equation*}

We only care about the smallest value of Ξ”S(p)\Delta S(p). We know that as pp approaches 00, Ξ”S(p)\Delta S(p) will increase, therefore the smallest value will always be Ξ”S(N0βˆ’1)\Delta S(N_0 - 1), given the constraints on pp defined by Ξ”S(p)\Delta S(p). We can simplify for Ξ”S(N0βˆ’1)\Delta S(N_0 - 1) as:

T(N0)=1βˆ’N0βˆ’1N0βˆ’1=1βˆ’1=0T(N0βˆ’1)=1βˆ’N0βˆ’1βˆ’1N0βˆ’1=1βˆ’N0βˆ’2N0βˆ’1=N0βˆ’1N0βˆ’1βˆ’N0βˆ’2N0βˆ’1=N0βˆ’N0+2βˆ’1N0βˆ’1=1N0βˆ’1Ξ”S(N0βˆ’1)=βˆ’2SrT(N0)+2SrT(N0βˆ’1)+2SrT(N0)2βˆ’2SrT(N0βˆ’1)2+Β Β Β Β Β Β 2S0T(N0)βˆ’2S0T(N0βˆ’1)βˆ’S0T(N0)2+S0T(N0βˆ’1)2βˆ’Β Β Β Β Β Β SnT(N0)2+SnT(N0βˆ’1)2=βˆ’2Sr0+2Sr1N0βˆ’1+2SrT02βˆ’2Sr1N0βˆ’12+Β Β Β Β Β Β 2S00βˆ’2S01N0βˆ’1βˆ’S002+S01N0βˆ’12βˆ’Β Β Β Β Β Β Sn02+Sn1N0βˆ’12=2Sr1N0βˆ’1+βˆ’2S01N0βˆ’1+βˆ’2Sr1N0βˆ’12+S01N0βˆ’12+Sn1N0βˆ’12=2Srβˆ’2S0N0βˆ’1+βˆ’2Sr+S0+Sn(N0βˆ’1)2\large \begin{equation*} \begin{split} T(N_0) &= 1 - \frac{N_0 - 1}{N_0 - 1}\\ &= 1 - 1\\ &= 0\\ T(N_0 - 1) &= 1 - \frac{N_0 - 1 - 1}{N_0 - 1}\\ &= 1 - \frac{N_0 - 2}{N_0 - 1}\\ &= \frac{N_0 - 1}{N_0 - 1} - \frac{N_0 - 2}{N_0 - 1}\\ &= \frac{\cancel{N_0 - N_0} + 2 - 1}{N_0 - 1}\\ &= \frac{1}{N_0 - 1}\\ \Delta S(N_0 - 1) &= -2S_rT(N_0) + 2S_rT(N_0 - 1) + 2S_rT(N_0)^2 - 2S_rT(N_0 - 1)^2 + {}\\ &\ \ \ \ \ \ 2S_0T(N_0) - 2S_0T(N_0 - 1) - S_0T(N_0)^2 + S_0T(N_0 - 1)^2 - {}\\ &\ \ \ \ \ \ S_nT(N_0)^2 + S_nT(N_0 - 1)^2\\ &= \cancel{-2S_r0} + 2S_r\frac{1}{N_0 - 1} + \cancel{2S_rT0^2} - 2S_r\frac{1}{N_0 - 1}^2 + {}\\ &\ \ \ \ \ \ \cancel{2S_00} - 2S_0\frac{1}{N_0 - 1} - \cancel{S_00^2} + S_0\frac{1}{N_0 - 1}^2 - {}\\ &\ \ \ \ \ \ \cancel{S_n0^2} + S_n\frac{1}{N_0 - 1}^2\\ &= 2S_r\frac{1}{N_0-1} + -2S_0\frac{1}{N_0-1} + -2S_r\frac{1}{N_0-1}^{2} + S_0\frac{1}{N_0-1}^{2} + S_n\frac{1}{N_0-1}^{2}\\ &= \frac{2S_r - 2S_0}{N_0-1} + \frac{-2S_r + S_0 + S_n}{(N_0-1)^2}\\ \end{split} \end{equation*}

Sr\large S_r needs to be expanded before we can simplify futher:

Sr=(1βˆ’rc)(S0+Sn2)+rcS0=(1βˆ’rc)(S0+Sn)2+rcS0=S0+Snβˆ’S0rcβˆ’Snrc2+rcS0=S0+Snβˆ’Snrc+S0rc22Sr=S0+Snβˆ’Snrc+S0rc\large \begin{equation*} \begin{split} S_r &= (1 - r_c)(\frac{S_0 + S_n}{2}) + r_cS_0\\ &= \frac{(1 - r_c)(S_0 + S_n)}{2} + r_cS_0\\ &= \frac{S_0 + S_n - S_0r_c - S_nr_c}{2} + r_cS_0\\ &= \frac{S_0 + S_n - S_nr_c + S_0r_c}{2}\\ 2S_r &= S_0 + S_n - S_nr_c + S_0r_c\\ \end{split} \end{equation*}

Substituting all 2Sr2S_r in our simplified Ξ”S(N0βˆ’1)\Delta S(N_0 -1), we are able to simplify even further:

Ξ”S(N0βˆ’1)=S0+Snβˆ’Snrc+S0rcβˆ’2S0N0βˆ’1+βˆ’S0βˆ’Sn+Snrcβˆ’S0rc+S0+Sn(N0βˆ’1)2=Snβˆ’Snrc+S0rcβˆ’S0N0βˆ’1+Snrcβˆ’S0rc(N0βˆ’1)2=(Snβˆ’Snrc+S0rcβˆ’S0)(N0βˆ’1)(N0βˆ’1)2+Snrcβˆ’S0rc(N0βˆ’1)2=SnN0βˆ’SnrcN0+S0rcN0βˆ’S0N0βˆ’Sn+Snrcβˆ’S0rc+S0+Snrcβˆ’S0rc(N0βˆ’1)2=SnN0βˆ’SnrcN0+S0rcN0βˆ’S0N0βˆ’Sn+2Snrcβˆ’2S0rc+S0(N0βˆ’1)2\large \begin{equation*} \begin{split} \Delta S(N_0 -1) &= \frac{S_0 + S_n - S_nr_c + S_0r_c - 2S_0}{N_0-1} + \frac{-S_0 - S_n + S_nr_c - S_0r_c + S_0 + S_n}{(N_0-1)^2}\\ &= \frac{S_n - S_nr_c + S_0r_c - S_0}{N_0-1} + \frac{S_nr_c - S_0r_c}{(N_0-1)^2}\\ &= \frac{(S_n - S_nr_c + S_0r_c - S_0)(N_0-1)}{(N_0-1)^2} + \frac{S_nr_c - S_0r_c}{(N_0-1)^2}\\ &= \frac{S_nN_0 - S_nr_cN_0 + S_0r_cN_0 - S_0N_0 - S_n + S_nr_c - S_0r_c + S_0 + S_nr_c - S_0r_c}{(N_0-1)^2}\\ &= \frac{S_nN_0 - S_nr_cN_0 + S_0r_cN_0 - S_0N_0 - S_n + 2S_nr_c - 2S_0r_c + S_0}{(N_0-1)^2}\\ \end{split} \end{equation*}

Now that we have Ξ”S(N0βˆ’1)\Delta S(N_0 -1) in terms of rc\large r_c, we can rephrase as an inequality and solve for rc\large r_c:

1β‰₯βˆ’SnN0rc+S0N0rc+2Snrcβˆ’2S0rc+SnN0βˆ’S0N0βˆ’Sn+S0(N0βˆ’1)21β‰₯βˆ’SnN0rc+S0N0rc+2Snrcβˆ’2S0rc+SnN0βˆ’S0N0βˆ’Sn+S0(N0βˆ’1)2(N0βˆ’1)2β‰₯βˆ’SnN0rc+S0N0rc+2Snrcβˆ’2S0rc+SnN0βˆ’S0N0βˆ’Sn+S0(N0βˆ’1)2βˆ’SnN0+S0N0+Snβˆ’S0β‰₯rc(βˆ’SnN0+S0N0+2Snβˆ’2S0)rc(βˆ’SnN0+S0N0+2Snβˆ’2S0)≀(N0βˆ’1)2βˆ’SnN0+S0N0+Snβˆ’S0rc≀(N0βˆ’1)2βˆ’SnN0+S0N0+Snβˆ’S0βˆ’SnN0+S0N0+2Snβˆ’2S0rc≀N02βˆ’2N0+1βˆ’SnN0+S0N0+Snβˆ’S0βˆ’SnN0+S0N0+2Snβˆ’2S0\large \begin{equation*} \begin{split} 1 &\ge \frac{- S_nN_0r_c + S_0N_0r_c + 2S_nr_c - 2S_0r_c + S_nN_0 - S_0N_0 - S_n + S_0}{(N_0-1)^2}\\ 1 &\ge \frac{- S_nN_0r_c + S_0N_0r_c + 2S_nr_c - 2S_0r_c + S_nN_0 - S_0N_0 - S_n + S_0}{(N_0-1)^2}\\ (N_0 - 1)^2 &\ge - S_nN_0r_c + S_0N_0r_c + 2S_nr_c -2S_0r_c + S_nN_0 - S_0N_0 - S_n + S_0\\ (N_0 - 1)^2 - S_nN_0 + S_0N_0 + S_n - S_0 &\ge r_c(-S_nN_0 + S_0N_0 + 2S_n - 2S_0)\\ r_c(-S_nN_0 + S_0N_0 + 2S_n - 2S_0) &\le (N_0 - 1)^2 - S_nN_0 + S_0N_0 + S_n - S_0\\ r_c &\le \frac{(N_0 - 1)^2 - S_nN_0 + S_0N_0 + S_n - S_0}{-S_nN_0 + S_0N_0 + 2S_n - 2S_0}\\ r_c &\le \frac{N_0^2 - 2N_0 + 1 - S_nN_0 + S_0N_0 + S_n - S_0}{-S_nN_0 + S_0N_0 + 2S_n - 2S_0}\\ \end{split} \end{equation*}

We can plug in some sample inputs to spot-check that our inequality makes sense:

N0=500S0=1000Sn=100,000rc≀5002βˆ’2(500)+1βˆ’100000(500)+1000(500)+100000βˆ’1000βˆ’100000(500)+(1000)(500)+2(100000)βˆ’2(1000)rcβ‰€βˆ’49151999βˆ’49302000rc≀4915199949302000rcβͺ…0.9969575067948562\large \begin{equation*} \begin{split} N_0 &= 500\\ S_0 &= 1000\\ S_n &= 100,000\\ r_c &\le \frac{500^2 - 2(500) + 1 - 100000(500) + 1000(500) + 100000 - 1000}{-100000(500) + (1000)(500) + 2(100000) - 2(1000)}\\ r_c &\le \frac{βˆ’49151999}{βˆ’49302000}\\ r_c &\le \frac{49151999}{49302000}\\ r_c &\lessapprox 0.9969575067948562\\ \end{split} \end{equation*}

Evaluating Ξ”S(N0βˆ’1)\Delta S(N_0 - 1) with rc=4915199949302000r_c = \frac{49151999}{49302000} should then yield 11:

Ξ”S(N0βˆ’1)=SnN0βˆ’SnrcN0+S0rcN0βˆ’S0N0βˆ’Sn+2Snrcβˆ’2S0rc+S0(N0βˆ’1)2=100000(500)βˆ’100000rc(500)+1000rc(500)βˆ’1000(500)βˆ’100000+2(100000)rcβˆ’2(1000)rc+1000(500βˆ’1)2=50000000βˆ’50000000rc+500000rcβˆ’500000βˆ’100000+200000rcβˆ’2000rc+1000249001=50000000βˆ’500000βˆ’100000+1000+rc(βˆ’50000000+500000+200000βˆ’2000)249001=49401000βˆ’49302000rc249001=49401000βˆ’493020004915199949302000249001=249001249001=1\large \begin{equation*} \begin{split} \Delta S(N_0 - 1) &= \frac{S_nN_0 - S_nr_cN_0 + S_0r_cN_0 - S_0N_0 - S_n + 2S_nr_c - 2S_0r_c + S_0}{(N_0 - 1)^2}\\ &= \frac{100000(500) - 100000r_c(500) + 1000r_c(500) - 1000(500) - 100000 + 2(100000)r_c - 2(1000)r_c + 1000}{(500 - 1)^2}\\ &= \frac{50000000 - 50000000r_c + 500000r_c - 500000 - 100000 + 200000r_c - 2000r_c + 1000}{249001}\\ &= \frac{50000000 - 500000 - 100000 + 1000 + r_c(-50000000 + 500000 + 200000 - 2000)}{249001}\\ &= \frac{49401000 βˆ’ 49302000r_c}{249001}\\ &= \frac{49401000 βˆ’ 49302000\frac{49151999}{49302000} }{249001}\\ &= \frac{249001}{249001}\\ &= 1\\ \end{split} \end{equation*}

Excellent (:

Finally, we can define Rc\large R_c in terms of our inequality on rc\large r_c:

Rc={β€…rc∈Rβ€…β€Š|β€…β€Š0≀rc≀N02βˆ’2N0+1βˆ’SnN0+S0N0+Snβˆ’S0βˆ’SnN0+S0N0+2Snβˆ’2S0β€…}\Large R_c = \Set{ r_c \in \R | 0 \le r_c \le \frac{N_0^2 - 2N_0 + 1 - S_nN_0 + S_0N_0 + S_n - S_0}{-S_nN_0 + S_0N_0 + 2S_n - 2S_0}}

This set implies Ξ”S(p)β‰₯1\Delta S(p) \ge 1 because rc≀N02βˆ’2N0+1βˆ’SnN0+S0N0+Snβˆ’S0βˆ’SnN0+S0N0+2Snβˆ’2S0r_c \le \large \frac{N_0^2 - 2N_0 + 1 - S_nN_0 + S_0N_0 + S_n - S_0}{-S_nN_0 + S_0N_0 + 2S_n - 2S_0} was solved from the inequality Ξ”S(p)β‰₯1\Delta S(p) \ge 1 .

A better curve

The curve created by S(p)S(p) does fulfill my original requirements, but I feel it should reward better placements more dramatically. I want to be able to control how dramaticaly the slope rises as pp approaches 11 from N0N_0. I’ll try by createing an n-th order variant of our score function.

Lets define a new input - the control exponent re\large r_e:

{β€…re∈Rβ€…β€Š|β€…β€Šreβ‰₯1β€…}\Large \Set{ r_e \in \R | r_e \ge 1 }

And redefine the score functions to include rer_e:

{T(p)=(1βˆ’pβˆ’1N0βˆ’1){β€…p∈Nβ€…β€Š|β€…β€Š1≀p≀N0β€…}S(p)=B(S0,Β Sn,Β Sr,Β T(p)re){β€…p∈Nβ€…β€Š|β€…β€Š1≀p≀N0β€…}\large \begin{cases} T(p) &= \bigg(1 - \frac{p - 1}{N_0 - 1}\bigg) & \Set{ p \in \N | 1 \leq p \leq N_0 } \\ S(p) &= B(S_0,\ S_n,\ S_r,\ T(p)^{r_e}) & \Set{ p \in \N | 1 \leq p \leq N_0 }\\ \end{cases}

Just as with our 2nd-order S(p)S(p), the Differential Constraint should remain true:

{Ξ”S(p)=S(p)βˆ’S(p+1)Β forΒ allΒ {β€…p∈Nβ€…β€Š|β€…β€Š1≀p<N0β€…}Ξ”S(p)β‰₯1Β forΒ allΒ {β€…p∈Nβ€…β€Š|β€…β€Š1≀p≀N0βˆ’1β€…}\large \begin{cases} \Delta S(p) = S(p) - S(p + 1) &\text{ for all } \Set{ p \in \N | 1 \le p < N_0 }\\ \Delta S(p) \ge 1 &\text{ for all } \Set{ p \in \N | 1 \le p \le N_0 - 1 }\\ \end{cases}

Unfourtunately, given the higher order T(p)reT(p)^{r_e}, small variations in re\large{r_e} can cause the Differential Constraint to fail given a small enough N0N_0, large enough rcr_c, or small enough Snβˆ’S0S_n - S_0. So, we should find a set E\large E of all re\large r_e and rc\large r_c for which the Differential Constraint is true:

E={β€…(rc,re)∈RcΓ—Rβ€…β€Š|β€…β€Šreβ‰₯1Β andΒ Ξ”S(p)β‰₯1β€…}\Large E = \Set { (r_c, r_e) \in R_c \times \R | r_e \ge 1 \large{\text{ and }} \Large \Delta S(p) \ge 1 }

Just as with our 2nd order S(p)S(p), we’re going to need to solve Ξ”S(p)\Delta S(p) in terms of re\large r_e. We can reuse the original expansion of Ξ”S(p)\Delta S(p), because the T(p)T(p) substitutions are unaltered in the simplified form of Ξ”S(p)\Delta S(p):

Ξ”S(p)=S(p)βˆ’S(p+1)=B(S0,Β Sn,Β Sr,Β T(p)re)βˆ’B(S0,Β Sn,Β Sr,Β T(p+1)re)=βˆ’2SrT(p+1)re+2SrT(p)re+2SrT(p+1)2reβˆ’2SrT(p)2re+Β Β Β Β Β Β 2S0T(p+1)reβˆ’2S0T(p)reβˆ’S0T(p+1)2re+S0T(p)2reβˆ’Β Β Β Β Β Β SnT(p+1)2re+SnT(p)2re\large \begin{equation*} \begin{split} \Delta S(p) &= S(p) - S(p + 1) \\ &= B(S_0,\ S_n,\ S_r,\ T(p)^{r_e}) - B(S_0,\ S_n,\ S_r,\ T(p + 1)^{r_e}) \\ &= -2S_rT(p + 1)^{r_e} + 2S_rT(p)^{r_e} + 2S_rT(p + 1)^{2r_e} - 2S_rT(p)^{2r_e} + {}\\ &\ \ \ \ \ \ 2S_0T(p + 1)^{r_e} - 2S_0T(p)^{r_e} - S_0T(p + 1)^{2r_e} + S_0T(p)^{2r_e} - {}\\ &\ \ \ \ \ \ S_nT(p + 1)^{2r_e} + S_nT(p)^{2r_e}\\ \end{split} \end{equation*}

Just as with our 2nd order variant, we only care about the smallest value of Ξ”S(p)\Delta S(p), which will be Ξ”S(N0βˆ’1)\Delta S(N_0 - 1) as we showed earlier. We can reuse a simplification that preserves our TT invocations, adding in our exponent:

Ξ”S(N0βˆ’1)=2Sr1N0βˆ’1re+βˆ’2S01N0βˆ’1re+βˆ’2Sr1N0βˆ’12re+S01N0βˆ’12re+Sn1N0βˆ’12re\large \begin{equation*} \begin{split} \Delta S(N_0 - 1) &= 2S_r\frac{1}{N_0-1}^{r_e} + -2S_0\frac{1}{N_0-1}^{r_e} + -2S_r\frac{1}{N_0-1}^{2r_e} + S_0\frac{1}{N_0-1}^{2r_e} + S_n\frac{1}{N_0-1}^{2r_e} \end{split} \end{equation*}

Lets substitute out 1N0βˆ’1re\Large \frac{1}{N_0-1}^{r_e} with a term NN:

Ξ”S(N0βˆ’1)=2SrNβˆ’2SrN2βˆ’2S0N+S0N2+SnN2=S0N2+SnN2βˆ’SrN2βˆ’2S0N+2SrN=(S0+Snβˆ’2Sr)N2+(βˆ’2S0+2Sr)N\large \begin{equation*} \begin{split} \Delta S(N_0 - 1) &= 2S_rN - 2S_rN^2 - 2S_0N + S_0N^2 + S_nN^2\\ &= S_0N^2 + S_nN^2 - S_rN^2 - 2S_0N + 2S_rN\\ &= (S_0 + S_n - 2S_r)N^2 + (-2S_0+2S_r)N\\ \end{split} \end{equation*}

Now we can rephrase the quadratic interms of NN:

a=S0+Snβˆ’2Srb=βˆ’2S0+2SrΞ”S(N0βˆ’1)=aN2+bN\large \begin{equation*} \begin{split} a &= S_0 + S_n - 2S_r \\ b &= -2S_0 + 2S_r \\ \Delta S(N_0 - 1) &= aN^2 +bN\\ \end{split} \end{equation*}

Once we solve for NN, we can then rearrange to solve for all values of rer_e that fulfill our inequality, in terms of rc,S0,Sn,N0r_c, S_0, S_n, N_0:

1≀aN2+bN\large 1 \le aN^2 + bN

Before solving the quadratic, lets consider the roots. We can simplify aa and bb into the the simplest terms:

a=S0+Snβˆ’2Sr=S0+Snβˆ’2((1βˆ’rc)Sm+rcS0)=S0+Snβˆ’2((1βˆ’rc)S0+Sn2+rcS0)=S0+Snβˆ’2(S0+Snβˆ’rcS0βˆ’rcSn2+rcS0)=S0+Snβˆ’S0βˆ’Sn+rcS0+rcSnβˆ’2rcS0=rcS0+rcSnβˆ’2rcS0=rcSnβˆ’rcS0=rc(Snβˆ’S0)b=βˆ’2S0+2Sr=βˆ’2S0+2((1βˆ’rc)Sm+rcS0)=βˆ’2S0+S0+Snβˆ’rcS0βˆ’rcSn+2rcS0=βˆ’S0+Snβˆ’rcSn+rcS0=rc(S0βˆ’Sn)βˆ’S0+Sn=(S0βˆ’Sn)(rcβˆ’1)\large \begin{equation*} \begin{split} a &= S_0 + S_n - 2S_r \\ &= S_0 + S_n - 2((1-r_c)S_m + r_cS_0)\\ &= S_0 + S_n - 2((1 - r_c)\frac{S_0 + S_n}{2} + r_cS_0)\\ &= S_0 + S_n - 2(\frac{S_0 + S_n - r_cS_0 - r_cS_n}{2} + r_cS_0)\\ &= S_0 + S_n - S_0 - S_n + r_cS_0 + r_cS_n - 2r_cS_0\\ &= r_cS_0 + r_cS_n - 2r_cS_0\\ &= r_cS_n - r_cS_0\\ &= r_c(S_n - S_0)\\\\ b &= -2S_0 + 2S_r \\ &= -2S_0 + 2((1-r_c)S_m + r_cS_0) \\ &= -2S_0 + S_0 + S_n - r_cS_0 - r_cS_n + 2r_cS_0\\ &= -S_0 + S_n - r_cS_n + r_cS_0\\ &= r_c(S_0 - S_n) - S_0 + S_n\\ &= (S_0 - S_n)(r_c - 1)\\ \end{split} \end{equation*}

We can then clearly see that when rc=0,Β a=0Snβˆ’0S0=0\large r_c = 0, \ a = 0S_n - 0S_0 = 0, and that when rc=1,Β b=S0(1βˆ’1)+Sn(1βˆ’1)=0\large r_c = 1, \ b = S_0(1 - 1) + S_n(1-1) = 0. Therefore, there are equations to consider:

1≀aN2+bNΒ whenΒ 0<rc<11≀bNΒ whenΒ rc=01≀aN2Β whenΒ rc=1\large \begin{align*} 1 &\le aN^2 + bN &\text{ when } &0 < r_c < 1 \\ 1 &\le bN &\text{ when } &r_c = 0 \\ 1 &\le aN^2 &\text{ when } &r_c = 1 \\ \end{align*}

Then we must solve for NN in all three cases:

βˆ’b+b2+4a2a≀Nβ‰€βˆ’bβˆ’b2+4a2aΒ whenΒ 0<rc<11b≀NΒ whenΒ rc=01a≀NΒ whenΒ rc=1\large \begin{align} \frac{-b + \sqrt{b^2 + 4a}}{2a} \le N &\le \frac{-b - \sqrt{b^2 + 4a}}{2a} &\text{ when } &0 < r_c < 1 \\ % \frac{1}{2}\bigg(\frac{\sqrt{b^2 - 4ac} - b}) \le N &\le &0 < r_c < 1\\ \frac{1}{b} &\le N &\text{ when } &r_c = 0 \\ \sqrt{\frac{1}{a}} &\le N &\text{ when } &r_c = 1 \\ \end{align} % \begin{equation*} % \begin{split} % \frac{-b + \sqrt{b^2 + 4a}}{2a} \le N &\le \frac{-b - \sqrt{b^2 + 4a}}{2a}\\ % \end{split} % \end{equation*}

Lets start by substituting & solving the two simple cases:

1Snβˆ’S0≀NΒ whenΒ rc=01Snβˆ’S0≀NΒ whenΒ rc=1\large \begin{align*} \frac{1}{S_n - S_0} &\le N &\text{ when } &r_c = 0 \\ \sqrt{\frac{1}{S_n - S_0}} &\le N &\text{ when } &r_c = 1 \\ \end{align*}

solving rer_e when rc=0r_c = 0

Substituting N:

Nβ‰₯1Snβˆ’S0(1N0βˆ’1)reβ‰₯1Snβˆ’S0\large \begin{align*} N &\ge \frac{1}{S_n - S_0}\\ \bigg(\frac{1}{N_0 - 1}\bigg)^{r_e} &\ge \frac{1}{S_n - S_0}\\ \end{align*}

Solving for rer_e with change of base:

reln⁑1N0βˆ’1β‰₯ln⁑1Snβˆ’S0re≀ln⁑1Snβˆ’S0/ln⁑1N0βˆ’1\large \begin{align*} r_e \ln \frac{1}{N_0 - 1} &\ge \ln \frac{1}{S_n - S_0}\\ r_e &\le \ln \frac{1}{S_n - S_0} \Bigg/ \ln \frac{1}{N_0 - 1}\\ \end{align*}

Solving for an example value to spot check with:

N0=200S0=1000Sn=100000re≀ln⁑1100000βˆ’1000/ln⁑1200βˆ’1re≀ln⁑199000/ln⁑1199reβͺ…2.173098944800602\large \begin{align*} N_0 &= 200\\ S_0 &= 1000\\ S_n &= 100000\\ r_e &\le \ln \frac{1}{100000 - 1000} \Bigg/ \ln \frac{1}{200 - 1}\\ r_e &\le \ln \frac{1}{99000} \Bigg/ \ln \frac{1}{199}\\ r_e &\lessapprox 2.173098944800602 \end{align*}

Plugging the value back in to Ξ”S(p)\large \Delta S(p), which should get a value close to 11:

Sm=1000+1000002=50500Sr=(1βˆ’0)50500+0(1000)=50500reβ‰ˆ2.173098944800602T(199)reβ‰ˆ(1199βˆ’1)2.173098944800602β‰ˆ0.0000102121996910658T(200)reβ‰ˆ(1200βˆ’1)2.173098944800602β‰ˆ0.00001010101010101007S(199)=B(1000,100000,50500,0.0000102121996910658)β‰ˆ1001S(200)=B(1000,100000,50500,0.00001010101010101007)β‰ˆ1000Ξ”S(199)β‰ˆ1001βˆ’1000β‰ˆ1\large \begin{align*} S_m &= \frac{1000 + 100000}{2} = 50500\\ S_r &= (1 - 0)50500 + 0(1000) = 50500\\ r_e &\approx 2.173098944800602\\ T(199)^{r_e} &\approx \bigg(\frac{1}{199 - 1}\bigg)^{2.173098944800602} \approx 0.0000102121996910658 \\ T(200)^{r_e} &\approx \bigg(\frac{1}{200 - 1}\bigg)^{2.173098944800602} \approx 0.00001010101010101007 \\ S(199) &= B(1000, 100000, 50500, 0.0000102121996910658) \approx 1001\\ S(200) &= B(1000, 100000, 50500, 0.00001010101010101007) \approx 1000\\ \Delta S(199) &\approx 1001 - 1000 \approx 1 \end{align*}

Yippee!!!

solving rer_e when rc=1r_c = 1

I’ll follow the same process. Subsituting for N and solving for rer_e with change of base:

Nβ‰₯1Snβˆ’S0(1N0βˆ’1)reβ‰₯1Snβˆ’S0reln⁑1N0βˆ’1β‰₯ln⁑1Snβˆ’S0re≀ln⁑1Snβˆ’S0/ln⁑1N0βˆ’1\large \begin{align*} N &\ge \sqrt{\frac{1}{S_n - S_0}}\\ \bigg(\frac{1}{N_0 - 1}\bigg)^{r_e} &\ge \sqrt{\frac{1}{S_n - S_0}}\\ r_e \ln \frac{1}{N_0 - 1} &\ge \ln \sqrt{\frac{1}{S_n - S_0}}\\ r_e &\le \ln \sqrt{\frac{1}{S_n - S_0}} \Bigg/ \ln \frac{1}{N_0 - 1}\\ \end{align*}

Solving for an example value to spot check with:

N0=200S0=1000Sn=100000re≀ln⁑1100000βˆ’1000/ln⁑1200βˆ’1re≀ln⁑199000/ln⁑1199reβͺ…1.086549472400301\large \begin{align*} N_0 &= 200\\ S_0 &= 1000\\ S_n &= 100000\\ r_e &\le \ln \sqrt{\frac{1}{100000 - 1000}} \Bigg/ \ln \frac{1}{200 - 1}\\ r_e &\le \ln \sqrt{\frac{1}{99000}} \Bigg/ \ln \frac{1}{199}\\ r_e &\lessapprox 1.086549472400301 \end{align*}

Plugging the value back in to Ξ”S(p)\large \Delta S(p), which should get a value close to 11:

Sm=1000+1000002=50500Sr=(1βˆ’0)50500+0(1000)=50500reβ‰ˆ1.086549472400301T(199)reβ‰ˆ(1199βˆ’1)1.086549472400301β‰ˆ0.0000102121996910658T(200)reβ‰ˆ(1200βˆ’1)1.086549472400301β‰ˆ0.00001010101010101007S(199)=B(1000,100000,50500,0.0000102121996910658)β‰ˆ1001S(200)=B(1000,100000,50500,0.00001010101010101007)β‰ˆ1000Ξ”S(199)β‰ˆ1001βˆ’1000β‰ˆ1\large \begin{align*} S_m &= \frac{1000 + 100000}{2} = 50500\\ S_r &= (1 - 0)50500 + 0(1000) = 50500\\ r_e &\approx 1.086549472400301\\ T(199)^{r_e} &\approx \bigg(\frac{1}{199 - 1}\bigg)^{1.086549472400301} \approx 0.0000102121996910658 \\ T(200)^{r_e} &\approx \bigg(\frac{1}{200 - 1}\bigg)^{1.086549472400301} \approx 0.00001010101010101007 \\ S(199) &= B(1000, 100000, 50500, 0.0000102121996910658) \approx 1001\\ S(200) &= B(1000, 100000, 50500, 0.00001010101010101007) \approx 1000\\ \Delta S(199) &\approx 1001 - 1000 \approx 1 \end{align*}

Yayy!!!

solving rer_e when 0<rc<10 < r_c < 1

Now I can worry about the tougher one. Lets substitute and simplify both sides of the quadratic while taking care to retain the root’s sign & inequality:

βˆ’(S0βˆ’Sn)(rcβˆ’1)Β±[(S0βˆ’Sn)(rcβˆ’1)]2+4rc(Snβˆ’S0)2rc(Snβˆ’S0)(Snβˆ’S0)(rcβˆ’1)2rc(Snβˆ’S0)Β±(S0βˆ’Sn)2(rcβˆ’1)2+4rc(Snβˆ’S0)4rc2(Snβˆ’S0)2rcβˆ’12rcΒ±βˆ’(Snβˆ’S0)(S0βˆ’Sn)(rcβˆ’1)2+4rc(Snβˆ’S0)4rc2(Snβˆ’S0)2rcβˆ’12rcΒ±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)\large \begin{align*} & \frac{-(S_0 - S_n)(r_c - 1) \pm \sqrt{[(S_0 - S_n)(r_c - 1)]^2 + 4r_c(S_n - S_0)}}{2r_c(S_n - S_0)}\\ & \frac{\cancel{(S_n - S_0)}(r_c - 1)}{2r_c\cancel{(S_n - S_0)}} \pm \sqrt{\frac{(S_0 - S_n)^2(r_c - 1)^2 + 4r_c(S_n - S_0)}{4r_c^2(S_n - S_0)^2}}\\ & \frac{r_c - 1}{2r_c} \pm \sqrt{\frac{-\cancel{(S_n - S_0)}(S_0 - S_n)(r_c - 1)^2 + 4r_c\cancel{(S_n - S_0)}}{4r_c^2(S_n - S_0)^{\cancel{2}}}}\\ & \frac{r_c - 1}{2r_c} \pm \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}\\ \end{align*}

Fitting the simplified form back into the inequality with the appropriate signs & direction preserved, so that I can solve for rer_e

rcβˆ’12rc+(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)≀N≀rcβˆ’12rcβˆ’(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)\large \begin{align*} \frac{r_c - 1}{2r_c} + \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}} \le N \le \frac{r_c - 1}{2r_c} - \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}\\ \end{align*}

We can perform a change of base to solve for rer_e. Note the direction of inequality has changed due to the division of the decreasing function ln(1N0βˆ’1)ln(\frac{1}{N_0 - 1}), which has the limit lim⁑N0⟢∞ln(1N0βˆ’1)=βˆ’βˆžΒ forΒ allΒ {N0∈R∣N0>1}\lim\limits_{N_0\longrightarrow\infty} ln(\frac{1}{N_0 - 1}) = -\infty \text{ for all } \lbrace N_0 \in \mathbb{R} \mid N_0 > 1\rbrace.

ln⁑(rcβˆ’12rc+(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))ln⁑(1N0βˆ’1)β‰₯reβ‰₯ln⁑(rcβˆ’12rcβˆ’(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))ln⁑(1N0βˆ’1)\large \begin{align*} \frac{\ln(\frac{r_c - 1}{2r_c} + \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}})}{\ln(\frac{1}{N_0 - 1})} \ge r_e &\ge \frac{\ln(\frac{r_c - 1}{2r_c} - \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}})}{\ln(\frac{1}{N_0 - 1})} \\ \end{align*}

I may have some cases where the solution to parts of this expression are imaginary:

(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)∈CΒ whenΒ (Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<0Β orΒ ln⁑(rcβˆ’12rcΒ±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))∈CΒ whenΒ rcβˆ’12rcΒ±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<0\sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}} \in \Complex \text{ when } \frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)} < 0 \\ \text{ or }\\ \ln(\frac{r_c - 1}{2r_c} \pm \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}) \in \Complex \text{ when } \frac{r_c - 1}{2r_c} \pm \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}} < 0

It turns out that (Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<0\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)} < 0 is never true, because it implies (Snβˆ’S0)(rcβˆ’1)2+4rc<0(S_n - S_0)(r_c - 1)^2 + 4r_c < 0. rcβˆ’1r_c - 1 can be negative when rc<1r_c < 1 - so always for 0<rc<10 < r_c < 1 - but that expression is squared, so the result will always be positive. Therefore, the inner square root will never be imaginary.

However, the logarithm can be imaginary. The root scales by SnS_n and S0S_0, and will always be greater than rcβˆ’12rc\frac{r_c - 1}{2r_c}. Taking a look at the inequality:

rcβˆ’12rcΒ±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<0Β±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<rcβˆ’12rc2Β±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<(rcβˆ’1)24rc2Β±(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0)<(Snβˆ’S0)(rcβˆ’1)24rc2(Snβˆ’S0)\large \begin{align*} \frac{r_c - 1}{2r_c} \pm \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}} &< 0\\ \pm \frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)} &< \frac{r_c - 1}{2r_c}^2\\ \pm \frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)} &< \frac{(r_c - 1)^2}{4r_c^2}\\ \pm \frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)} &< \frac{(S_n - S_0)(r_c - 1)^2}{4r_c^2(S_n - S_0)}\\ \end{align*}

Since the sides are equivalent other than the +4rc+ 4r_c in the numerator on the left side, which is always positive, this inequality has no real solutions with the positive root. In contrast this inequality is always true when the root is negative. Therefore, ln⁑(rcβˆ’12rcβˆ’(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))\ln(\frac{r_c - 1}{2r_c} - \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}) is always imaginary, and ln⁑(rcβˆ’12rc+(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))\ln(\frac{r_c - 1}{2r_c} + \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}) is never imaginary. I’ll define a set ErE_r:

Er={β€…rc∈Rβ€…β€Š|β€…β€Š0<rc<1(βˆƒre∈R)[1≀re≀ln⁑(rcβˆ’12rc+(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))/ln⁑(1N0βˆ’1)]β€…}βˆ΅Ξ”S(p)β‰₯1β€…β€ŠβŸΈβ€…β€Šln⁑(rcβˆ’12rc+(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))/ln⁑(1N0βˆ’1)\large \begin{align*} E_r &= \Set { r_c \in \R | 0 < r_c < 1 (\exists r_e \in \R)\Bigg[1 \le r_e \le \ln\bigg(\frac{r_c - 1}{2r_c} + \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}\bigg) \Bigg/ \ln(\frac{1}{N_0 - 1}) \Bigg]}\\ &\because \Delta S(p) \ge 1 \impliedby \ln\bigg(\frac{r_c - 1}{2r_c} + \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}\bigg) \Bigg/ \ln(\frac{1}{N_0 - 1})\\ \end{align*}

Now I can verify by plugging in some values:

rc=0.5N0=500S0=1000Sn=100,000re≀ln⁑(0.5βˆ’12(0.5)+(100000βˆ’1000)(0.5βˆ’1)2+4(0.5)4(0.5)2(100000βˆ’1000))ln⁑(1500βˆ’1)re≀ln⁑(βˆ’12+2475299000)ln⁑(1499)reβͺ…1.73996998737\large \begin{equation*} \begin{split} r_c &= 0.5\\ N_0 &= 500\\ S_0 &= 1000\\ S_n &= 100,000\\ re &\le \frac{\ln(\frac{0.5 - 1}{2(0.5)} + \sqrt{\frac{(100000 - 1000)(0.5 - 1)^2 + 4(0.5)}{4(0.5)^2(100000 - 1000)}})}{\ln(\frac{1}{500 - 1})}\\ re &\le \frac{\ln(-\frac{1}{2} + \sqrt{\frac{24752}{99000}})}{\ln(\frac{1}{499})}\\ re &\lessapprox 1.73996998737\\ \end{split} \end{equation*}

Plugging the value back in to Ξ”S(p)\large \Delta S(p), which should get a value close to 11:

Sm=1000+1000002=50500Sr=(1βˆ’0.5)50500+0.5(1000)=25750reβ‰ˆ1.73996998737T(499)reβ‰ˆ(1499βˆ’1)1.73996998737β‰ˆ0.00002027224725513445T(500)reβ‰ˆ(1500βˆ’1)1.73996998737β‰ˆ0.00002020161209699543S(499)=B(1000,100000,25750,0.00002027224725513445)β‰ˆ1001S(500)=B(1000,100000,25750,0.00002020161209699543)β‰ˆ1000Ξ”S(499)β‰ˆ1001βˆ’1000β‰ˆ1\large \begin{align*} S_m &= \frac{1000 + 100000}{2} = 50500\\ S_r &= (1 - 0.5)50500 + 0.5(1000) = 25750\\ r_e &\approx 1.73996998737\\ T(499)^{r_e} &\approx \bigg(\frac{1}{499 - 1}\bigg)^{1.73996998737} \approx 0.00002027224725513445 \\ T(500)^{r_e} &\approx \bigg(\frac{1}{500 - 1}\bigg)^{1.73996998737} \approx 0.00002020161209699543 \\ S(499) &= B(1000, 100000, 25750, 0.00002027224725513445) \approx 1001\\ S(500) &= B(1000, 100000, 25750, 0.00002020161209699543) \approx 1000\\ \Delta S(499) &\approx 1001 - 1000 \approx 1 \end{align*}

Yippee!!!

Sum of the parts

Given our constraints on the parameters, lets define sets that describe the valid domain of re\large r_e such that the Differential Constraint is fullfilled:

E0={β€…(rc,re)∈RcΓ—Nβ€…β€Š|β€…β€Šrc=0∧1≀re≀ln⁑1Snβˆ’S0/ln⁑1N0βˆ’1β€…}E1={β€…(rc,re)∈RcΓ—Nβ€…β€Š|β€…β€Šrc=1∧1≀re≀ln⁑1Snβˆ’S0/ln⁑1N0βˆ’1β€…}Er={β€…(rc,re)∈RcΓ—Nβ€…β€Š|β€…β€Š0<rc<1∧1≀re≀ln⁑(rcβˆ’12rc+(Snβˆ’S0)(rcβˆ’1)2+4rc4rc2(Snβˆ’S0))/ln⁑1N0βˆ’1β€…}\large \begin{equation*} \begin{split} E_0 &= \Set{(r_c, r_e) \in R_c \times \N | r_c = 0 \land 1 \le r_e \le \ln \frac{1}{S_n - S_0} \Bigg/ \ln \frac{1}{N_0 - 1}}\\ E_1 &= \Set{(r_c, r_e) \in R_c \times \N | r_c = 1 \land 1 \le r_e \le \ln \sqrt{\frac{1}{S_n - S_0}} \Bigg/ \ln \frac{1}{N_0 - 1}}\\ E_r &= \Set{(r_c, r_e) \in R_c \times \N | 0 < r_c < 1 \land 1 \le r_e \le \ln\bigg(\frac{r_c - 1}{2r_c} + \sqrt{\frac{(S_n - S_0)(r_c - 1)^2 + 4r_c}{4r_c^2(S_n - S_0)}}\bigg) \Bigg/ \ln\frac{1}{N_0 - 1}}\\ \end{split} \end{equation*}

Then the set of all valid re\large r_e can be redefined as:

E=E0∧E1∧Er\large E = E_0 \land E_1 \land E_r

So long as re\large r_e is in EE, that implies that rc\large r_c is in RcR_c! We’ve fully constrainted both rc\large r_c and re\large r_e. The scoring function S(p)S(p) can be varied for any valid inputs, and it will output a useful score that represents relative performance.

Thanks for reading my nerd post <3

tags: math