For x and y, we have σ1(x) ≤ K < σ2(x), σ 1 (x)K< σ 2 (x), σ 1 (y)K< σ 2 (y), and σ 1 (y)K σ 2 (y)If σ 2 (x)< σ 2 (y),then σ 2 (x) σ 2 (y). We thus have

C( σ 1 (x), σ 2 (x))=C( σ 1 (x), σ 2 (x))+ w σ 2 (x) ,(11.10)
C( σ 1 (y), σ 2 (y))=C( σ 1 (y), σ 2 (y)) w σ 2 (x) ,(11.11)

where W σ 2 (x) is the contribution of moving x from position σ2(x) to σ2(x) + 1 to the overall distance. Notice that w σ 2 (x) is also the contribution of moving y from position σ2(y) to σ2(y) – 1.

From formulas (11.10) and (11.11), we get

C( σ 1 (x), σ 2 (x))+C( σ 1 (y), σ 2 (y))=C( σ 1 (x), σ 2 (x))+C( σ 1 (y), σ 2 (y)).

Get Context-Aware Computing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.