Sie sind auf Seite 1von 5

Diagonal Line Traversal Problem

Christopher Williamson 2013 March 12


The Diagonal Line Traversal Problem (DLT) starts by asking us to consider an n-dimensional rectangular prism as a subset of Rn , consisting of n-dimensional (hyper)-cubes, all of which have unit-length edges. For example, a hypercube may be given by this set: {(y1 , ..., yn ) | i [n], ai yi bi and ai + 1 = bi }, where the ai , bi are delimiting the range of the ith dimension. The side-lengths of the prism can be specied to us by a list of n numbers, x = x1 , x2 , x3 , ..., xn , where xi gives the side length of the prism in the ith dimension. For simplicity, we will say that the n-dimensional prism has one corner at the origin, meaning that the point on the prism furthest from the origin is at the point P = (x1 , ..., xn ). Now, consider a line L from O to P , perhaps dened by some parameterization. For our purposes, we will use the following parametrization, but it will become clear that any other parametrization with the same trace will suce. L : [0, 1] Rn L(t) = (tx1 , ..., txn ) We now consider this set: T = {hypercubes H | point p that lies on L and in the interior of H }, where, as usual, we dene the interior of a hypercube to be any point in the hypercube such that a neighborhood around that point is contained in the hypercube. Specically, this means that a point p is in the interior of a hypercube i p lies in the hypercube H and none of its components are integers. The goal is to nd a function f : x Nn N, where f gives |T |. Clearly, x completely determines the prism (and therefore L and each hypercube component of the prism), meaning that everything we need to know to determine |T | is contained in x. First, we need a few denitions. Denition 1. A k-edge point is a point p = (p1 , ..., pn ) in the interior of the prism such that k of its components pi are integers. A corner point is an edge point such that every component is an integer (an n-edge point). Note that the origin and the point (x1 , ..., xn ) are excluded from the denition. The reasons for this will soon become clearer, but the intuition is that these points tell us nothing about the number of hypercubes that the diagonal line will cross through. Remark 1. Clearly, we have Sn Sn1 ... S2 S1 , where Sk is the set of all k -edge points. Denition 2. We associate with every hypercube in the prism a number, called the cube value, where the cube value of a hypercube H (denoted cv (H )) is dened as: cv (H ) = i bi , recalling that bi is the upper bound of H in the ith dimension. This is a convenient way to give a name to a hypercube, especially since for any prism, line L, and hypercubes H , H in T , we have: cv (H ) = cv (H ) = H = H ,

for any H , H in T . This means that we can nd the size of T by nding the number of distinct values taken by cv (H ), for all H in T . Theorem 1. For any prism and associated line L, and any H , H in T , cv (H ) = cv (H ) = H = H . Proof. Suppose that H and H are distinct hypercubes in T that have the same cube value, and without loss of generality, say that L enters and exits H before H . Let t0 = sup{t | L(t) H }.Then for any t (t0 , 1], the hypercube H that L(t) is in must have at least one of its bi values greater than the corresponding bi value in H , and none of its bi values can be less. Thus, cv (H ) > cv (H ). Since H is traversed by L after H , taking H to be H completes the proof. We can now put some simple bounds on the possible values of cv (H ). The hypercube touching the origin has bi = 1 for all i, and thus has cube value n. Similarly, we have that the last hypercube crossed by L has cube value i xi . This gives us an upper bound on |T |, since we now know that T is given by the number of distinct cube values of hypercubes crossed by L. Clearly, if n cv (H )
i

xi ,

the number of possible cv (H ) values is given by the length of the list: n, n + 1, n + 2, ..., i xi , which is ( i xi ) (n 1). We will later see that this upper bound is the best possible one, in the sense that some prisms (precisely those where the components of x are pairwise relatively prime) yield a set T such that |T | = ( i xi ) (n 1). But for now, we need another denition and theorem so that we can get closer to nding |T | in gererality. Denition 3. Given a prism, we dene the cv-sequence to be the sequence of cv values such that the ith term in the sequence (denoted cvi ) equals cv (Hi ), where Hi is the ith hypercube traversed by L. Remark. We just showed that the longest possible cv -sequence has length ( know from before that |T | equals the length of the cv -sequence.
i

xi ) (n 1), and we

