Calculating Possible Sequences with Constraints

  • Thread starter Thread starter pennypenny
  • Start date Start date
AI Thread Summary
The discussion focuses on calculating the number of valid sequences of length N filled with the letters S, F, and T, under the constraint that F and T cannot be adjacent. For example, valid sequences for N=5 include FSSTT and SFSTT, while SFTFS is invalid. The approach suggested involves first determining the total permutations without constraints, then treating F and T as a single unit to account for their adjacency restriction. This method requires careful consideration to avoid double-counting sequences that include both F and T together. The goal is to derive a formula that accurately reflects the valid configurations while adhering to the given constraints.
pennypenny
Messages
2
Reaction score
0
Suppose there are N positions.

For each position, one can fill it with S,F or T.

There is one constraint that F and T cannot be next to each other. This means that a filling with FT in the sequence or TF in the sequence is not allowed.

For example, if N = 5. We have FSSTT, SFSTT are valid sequences, but SFTFS is not.

Can anyone help me with calculating the number of possible sequences?
 
Physics news on Phys.org
Here is a possible way to solve this:
For N=1, how many strings ending with S are possible?
For N=1, how many strings ending with F or T are possible?
For N=2, how many strings ending with S are possible, and how does that follow from the previous values?
For N=2, how many strings ending with F or T are possible, and how does that follow from the previous values?
...
 
Thank! This helps:)
 
Find total number of permutations first.
Now fix F and T together as 1 letter.Now total number of letters is 4 (in the case where N = 5).Find total number of cases for this (note that F and t can permute among themselves in 2 factorial ways so multiply your answer by 2) and subtract this from the total number of permutation you obtained the first case.
 
Can you show how you would do this in detail, to avoid double-counting of strings like TFSFT?
 
I was reading documentation about the soundness and completeness of logic formal systems. Consider the following $$\vdash_S \phi$$ where ##S## is the proof-system making part the formal system and ##\phi## is a wff (well formed formula) of the formal language. Note the blank on left of the turnstile symbol ##\vdash_S##, as far as I can tell it actually represents the empty set. So what does it mean ? I guess it actually means ##\phi## is a theorem of the formal system, i.e. there is a...

Similar threads

Replies
2
Views
2K
Replies
15
Views
2K
Replies
18
Views
3K
Replies
5
Views
2K
Replies
5
Views
1K
Replies
1
Views
1K
Back
Top