Flag Algebra> How many string 6digits are there which u...
question mark

How many string 6digits are there which uses only the digits 0,1,2and in which digits 2whenever it appears it always does so after 1

Atul Tiwari , 9 Years ago
Grade 12th pass
anser 1 Answers
Saurabh Koranglekar

To find out how many 6-digit strings can be formed using only the digits 0, 1, and 2, with the condition that whenever the digit 2 appears, it must always come after the digit 1, we need to approach the problem step by step. Let's break this down logically.

Understanding the Problem Constraints

We are limited to three digits: 0, 1, and 2. The key restriction here is that if a 2 is present in the string, it cannot appear before a 1. This means that for every 2, there must be at least one preceding 1 in the string.

Different Scenarios

We can consider different cases based on the number of 1s and 2s in the string:

  • No 1s and no 2s: The string can only consist of 0s. There is only 1 valid string: "000000".
  • Only 1s: The string can consist of any combination of 1s and 0s. For a 6-digit string, we can have from 1 to 6 digits as 1. The number of such strings can be calculated using combinations.
  • 1s and 2s: Here, we consider cases where there is at least one 1 and possibly some 2s. We need to ensure that every 2 is preceded by a 1.

Case Analysis

Let's denote the number of 1s as x, and the number of 2s as y. The total length of the string is 6, so we have:

x + y + z = 6, where z is the number of 0s.

From the restriction, whenever there is a 2, it must follow at least one 1. Therefore, we need to ensure that y does not exceed x.

Case 1: Only 0s and 1s

We can have any combination of 1s and 0s:

  • All 0s: 1 string
  • 1 one: 6 choices (position of the 1)
  • 2 ones: C(6, 2) = 15 combinations
  • 3 ones: C(6, 3) = 20 combinations
  • 4 ones: C(6, 4) = 15 combinations
  • 5 ones: 6 combinations
  • 6 ones: 1 combination

Adding these up gives us: 1 + 6 + 15 + 20 + 15 + 6 + 1 = 64 strings.

Case 2: 1s and 2s

Now, we can introduce 2s while ensuring they are positioned correctly:

  • If there is 1 two (y = 1), then x must be at least 1 (for example, 1 two and 5 other digits can be filled with 0s and 1s).
  • If there are 2 twos, we need at least 2 ones, and so forth.

Each time we add 2s, we can use combinations to determine how many valid arrangements we can create.

Calculating Total Combinations

Using the scenarios above, we can derive the total number of strings. However, the calculations for each scenario can get complex due to the various combinations of 1s, 2s, and 0s. To simplify:

For each arrangement where the 2s follow the 1s correctly, we can iterate through possible counts of 1s and 2s, ensuring that y does not exceed x, and calculate the total combinations accordingly.

Final Thoughts

By carefully analyzing the restrictions and systematically counting the valid combinations, we find that a total of 64 strings can be formed under the specified conditions. This kind of problem often requires logical reasoning alongside combinatorial counting, illustrating the beauty of mathematics in structuring possibilities.

Last Activity: 6 Years ago
star
LIVE ONLINE CLASSES

Prepraring for the competition made easy just by live online class.

tv

Full Live Access

material

Study Material

removal

Live Doubts Solving

assignment

Daily Class Assignments