Theorem 2. There exists a one-to-one correspondence between each k -edge point that is not a (k + 1)edge point (thus in Sk \Sk+1 ) that lies in the trace of L and an index i in the cv -sequence such that cvi+1 cvi = k . Proof. Suppose that we have been following the parametrized line L and have stopped at a k -edge point p, located at L(t0 ). Suppose also that the last hypercube to have been added to T (named H ) has dimension boundaries given by ai and bi , as before. Then, we know that at least k of the components of p, named pi have a value that is equal to bj for some j . Suppose that we increase t0 by some small enough so that none of the components of p that were not an integer are not integer valued for any t [t0 , t0 + ). Then, L(t0 + ) is in the interior of a new hypercube (named H ) such that for exactly k values of i, the bi value for H is exactly one greater than the bi value for H . (Note that this statement fails if the origin and the end point are included in Denition 1.) So, if H is the j th hypercube that is crossed by L, we have cvj +1 = cvj + k . This shows that for every k -edge point, there exists such an index. Conversely, suppose that such an index i exists, but there is no associated k -edge point. Then, let t0 = sup{t | L(t) the ith hypercube crossed}. We must assume that there are not k components of L(t) that are integer valued, so take small enough so that for all L(t) for t (t0 , t0 + ), the only components to take integer values are those that already did at t0 . Then, the next hypercube traversed must have a cube value that is less than k greater than the previous one, a contradiction. We would now like to be able to determine the number of k -edge points that L contains. 2

Theorem 3. Let S be a subset of components of x, such that |S | = k . Then, the number of times that all of these components take integer values simultaneously is gcd(S ) 1. Proof. We need to nd the locations where all of the k chosen components of x are integers. Clearly, if we let q = gcd(S ), then we have found gcd(S ) 1 times t where L(t) is at a point where all of the q 1 2 chosen components are integer valued, namely 1 q , q ,..., q . Note that we dont let the numerator equal zero or q , since these points would correspond to the origin, and P . So, we know that each of these times is an occurance of a k -edge point, but are these all of them? To see that this is true, suppose that there existed another time value t, such that at that time, all of the selected components were integer valued. Clearly, t must be rational, so we set it to be a b , where a < b and gcd(a, b) = 1. Since a and b are coprime, we know that b must divide every element of S . This means that b < q and that there exists acxi an integer c such that bc = q = gcd(S ). This implies that for each component xi S , that gcd (S ) N. ac If gcd(S ) is a proper fraction, then ac is an integer less than q , which means that this value was already
q 1 2 ac in the list given above ( 1 q , q ,..., q ). Therefore, if we are to reach a contradiction, we must have q is improper, which implies that ac > q = ac > bc = a > b (c is positive), which is a contradiction. .

Lets now make the assumption that given a certain prism, there are no 2-edge points. This means that the components of x are pairwise relatively prime. Then, if there are no 2-edge points, then by Theorem 2, we know that the cv sequence always increases by 1, and thus takes ( i xi ) (n 1) many
n i

values. This means that in this case, f (x) =

xi

(n 1).

If there are no 3-edge points, but possibly 2-edge points, then we need to subtract one from the above formula for each occurance of a 2-edge point, by Theorem 2. So, the value for f when the prism has no
n

3-edge points is:


i

xi (n 1)
xi ,xj x,i=j

(gcd(xi , xj ) 1). Indeed, Theorem 2 directly implies that

every time we encounter a k -edge, we need to remove k 1 from the sum, which is why we removed 1 for every 2-edge. However, we cannot simply add 2 (gcd(xi , xj , xk ) 1)
xi ,xj ,xk x : i,j,k distinct

to the above formula

