AllRounder.ai
Chapters in this course

Enrol to start learning

Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.

Enrol free

21.1.2. First Problem: Strings of Parentheses

  • This section

    Practice test

    11 questions on this section. Wrong answers show you what to read again.

    Sign up to take it
  • Whole chapter

    Revision test

    Mixed questions from across the chapter. Your answers get marked.

    Sign up to take it
  • Quick

    Flashcard drill

    2 cards from this lesson. Good the night before a test.

Try these first

  1. 1.

    List three valid strings of parentheses for n=2.

    Hint

    Think about how parentheses can be paired.

  2. 2.

    How many opening and closing parentheses does a valid string of length 4 have?

    Hint

    Consider the balance required.

  3. 3.

    What defines a valid string of parentheses?

    Hint

    Check if any opening is left unmatched.

  4. 4.

    How many valid configurations exist for n=3?

    • 3
    • 5
    • 7
    Hint

    Consider how parentheses can pair properly.

  5. 5.

    Calculate the total number of valid parentheses arrangements for n=5. Explain your steps.

    Hint

    Use the Catalan number formula appropriately.

  6. 6.

    Derive the reflection mapping for a bad sequence of n=4. Explore its implications.

    Hint

    Start at the first negative partial sum and trace the sequence.

Exercises

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

4 more questions available

Enrol free

Quiz

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

1 more question available

Enrol free

Challenge Problems

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting