77.4k views
4 votes
each of the pixels can take 1 of 16 gray levels ranging from 0(white) to 15(black). the rule is gray levels of two adjacent pixels cannot differ by more than one. how many of 256 possible assignments of gray levels to two adjacent satisfy this rule?

User Madiver
by
7.6k points

1 Answer

5 votes

Final answer:

The total number of assignments of gray levels to two adjacent pixels that satisfy the given rule is 30.

Step-by-step explanation:

The given problem states that each pixel can take 1 of 16 gray levels ranging from 0 (white) to 15 (black). The rule is that the gray levels of two adjacent pixels cannot differ by more than one. We need to find out how many of the 256 possible assignments of gray levels to two adjacents satisfy this rule.

To solve this problem, we can consider the four cases:

  1. When both pixels are white (gray level 0), only one assignment is possible: both pixels have to be white.
  2. When both pixels are black (gray level 15), only one assignment is possible: both pixels have to be black.
  3. When one pixel is white (gray level 0) and the other is black (gray level 15), only one assignment is possible: one pixel has to be white and the other has to be black.
  4. When the gray levels are different (ranging from 1 to 14), there are two possible assignments: one pixel can be the lower gray level and the other pixel can be the higher gray level, or vice versa.

Therefore, the total number of assignments that satisfy the given rule is 1 + 1 + 1 + (14 * 2) = 30.

User John Reynolds
by
7.5k points