My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Computer Science

Computer Science Computer Science is the scientific and practical approach to computation and its applications.


Reply
 
LinkBack Thread Tools Display Modes
February 6th, 2010, 04:33 AM   #1
 
Joined: Feb 2010
Posts: 1
genetic code

hi every one i need help about this question i have problem with output print can every one explan alittle about this and help me

1804. Genetic Code
Problem code: GENETIC


The connections between mathematics and biology are complicated. Most of the time they do not run along nice-looking links that merrily join at first glance, but they are abstract and not always easily established.

Lake Vostok - about 14000 square kilometers large, up to 650 meters deep, and covered by 3743 meters of ice - was recently discovered on the Antarctic continent. The lake remained under conditions of high pressure and no sunlight for several millions of years. It is believed that ordinary life has evolved to a more efficient form using a genetic code composed of only three bases (the current state of ignorance proclaims the four bases adenine, cytosine, guanine, and thymine). Until reasonable names are found, the three bases will be abbreviated as N, O, and P.

Moreover, the genome is single-stranded and directed, i.e., we may see it as a sequence over the alphabet {N,O,P}. Unless risking instability, it is necessary that the genome is a Thue-sequence, due to the Norwegian mathematician A. Thue (1863-1922). Define a subsegment of a sequence to be a connected subsequence, and call two subsegments adjacent if one follows immediately after the other in the sequence. A Thue-sequence is a sequence where no adjacent subsegments are equal. For example, NOPNO is and NOPNPNO is not a Thue-sequence, so that the first may be a genome whereas the second may not.

To be able to simulate experiments with the new genomes, you are asked to generate genomes of certain lengths.

Input Specification
The input contains several test cases. Each test case consists of an integer n. You may assume that 1<=n<=5000. The last test case is followed by a zero.

Output Specification
For each test case specified by n output on a single line any genome of length n. If no genome of length n exists, output a blank line instead.

Sample Input

1
2
10
20
0

Sample Output

N
NO
NONPNOPNPO
NONPNOPNPONOPNONPNOP
setayesh94 is offline  
 

My Computer Forum is free to register and we welcome everyone!

Reply

  My Computer Forum > Computer Science Forum > Computer Science

Tags
code, genetic



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple pari-GP code question billymac00 Programming 0 November 8th, 2013 05:32 AM
Javascript to CSS code bulf Tech Support 1 December 18th, 2011 02:42 PM
C code bummer greg1313 Programming 2 July 13th, 2010 03:11 PM
C++ program code, need help with this C++ application. chetanbhasin Programming 0 June 17th, 2010 07:57 PM
html code to display message when a webpage loads... chetanbhasin Programming 3 June 10th, 2010 05:43 AM





Copyright © 2017 My Computer Forum Forum. All rights reserved.