A,B,C,D

Four boys A,B,C and D are standing in a row.If A is not at any of the ends.A and C are not consecutive to each other.Then in how many ways can they stand in a row if above conditions are followed?


The answer is 4.

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.

3 solutions

Ayush Verma
Jun 22, 2015

the ways are-CDAB,CBAD,DABC,BADC

Bill Bell
Apr 25, 2015

permutations is a generator; each time it is called it will return a new permutation of the sequence with which it was constructed. The for loop arranges to call this generator until it is exhausted. concatenated is the result of one iteration of the generator concatenated together to form a string; this is done to make for convenient processing in subsequent statements. The first if statement arranges to ignore a permutation if it begins or ends with 'A'. The second one ignores a permutation if it contains either 'AC' or 'CA'. If a permutation passes both tests then it is counted.

DIGITAL SOLUTION.

Siddharth Singh - 6 years, 1 month ago

Log in to reply

I'm sorry. What does your comment mean?

Bill Bell - 6 years, 1 month ago

Log in to reply

Sir, I mean that you have posted the solution in the form of a program which may be correct but since I don't know this programming language therefore I have not understood it :)

Siddharth Singh - 6 years, 1 month ago

Log in to reply

@Siddharth Singh I've added an explanation.

Bill Bell - 6 years, 1 month ago

Log in to reply

@Bill Bell Thanks for your explanation.

Siddharth Singh - 6 years, 1 month ago
Noel Lo
Apr 27, 2015

We can arrange either this way: _ A C or this way: C A__ where B and D are free to arrange themselves in the blank spaces. In each of the 2 cases, we have 2! = 2 ways. So the total is 2 × 2 = 4 2 \times 2=\boxed{4}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...