3 ms·
If you have to decode n+4, you know the result can’t be in S, as its elements are mapped to {1,…,n}. So, the result is in T. You subtract n, leaving 4, and use
by Someone 4y ago
If you have to decode n+4, you know the result can’t be in S, as its elements are mapped to {1,…,n}.
So, the result is in T. You subtract n, leaving 4, and use whatever bijection you had for T to decode that into an element of T.
If, on the other hand, you had n-4, you know it must decode to an element of S, and directly use its decoder to find that element.