Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For my program, I have to match a nucleotide with it\'s complement (G -> C, C ->

ID: 3527624 • Letter: F

Question

For my program, I have to match a nucleotide with it's complement (G -> C, C -> G, A -> T, T -> A) in order to find the other half of the double helix. The general idea is that DNA is composed of 2 complementary helixes, each of which is a sequence of nucleotides. Currently, I am trying to compute the other half of the double helix. So far, I have represented the nucleotides with an enumeration and I've represented the DNA with a nucleotide list which corresponds to one helix. type nucleotide = | G | C | A | T type helix = nucleotide list let rec complementary_helix (x:helix): helix = | [G] -> [C] | [C] -> [G] | [A] -> [T] | [T] -> [A] end I know something is missing here, but I don't know how to go about it.

Explanation / Answer

Solution:-

Type nucleotide=| G
| C
| A
| T

type helix = nucleotide list
let rec complementary_helix (x:helix):
helix =
| [G] -> [C]
| [C] -> [G]
| [A] -> [T]
| [T] -> [A]