Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi hdb,

My problem is similar to the following exercise given in the English Grammar book of primary school students. Construct all possible sentences from the given table using all blocks (4) and count total numbers of such sentences.

Here goes the Table with 4 blocks:

---------------------------------------- I | play | | at home. | You | donot play | soccer | at school.| We | | | | ---------------------------------------- Result: No. of possible sentences: 3X2x1x2=12 Sentences are: I play soccer at home. I play soccer at school. I donot play soccer at home. I donot play soccer at school. You play soccer at home. You play soccer at school. You donot play soccer at home. You donot play soccer at school. We play soccer at home. We play soccer at school. We donot play soccer at home. We donot play soccer at school.

I want all possible combinations of 10-letter from the string "ATATGCGCAT" without changing positions of letters in the actual string, where say A is of 3 levels, T at 2 levels, G at 2 levels and C at 1 level. By 3 levels of A I mean that A has A1,A2 & A3. Likewise, T1,T2 for T; G1,G2 for G and C1 for C. I want to use window size in the script to break a bigger string into smaller fragments & obtain all possible combinations for each fragment & then concatenate them. I hope this will help perl monks to understand my problem in a better way. I am sorry because I could not possibly present the problem nicely in the thread entitled "How can one get all possible combinations of a string without changing positions?" yesterday.


In reply to Re^2: How can one get all possible combinations of a string without changing positions & using window size? by supriyoch_2008
in thread How can one get all possible combinations of a string without changing positions & using window size? by supriyoch_2008

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found