Quiz Space

Advanced Algorithms · Quiz 1 · 16 Jul 2023 · May 2023 term

Question 11: What is the value of f(6)?

Question 11

+4 marksNumerical answer

There is a row of n chairs and two types of people attending a party: C for chess players and S for comedians. You want to assign one person to each seat but you can never seat two chess players together or they will start talking about strategy and everyone else in the room will get bored. For example, if n = 3, the following are some valid seating arrangements: SSS, CSC, and SSC. However, the following is an invalid seating: CCS. Let f(n) denote the number of valid seating arrangements when n chairs are available.
Note that f(1) = 2, since both S and C count as valid seating arrangements; while f(2) = 3, since SS, SC, CS are valid seating arrangements but CC is not. Note that we do not need to count the arrangement SS more than once to account for the actual people seated swapping places, we are only interested in the “form” of the seating arrangement. Based on this, you can check that of the eight possible seating arrangements of three chairs, we have five that are valid: CSC, SSC, SSS, SCS, CSS, so f(3) = 5.
Based on the above data, answer the given subquestions.

What is the value of f(6)?

Show answer

Correct answer: 21

Question 11 of 16 in the IIT Madras BS Advanced Algorithms (Advanced Algorithms) Quiz 1 paper sat on 16 Jul 2023, in the May 2023 term (IIT M DEGREE AN2 EXAM QPE2 16 JULY 2023). It carries 4 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2A circuit in a matroid is a minimal dependent set. In other words, a subset S of the universe U is a circuit if S is no…
  3. Q3Consider the following set system:\ ● The universe is the set of edges of a graph G\ ● A subset S of U is an independen…
  4. Q4Suppose there are M mice out on a field and there are H holes scattered across the ground that the mice can hide in. Ea…
  5. Q5Let L be an array of n integers. Our array indices start from 0.\ Let maxSum[i] denote the largest contiguous sum possi…
  6. Q6Recall the task scheduling problem: suppose you have n tasks to complete in n days; each task requires your attention f…
  7. Q7We have a set of jobs to be performed, and we are given the following information about each job: a job ID, the duratio…
  8. Q8Consider the following tree: What is the size of the maximum-size independent set for this tree?
  9. Q9Consider the following instance of the stable matching problem. Suppose there are 3 women (A, B, C) and 3 men (X, Y, Z)…
  10. Q10Consider the following instance of the stable matching problem. Suppose there are 3 women (A, B, C) and 3 men (X, Y, Z)…
  11. Q12Which of the following is a valid recurrence for f(n)?
  12. Q13You have a collection of n elements with weights, which may be positive or negative numbers (but never zero). You want …
  13. Q14You have a collection of n elements with weights, which may be positive or negative numbers (but never zero). You want …
  14. Q15You have a collection of n elements with weights, which may be positive or negative numbers (but never zero). You want …
  15. Q16You have a collection of n elements with weights, which may be positive or negative numbers (but never zero). You want …