For each pair of integers 1 ≤ x ≤ 5 , 1 ≤ y ≤ 5 , draw a line connecting ( 0 , 0 ) to ( x , y ) .
How many distinct lines do we obtain?
BONUS: Generalize for 1 ≤ x ≤ X and 1 ≤ y ≤ Y .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I think you meant [ 0 , 5 ] instead of ( 0 , 5 ) for your interval.
Log in to reply
Hmm, maybe? Can you explain for me why it would be one over the other?
Log in to reply
It looks like you fixed it, but the answer seems to include values with x = 5 or y = 5 .
Log in to reply
@Patrick Corn – It should be for all combinations of 0 ≤ x ≤ 5 and 0 ≤ y ≤ 5
This means there should be 36 combinations ( 0 , 0 ) , ( 0 , 1 ) , . . . , ( 1 , 0 ) , ( 1 , 1 ) , . . . , ( 5 , 4 ) , ( 5 , 5 )
Edit: I realised what you meant. I thought x ∈ ( a , b ) included a and b . I was wrong. Thanks for the pick-up!! I was thinking of x ∈ [ a , b ] . I find it hard to remember which is which, sometimes.
This is incorrect, because it doesn't count ( 0 , 0 ) while the problem explicitly states that it's counted.
Log in to reply
I believe it does. G C D ( 0 , 0 ) = 0 (from wolfram alpha)
∴ ∣ s g n ( G C D ( 0 , 0 ) − 1 ) ∣ = 1
Which adds to the number of unique angles
Log in to reply
In fact, your final formula doesn't even agree with the answer you put in. sgn ( ∣ g cd ( x , y ) − 1 ∣ ) is 1 for these pairs: ( 0 , 0 ) , ( 0 , 2 ) , ( 0 , 3 ) , ( 0 , 4 ) , ( 0 , 5 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 2 , 4 ) , ( 3 , 0 ) , ( 3 , 3 ) , ( 4 , 0 ) , ( 4 , 2 ) , ( 4 , 4 ) , ( 5 , 0 ) , ( 5 , 5 ) . There are 15 such pairs, so your formula would give 2 7 − 1 5 = 1 2 . Note that you're subtracting the pairs that have sgn ( ∣ g cd ( x , y ) − 1 ∣ ) = 1 , not adding them.
The number 27 is incorrect; the correct number is ( X + 1 ) ( Y + 1 ) + 1 = 3 7 . All possible pairs ( x , y ) are counted, and you subtract those with GCD not 1 from the summation; after that, you add 1 more for ( 0 , 0 ) because otherwise it would be subtracted.
Log in to reply
@Ivan Koswara – Hmm... So how would the formula be corrected?
Log in to reply
@Phillip Smith – 1 + x = 0 ∑ X y = 0 ∑ Y 1 { g cd ( x , y ) = 1 } ( x , y ) , where 1 A is the characteristic function on A . Basically all pairs with GCD 1, plus the ( 0 , 0 ) pair. Using sgn ( ∣ g cd ( x , y ) − 1 ∣ ) is very unclear.
Minor typo: 1 ≤ x ≤ 5 was typed twice.
Problem Loading...
Note Loading...
Set Loading...
The angle, or more simply, the gradient, can be expressed as y x .
Two lines are equal if they are formed from the points ( i , j ) , ( i ′ , j ′ ) where j ′ i ′ = j i . For example, the points ( 2 , 4 ) , ( 1 , 2 ) give us the same line \( y = 2x ).
Thus, to count the number of unique lines, we can simply find the cases where \( \gcd (i, j) = 1 \).
When x = 1 , there are 5 values of y where g cd ( i , j ) = 1 .
When x = 2 , there are 3 values of y where g cd ( i , j ) = 1 .
When x = 3 , there are 4 values of y where g cd ( i , j ) = 1 .
When x = 5 , there are 3 values of y where g cd ( i , j ) = 1 .
When x = 5 , there are 4 values of y where g cd ( i , j ) = 1 .
Thus, there are a total of 19 lines.