to account for cases when we have 3-edges, but no 4-edges. This is because every 3-edge gives rise to 3 2 sets of size 2 of components of x, all of which are also 2-edges and have already led to a subtraction in the previous term. This means that the actual coecient that we should use is not -2, but the value d3 , where d3 satisies: 2 = 3 2 + d3 . This ensures that each 3-edge has now contributed -2 to the sum that gives f , assuming that there are no 4-edges. If we let dk represent the coecient needed on the sum over sets of components of x of size k (so d2 = 1, then we can write the above equation like this: d2 3 2 + d3 = 2, which implies that d3 = 1. Before, we have assumed that there are no 3-edges and then assumed that there are no 4-edges. Clearly, if we extend that assumption to be that there are no (k + 1)-edge points, then we know that dk , the last coecient we must choose, must satisfy dk + d2 Therefore, we have: dk = (k 1) + d2 k k k + d3 + ... + dk1 2 3 k1 . k k k + d3 + ... + dk1 2 3 k1 = (k 1)

Also, note that d2 = 1 and d3 = 1. This might lead one to hypothesize that dk = (1)k+1 , which turns out to be correct. This will be proven in the Appendix. 3

Before, we have been considering f for when we assume that there are no k -edges for some k . Now, since the length of x is n, we know that there are no n + 1-edges, and can use the rules we just determined to write down the formula for f , in full generality:
n n

f (x) =
i

xi

(n 1) +
k=2

(1)k+1
S Ck

(gcd(S ) 1) ,

where Ck is the collection of all groups of size k of components of x. Note that this means that Ck may be a bag and not a set if there are are duplicate integers in x. In the Appendix, we will see that eliminating the -1 from the gcd of each set and eliminating the (n 1) term from the formula cancel, leaving us with:
n n

f (x) =
i

xi +
k=2

(1)k+1
S Ck

gcd(S ) .

If we take the gcd to be dened on one argument as gcd(x) = x, we can remove the rst term by pushing it into the second summation:
n

f (x) =
k=1

(1)k+1
S Ck

gcd(S ) .

Since we are looking at every subset of components of x, we can rewrite this again, to obtain the nal result of this paper (where |x| is the length of x, [n] = {1, ..., n} and x|S is a new vector containing only values xi for i S : f (x) = |T | = (1)|S |+1 gcd(x|S )
S P ([|x|])\

Appendix. We want to see that (n 1) = n n n n + + ... +1= 2 3 4 n1


n

(1)k+1
j =2

n . j

This will prove by induction that dn = 1 when n is odd. First, note that the last two terms of the right hand side equal the left hand side. Therefore, it is equivalent to show that 0=
n k n nk

n n n n + + ... + 2 3 4 n2

n2

=
j =2

(1)k+1

n j

Since = , the rst and last terms cancel, along with the second and second to last terms, until we reach the middle. Luckily, there are an even number of terms in the sum as n is odd. Therefore, every term has a partner that it will cancel with, conrming the identity for odd n. Now, we will prove the analgous statement for even n. n! First, we start with the following well-known identity: n k = k!(nk)! . This is arrived at simply by considering the number of orderings of n elements (which is n!), and then removing all duplicate orderings, rst when the chosen subset of k elements are in dierent orders but not the rest of the set, and then when the rest of the set are in dierent orders. Second, we can show using this rst result that n n n+1 k + k+1 = k+1 . Use the above result to modify the left side: n n + k k+1 = n! n! + k !(n k )! (k + 1)!(n k 1)! 4

= =

n!k !(n k )! n!(k + 1)!(n k 1)! + k !(n k )!(k + 1)!(n k 1)! k !(n k )!(k + 1)!(n k 1)! n+1 . k+1

n!k !(n k 1)!((k + 1) + (n k )) (n + 1)! = = k !(n k )!(k + 1)!(n k 1)! (k + 1)!(n k )!

Recall that the goal is to show that (n 1) = n n n n + + ... + 1= 2 3 4 n1


n

(1)k+1
j =2

n j

for even n . The right hand side can be transformed into the following, using the above proven fact that K k
n

+
n

K k+1

K +1 k+1 n1 n1 + j1 j

(1)k+1
j =2

n j

=
j =2

(1)k+1

(substitute with n = K + 1 ). By observing that this is a telescoping series, it is easy to see that all the terms in the summation cancel, with the exceptions of the rst part of the rst term (namely n1 1 ) and the last part of the last term (namely n , which equals zero by denition). Therefore, 1 n 1 1 the problem remaining is to see that (n 1) = n n . The second term is negative here 1 n because n is even, but this is unimportant as the second term equals zero. The proof is complete, since 1 n = (n 1). 1

Das könnte Ihnen auch gefallen