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;

Solution in text x =







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

Showing 0 comments:
1st comment
Be the first to comment!
avatar




Would you like to compute count of combinations? See also our variations calculator. See also our permutations calculator.

Next similar examples:

  1. Pairs
    pair At the table sit 10 people, 5 on one side and 5 on the other side. Among them are 3 pairs. Every pair wants to sit opposite each other. How many ways can they sit?
  2. Raffle
    tombola_3 There are 200 draws in the raffle, but only 20 of them win. What is the probability of at least 4 winnings for a group of people who have bought 5 tickets together?
  3. Sum or product
    dice_6 What is the probability that two dice fall will have the sum 7 or product 12?
  4. Hockey players
    players After we cycle five hockey players sit down. What is the probability that the two best scorers of this crew will sit next to each other?
  5. Dices throws
    dices_4 What is the probability that the two throws of the dice: a) Six falls even once b) Six will fall at least once
  6. Lock
    combination-lock Combination lock will open when the right choice of 3 numbers (from 1 to 25 inclusive) is selected. A. How many different lock combinations are possible? B. Is he combination lock named appropriately?
  7. Word
    words What is the probability that a random word composed of chars H, T, M, A will be MATH?
  8. Cards
    cards_8 From a set of 32 cards we randomly pull out three cards. What is the probability that it will be seven king and ace?
  9. Word MATEMATIKA
    math_1 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?
  10. Combinations of sweaters
    sveter I have 4 sweaters two are white, 1 red and 1 green. How many ways can this done?
  11. Salami
    salama How many ways can we choose 5 pcs of salami, if we have 6 types of salami for 10 pieces and one type for 4 pieces?
  12. Three-digit numbers
    poker_hand_ranking How many three-digit numbers are from the numbers 0 2 4 6 8 (with/without repetition)?
  13. Vans
    shuttlevan In how many ways can 5 shuttle vans line up at the airport?
  14. Flags
    vlajka_cz How many different flags can be made from colors red, blue, green, white, yellow so that each flag consisted of three different colors?
  15. 7 heroes
    7statocnych 5 heroes galloping on 5 horses behind. How many ways can sort them behind?
  16. Rectangles
    rectangles How many rectangles with area 3002 cm2 whose sides is natural numbers are?
  17. Candy
    bulls How many ways can divide 16 identical candies to 4 children?