How many words of length n are there, if we have an alphabet of k distinct letters, but the words cannot contain any substring that is made of k consecutive distinct letters, i.e, no k-length substring that consists of the entire alphabet?

atgnybo4fq 2022-11-17 Answered
Counting words of length n from k-sized alphabet with no substring of k consecutive distinct letters
How many words of length n are there, if we have an alphabet of k distinct letters, but the words cannot contain any substring that is made of k consecutive distinct letters, i.e, no k-length substring that consists of the entire alphabet?
Other than that, no restrictions apply: any amount of distinct letters may be used throughout the entire word, and any letter can be used as many times as we like, as long as every substring inside the length n word complies with the rules above.
There is the obvious case of k = 2 which results in 2 words, for every n, because you can only start with either letter, and they alternate.
For the larger case, I have come up with a recursive formula:
C ( n , k ) = f ( 0 , 0 , k )
f ( i , d , k ) = { ( k d ) f ( i + 1 , d + 1 , k ) + c = 1 d f ( i + 1 , c , k ) i < n , d < k 1 i = n , d < k 0 i > n 0 d k
With d being the current length of consecutive distinct letters, and i the current word length.
At every step, we can either use a letter other than the previous d letters, in which case the length is increased by one, and the chain-length d of distinct consecutive letters is also increased by one. In this case, there are ( k d ) such letters we can use at the stage, each subsequently resulting in the same contribution.
Or, we can use a letter already in the last d letters. In this case, the position of the letter matters. If we use the last of the d letters, a whole new chain begins. If instead we use the second last d letter, then a chain of length 2 of consecutive distinct letters begins. The 3rd last would result in a chain of length 3 and so on.
I was wondering if there is a another way to count the amount of such words, perhaps using matrices or combinatorics?
You can still ask an expert for help

Want to know more about Discrete math?

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question

Answers (1)

Phiplyrhypelw0
Answered 2022-11-18 Author has 24 answers
If you want w v = r where w , v are irrational and r is rational, that must mean that w = r v (since v is irrational it isn't 0 so we don't have to worry about that)
So to find any pair you want just pick any arbitrary rational number (so long as it is not zero; as w 0 and v 0 then w v 0; but that is the only restriction; we can pick any other rational at all), and pick any arbitrary irrational v. Then let w = r v . As v is irrational and r is non-zero rational we will have w = r v be irrational.
And we have, voila w v = r v v = r.
Did you like this example?
Subscribe for all access

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

You might be interested in

asked 2021-08-18

Discrete Mathematics Basics

1) Find out if the relation R is transitive, symmetric, antisymmetric, or reflexive on the set of all web pages.where (a,b)R if and only if 
I)Web page a has been accessed by everyone who has also accessed Web page b.
II) Both Web page a and Web page b lack any shared links.
III) Web pages a and b both have at least one shared link.

asked 2020-11-09
Use proof by Contradiction to prove that the sum of an irrational number and a rational number is irrational.
asked 2021-08-15
How many elements are in the set { 0, { { 0 } }?
asked 2021-07-28

Let A, B, and C be sets. Show that (AB)C=(AC)(BC)
image

asked 2022-09-07
Binary strings and discrete math
Let S be the set of binary strings of length 30 with 10 1’s and 20 0’s. Let A be the set of the first 30 positive integers {1,2,3,…,30}. Let B be the set of all subsets of A containing 10 numbers. Find a one-to-one correspondence between S and B.
asked 2022-07-09
Formal proof that a is congruent to (a mod m) (mod m)
Intuitively it is quite easy to see why
a ( a mod m ) ( mod m ) .
When you divide a by m you get a remainder in the range 0 , , m 1.. When you divide the remainder by m again, you get the same number again as the remainder, except that this time the quotient is 0.
asked 2022-07-10
Big intersection operation
A B B A .
In each case, the proof is straightforward. For example, in the last case, we assume that every member of A is also a member of B. Hence if x B, i.e., if x belongs to every member of B, then a fortiori x belongs to every member of the smaller collection A. And consequently x A.
I wonder if the last part is really a proof. It is okay to assume x B and arrive at x A. But can I use this reasoning "then a fortiori x belongs to every member of the smaller collection" in a proof exercise? It looks like just using intuition (it does not seem rigorous).

New questions

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question