Al

10 Reputation

2 Badges

17 years, 363 days

MaplePrimes Activity


These are replies submitted by Al

Sorry for not being very clear.  The F values cannot succeed any later F or S values in the original list L=[S1, F1, F2, S2].  For example F1 can only exist in L[1] or L[2], F2 can only exist in L[2] and L[3] (as F2 cannot exist before F1 in the list) etc.   Therefore there exist 4 possible combinations:

[S1, F1, F2, S2], [F1, S1, F2, S2], [F1, F2, S1, S2], [F1, F2, S2, S1]

 

Sorry for not being very clear.  The F values cannot succeed any later F or S values in the original list L=[S1, F1, F2, S2].  For example F1 can only exist in L[1] or L[2], F2 can only exist in L[2] and L[3] (as F2 cannot exist before F1 in the list) etc.   Therefore there exist 4 possible combinations:

[S1, F1, F2, S2], [F1, S1, F2, S2], [F1, F2, S1, S2], [F1, F2, S2, S1]

 

Thanks for the answer.  The provided solution will only work if F1 is at the start of the list.  How would I go about writing code for F exisiting elsewhere.  For example:

S1, F1, F2, S2

There exist 4 possible combinations:

[S1, F1, F2, S2], [F1, S1, F2, S2], [F1, F2, S1, S2], [F1, F2, S2, S1],

Thanks in Advance.

Thanks for the answer.  The provided solution will only work if F1 is at the start of the list.  How would I go about writing code for F exisiting elsewhere.  For example:

S1, F1, F2, S2

There exist 4 possible combinations:

[S1, F1, F2, S2], [F1, S1, F2, S2], [F1, F2, S1, S2], [F1, F2, S2, S1],

Thanks in Advance.

Page 1 of 1