Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 27 Aug 2017 My Price 11.00

DNA strand

Problem 1

 

A DNA strand is represented by a string of the characters A, C, G, and T, each of which represents a nucleotide. The hamming distance between two DNA strands of the same length is equal to the number of positions in which they differ. Hamming distance is used in bioinformatics as a measure of the similarity of two strings. Write a DNA class that gets initialized with a string of nucleotide characters. An instance of DNA responds to the to_s, length,and hamming_distance messages. Where a and b are DNA instances of the same length, the message send a.hamming_distance(b) returns the hamming distance between a and b:

=> true

>> dna1 = DNA.new('ATTGCC')

=> ATTGCC

>> dna1.length

=> 6

>> puts dna1

ATTGCC

>> dna2 = DNA.new('GTTGAC')

=> GTTGAC

>> dna1.hamming_distance(dna2) => 2

>> dna1.hamming_distance(dna1)

=> 0

>> dna1.hamming_distance(DNA.new('AT')) ArgumentError: dnas of different lengths from ass2.rb:17:in `hamming_distance' from (irb):8

from C:/Ruby22/bin/irb:11:in ''

Answers

(5)
Status NEW Posted 27 Aug 2017 09:08 AM My Price 11.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)