IA inside a guild

Everybody knows that I love two things: IA and FAIRY TAIL Now, I will make a quiz involving them. AND THERE IS NO RELATIONSHIP BETWEEN BLUE PEGASUS!

The letters of IA is absolutely a subset of the letters of FAIRYTAIL. Now, I want you to count all the permutations of FAIRYTAIL with conditions:

  1. There will be no space
  2. The permutations of FAIRYTAIL mus consist of at least one of the word "IA". For example, FAIRYTAIL is not considered as the permutations since there is no "IA" whilst FIARYTAIL is considered as the permutations since there is the word "IA" in that permutations.


The answer is 37800.

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.

2 solutions

Brock Brown
Mar 3, 2015

Python:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from itertools import permutations as combos
found = set()
count = 0
for combo in combos('FAIRYTAIL'):
    test = ''.join(combo)
    if test not in found:
        found.add(test)
        if 'IA' in test:
            count += 1
print "Answer:", count

There are 5 unique letters: {F, R, Y, T, L} ; and two double letters {A. A. I. I}. We need to calculate all permutations where there will be at least 1 {IA} together, as a unit.

Let us bind the first A and first I together as IA, and that becomes an element. So, that makes it 7 unique elements: {F, R, Y, T, L, IA, A, I} => thus, a total of 8! ---(i)

But among these, there will be some, where the second {I, A} .. together as IA will appear.

This second IA, will be identical with the first IA.. and can switch positions... to appear as different permutations, but actually are not. The number of these permutations are : for these 6 elements: {F, R, Y, T, L, IA, IA} => thus, a total of 7!/2 [a double 'IA' as element] ---(ii)

These permutations are double counted in permutations of the 7 unique elements: {F, R, Y, T, L, IA, A, I}

So, we must subtract (ii) from the (i).

The result is: 8! - (7!/2) =(7!) ( 8 - 1/2 ) =(7!) (16 - 1) /2 =(7! )* 15/2 = 37800

Ananya Aaniya - 6 years, 2 months ago
Saya Suka
Apr 23, 2021

Answer
= (9 – 1)! – (9 – 2)!/2!
= 8! – 7!/2
= (15/2) × 7!
= 37800



0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...