57.9k views
1 vote
HAS TO BE DONE BY TOMORROW - A positive integer is called snakelike if its digits alternately increase and decrease or vice versa. For example, 130 and 91727 are snakelike. However 123 is not snakelike (2 is greater than 1 but not 3) and 91727 is not snakelike (7 is greater than 1 but not 7) A) How many 4-digit snakelike numbers contain each of the digit 1,2,3,4 exactly once B) How many 3-Digit snakelike numbers have 6 as their middle digit C) a 7-digit snakelike number starts with digit 9. Explain why it last digit cannot be 0

HAS TO BE DONE BY TOMORROW - A positive integer is called snakelike if its digits-example-1
User Davidryan
by
5.0k points

1 Answer

5 votes

Answer:

A)

The simplest way to solve A is by checking 1st digit one-by-one.

selecting 1 as 1st digit, we have 2 ways

1324 and 1423

selecting 2 as 1st digit, we have 3 ways

2143, 2314, and 2413

selecting 3 as 1st digit, we have 3 ways

3142, 3241, and 3412

selecting 4 as 1st digit, we have 2 ways

4132 and 4231

=> 2 +3 + 3 + 2 = 10 ways in total.

B)

Use the same strategy as A)

selecting 1st digit that is greater than 6, there are 3 digits: {9, 8, 7}

selecting 9 as 1st digit => 967, 968

selecting 8 as 1st digit => 867, 869

selecting 7 as 1st digit => 768, 769

=> 3 x 2 = 6 ways

selecting 1st digit that is smaller than 6, there are 5 digits: {5, 4, 3, 2, 1}

selecting 5 as 1st digit => 565, 564, 563, 562, 561, 560

similarly, selecting 4, 3, 2, 1, there are 6 ways to select that last digit

=> 5 x 6 = 30 ways

=> 30 + 6 = 36 ways in total

C)

a 7-digit snakelike number starts with digit 9 (the largest digit)

=> 2nd digit is smaller than 9

=> 3rd digit is larger than 2nd digit

=> 4th digit is smaller than 3rd digit

=> 5th digit is larger than 4th digit

=> 6th digit is smaller than 5th digit

=> 7th digit is larger than 6th digit (this is impossible because 0 is smallest digit)

User Reznic
by
4.8k points