2. Non-Local Strings For this question, a block is a sequence of 20 characters, where each character...

50.1K

Verified Solution

Question

Basic Math

2. Non-Local Strings

For this question, a block is a sequence of 20characters, where each character is one of the 26 lowercase lettersa-z. For example, these are blocks:

iwpiybhunrplsovrowytrpulxfsqrixjhrtjmcrrfxfpwdhwgxtdaqtmxmlf
  1. How many different blocks are there?
  2. A block is squarefree if no character appears twotimes consecutively. The first and third example above aresquarefree, but the second example is not because of the twoconsecutive occurrences of r. How many squarefree blocks arethere?
  3. A block is non-local if the number of charactersbetween any two occurrences of the same character is at least 2.The first example above is non-local. The second example is not,because there are two occurrences of r with no characters betweenthem. The third example is not because there are two occurrences ofm with only one character between them. How many non-local blocksare there?
  4. A block is k-non-local if the number of charactersbetween any two occurrences of the same character is at least k.Write a formula for the number of k-non-local blocks that is validfor any k∈{0,…,20}.

Sanity check: The formula you get for 2.4 gives the answer to2.2 when k=1 and gives the answer to 2.3 when k=2.

Answer & Explanation Solved by verified expert
4.1 Ratings (553 Votes)
    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students