# Trainings

The table contains tennis training schedule for Saturday's younger students during the winter indoor season. Before the start of the summer season is preparing a new training schedule. Tomas Kucera will be able to practice only in the morning, sisters Kovacova will have to train in any order only one after one. Other students meet all times.

How many different schedules tennis training under these conditions can be created for these eight students?

```
9:00 to 9:55 Jana Abrahámová
10:00 to 10:55 Tomas Kucera
11:00 to 11:55 Beata Gross
12:00 to 12:55 Dana Ihringová
13:00 to 13:55 Ingrid Hájková
14:00 to 14:55 Katarina Kovacova
15:00 to 15:55 Zuzana Kovacova
16:00 to 16:55 Peter Valent
```

Result

x =  4080

#### Solution:

Program in PHP:
```for(\$a=1;\$a<=8;\$a++) {
for(\$b=1;\$b<=8;\$b++) {
for(\$c=1;\$c<=8;\$c++) {
for(\$d=1;\$d<=8;\$d++) {
for(\$e=1;\$e<=8;\$e++) {
for(\$f=1;\$f<=8 ;\$f++) {
for(\$g=1;\$g<=8;\$g++) {
for(\$h=1;\$h<=8;\$h++) {

if(\$a != 1 && \$b != 1 && \$c != 1)
{
continue;
}

if(\$a==2 && \$b!=3 || \$b==2 && \$c!=3
|| \$c==2 && \$d!=3 || \$d==2 && \$e!=3 ||
\$e==2 && \$f!=3 || \$f==2 && \$g!=3 ||
\$g==2 && \$h!=3)
{
continue;
}

\$aa = array(\$a, \$b, \$c, \$d, \$e, \$f, \$g, \$h);
if(count(\$aa) != count(array_unique(\$aa)))
{
continue;
}
\$cnt++;

}}}}}}}}
echo 'count of permutations: '.\$cnt;
```

Leave us a comment of example and its solution (i.e. if it is still somewhat unclear...):

Be the first to comment!

## Next similar examples:

1. Neighborhood
I have 7 cups: 1 2 3 4 5 6 7. How many opportunities of standings cups are there if 1 and 2 are always neighborhood?
2. Tokens
In the non-transparent bags are red, white, yellow, blue tokens. We 3times pull one tokens and again returned it, write down all possibilities.
3. Toys
3 children pulled 12 different toys from a box. Many ways can be divided toys so that each children had at least one toy?
4. PIN - codes
How many five-digit PIN - code can we create using the even numbers?
5. Variations
Determine the number of items when the count of variations of fourth class without repeating is 42 times larger than the count of variations of third class without repetition.
6. Medals
In how many ways can be divided gold, silver and bronze medal among 21 contestant?
7. Theorem prove
We want to prove the sentense: If the natural number n is divisible by six, then n is divisible by three. From what assumption we started?
8. Election 4
In a certain election there are 3 candidates for president 5 for secretory and 2 for tresurer. Find how many ways the election may (turn out/held).
9. Olympics metals
In how many ways can be win six athletes medal positions in the Olympics? Metal color matters.
10. Digits
How many natural numbers greater than 4000 which are formed from the numbers 0,1,3,7,9 with the figures not repeated, B) How many will the number of natural numbers less than 4000 and the numbers can be repeated?
11. 7 heroes
9 heroes galloping on 9 horses behind. How many ways can sort them behind?
12. Tricolors
From the colors - red, blue, green, black and white, create all possible tricolors.
13. Word MATEMATIKA
How many words can be created from the word MATEMATIKA by changing the order of the letters, regardless of whether or not the words are meaningful?
14. Numbers
How many different 7 digit natural numbers in which no digit is repeated, can be composed from digits 0,1,2,3,4,5,6?
15. Chess
How many ways can select 4 fields on classic chess board with 64 fields, so that fields don't has the same color?
16. Digits
How many five-digit numbers can be written from numbers 0.3,4, 5, 7 that is divided by 10 and if digits can be repeated.