Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a python program for given Algorithm: 1 . Every string of length 5 should have any duplicate 2 . Exactly one common alphabet between

Write a python program for given Algorithm:
1.Every string of length 5 should have any duplicate
2. Exactly one common alphabet between all the strings
For example I am providing here for length 3.
length three means we have three alphabet A, B, C
Possible sequences according to our algorithm is
Sequence1:A B C
Sequence 2:A D E
Sequence 3:A F G
Sequence 4:B D F
Sequence 5:B E G
Sequence 6:C D G
Sequence 7:C E F
Explanation: here in each sequence only one common element for example here in sequence 1 and sequence only one "A" common character. Similary if take any two sequences and perform intersection you will get only one common character. So if you take any sequence and perform intersection there will be maximum 1 common charcter.
Here with 3 alphabet total 7 possible combination , and 3 charcters means A can come maximum three time only. Similarly B and C can come three times only, and each combination there is only one common element , And in this suppose we interchanged C and D than possible sequences are:
A B D
A C E
A F G
B C F
B E G
D C G
D E F
YOUR TASK: To write a python program for length 3 and print all possible sequences and after interchanging values print also what are the sequences .
And than increase the length of character 5(A B C D E) and print all possible sequences based on algorithms . USE the character from A ... U.There should be only one character common in each sequence. So one character can come maximum five times.
NOTE: If program will not run in my system according my requiremnt i will not give positive feedback.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

25 Vba Macros For Data Analysis In Microsoft Excel

Authors: Klemens Nguyen

1st Edition

B0CNSXYMTC, 979-8868455629

More Books

Students also viewed these Databases questions

Question

=+6. What media are available to you?

Answered: 1 week ago