Prove that there exists a mapping
-
$\exists {m} \in M, \text{ such that } Increase(X) = Increase(D(X)) ; \text{for all } x \in X$ - The increase observed in the input and output must be equal
-
$\forall x \in X, \quad y = DS(x) \quad => y_1 = x_1 \quad and \quad y_m = x_n$ - The first and last values of the input must be preserved as-is in the output. This preserves reset points between blocks.
- Preserving in this case that all properties of the value is preserved, including if whether the datapoint is a reset (either via value or ST).
- authors note: this point here can be more rigourously defined but for the same of this exercise, we can take it mean that if
$x_{N}$ is a reset point in$x$ , it is also a reset point in$y$
- authors note: this point here can be more rigourously defined but for the same of this exercise, we can take it mean that if
func increase(x []datapoint) number {
var adjustment number
for i := 1; i < len(x); i++ {
if isReset(x[i-1], x[i]) {
adjustment += x[i-1].Value()
}
}
return x[len(x)-1].Value() - x[0].Value() + adjustment
}
Generally, if
(1)
- aka a cumulative rebuild where all resets in
$x$ have been adjusted for in$x\prime$
x= [1,2,1,3,1] => x'=[1,2,1+2,3+2,1+2+3]=[1,2,3,5,6]
(2)
- note: Importantly we avoid defining of what a reset here so we don't rely on numerical values of
$x$ in our analysis
For any
(3)
(4) Thus:
LHS:
RHS:
Let the
Obviously this preserves the
A variation of the base solution but the last element of
More generally for any
However this solution does not work for all
A simple proof by contradiction:
case 1:
thus LHS = RHS
case 2:
but
A simple real example of the case:
x = [4, 1, 2]
increase(x) = 2 - 4 + 4 = 2
downsampleKeepLast(x) = [4, 5, 2]
increase(downsampleKeepLast(x)) = 2 - 4 + 5 = 3
We can observe that in option 2 if
x = [4, 3, 2]
increase(x) = 2 - 4 + 4 + 3 = 5
downsampleKeepLast(x) = [4, 7, 2]
increase(downsampleKeepLast(x)) = 2 - 4 + 7 = 5
We can show that a generalized downsampler algorithm that rebuilds the input as a cumulative until the last reset will satifiy all constraints.
Let
The special case where the last reset is the last datapoint has been proven above.
Also trivial to prove we can extend M=4 to any arbitrary M>4 value i.e M = ~(number of frames + 2), as long as the last reset is preserved.