Haskell help!

Weix, Rachel Lynn weixrl@uwec.edu
Tue, 25 Mar 2003 15:07:54 -0600


This is a multi-part message in MIME format.

------_=_NextPart_001_01C2F312.9A907270
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

I have since been able to figure out my problems - the algorithm for one =
of my methods was wrong and I found two "typos" so to speak.  I now need =
to figure out how to return all optimal solutions, and I have an idea as =
to how to start.  If I have any more problems I may send out another =
email.
=20
Rachel
P.S.  I need  to solve the problem using functional programming, thus I =
cannot use looping structures or mutation.

	-----Original Message-----=20
	From: Iavor S. Diatchki [mailto:diatchki@cse.ogi.edu]=20
	Sent: Tue 3/25/2003 2:45 PM=20
	To: Weix, Rachel Lynn=20
	Cc: haskell@haskell.org=20
	Subject: Re: Haskell help!
=09
=09

	hi,
=09
	i think you might find the following paper relevant:
	"Algebrainc Dynamic Prorgamming"
	by Robert Gigerich and Carsten Meyer
	=
http://link.springer-ny.com/link/service/series/0558/papers/2422/24220349=
.pdf
=09
	bye
	iavor
=09
	Weix, Rachel Lynn wrote:
	> Hi,
	>=20
	> I'm a college student trying to write a Haskell program, and I'm =
having
	> some problems getting the correct output.  I need to write a program
	> which will return a set of optimally aligned sequences, with =
"optimal"
	> being defined as such: mismatch or space (represented by a "-") =3D =
-1;
	> else 1 for every pair (see below for what a pair is)
	>=20
	> An example set of sequences with an alignment of -3 is as follows:
	>=20
	> sc-h-e-me
	> icecream-
	>=20
	> (s,i) are a pair, (c, c), etc.
	>=20
	> For right now, I'm only returning a potential solution (vs. a set of
	> solutions), and I'm having problems with any set of sequences that
	> aren't the same length.  My results are listed below.  I don't want =
to
	> include the code for now since it's about a page long (printed out) =
but
	> was hoping maybe someone had an idea as to why I'm getting such odd
	> results?  If code will help, I can exchange back and forth with =
whoever
	> thinks they might be able to help me out.  Your help is much
	> appreciated!
	>=20
	> Rachel
	>=20
	>=20
	> -- Each word/sequence you see has been predefined in my Haskell code
	> -- This first example appears to work just fine
	>=20
	> Main> printSeq icecream scheme
	>
	> ("icecream", "scheme--")
	>
	>=20
	>
	> Main> printSeq hate hatter
	>
	> ("hat-e", "hatte")
	>
	>
	>
	> Main> printSeq scheme saturn
	>
	> ("scheme", "saatur")
	>
	>
	>
	> Main> printSeq saturn scheme
	>
	> ("saaturn", "scheme-")
	>
	>
	>
	> Main> printSeq saturn hatter
	>
	> ("saaturn", "hatter-")
	>
	>
	>
	> Main> printSeq hatter saturn
	>
	> ("hatter", "saatur")
	>
	>
	>
	> Main> printSeq mad saturn
	>
	> ("mad", "saa")
	>
	>
	>
	> Main> printSeq hate hatter
	>
	> ("hat-e", "hatte")
	>
	>
	>
	> Main> printSeq snowball icecream
	>
	> ("snowb-all", "icecream-")
	>
	>
	>
	> Main> printSeq mad computer
	>
	> ("--mad", "compu")
	>
	>=20
	>
	> Main> printSeq mad snowball
	>
	> ("mad", "sno")
	>
	>
=09
=09
	--
	=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

	| Iavor S. Diatchki, Ph.D. student               |
	| Department of Computer Science and Engineering |
	| School of OGI at OHSU                          |
	| http://www.cse.ogi.edu/~diatchki               |
	=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

=09
=09


------_=_NextPart_001_01C2F312.9A907270
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dwindows-1252">=0A=
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">=0A=
<HTML>=0A=
<HEAD>=0A=
=0A=
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6249.1">=0A=
<TITLE>Re: Haskell help!</TITLE>=0A=
</HEAD>=0A=
<BODY dir=3Dltr>=0A=
<DIV>I have since been able to figure out my problems - the algorithm =
for one of =0A=
my methods was wrong and I found two "typos" so to speak.&nbsp; I now =
need to =0A=
figure out how to return all optimal solutions, and I have an idea as to =
how to =0A=
start.&nbsp; If I have any more problems I may send out another =
email.</DIV>=0A=
<DIV>&nbsp;</DIV>=0A=
<DIV>Rachel</DIV>=0A=
<DIV>P.S.&nbsp; I need&nbsp; to solve the problem using functional =
programming, =0A=
thus I cannot use looping structures or mutation.</DIV>=0A=
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">=0A=
  <DIV><FONT size=3D2>-----Original Message----- <BR><B>From:</B> Iavor =
S. =0A=
  Diatchki [mailto:diatchki@cse.ogi.edu] <BR><B>Sent:</B> Tue 3/25/2003 =
2:45 PM =0A=
  <BR><B>To:</B> Weix, Rachel Lynn <BR><B>Cc:</B> haskell@haskell.org =0A=
  <BR><B>Subject:</B> Re: Haskell help!<BR><BR></FONT></DIV>=0A=
  <P><FONT size=3D2>hi,<BR><BR>i think you might find the following =
paper =0A=
  relevant:<BR>"Algebrainc Dynamic Prorgamming"<BR>by Robert Gigerich =
and =0A=
  Carsten Meyer<BR><A =0A=
  =
href=3D"http://link.springer-ny.com/link/service/series/0558/papers/2422/=
24220349.pdf">http://link.springer-ny.com/link/service/series/0558/papers=
/2422/24220349.pdf</A><BR><BR>bye<BR>iavor<BR><BR>Weix, =0A=
  Rachel Lynn wrote:<BR>&gt; Hi,<BR>&gt;&nbsp;<BR>&gt; I'm a college =
student =0A=
  trying to write a Haskell program, and I'm having<BR>&gt; some =
problems =0A=
  getting the correct output.&nbsp; I need to write a program<BR>&gt; =
which will =0A=
  return a set of optimally aligned sequences, with "optimal"<BR>&gt; =
being =0A=
  defined as such: mismatch or space (represented by a "-") =3D =
-1;<BR>&gt; else 1 =0A=
  for every pair (see below for what a pair is)<BR>&gt;&nbsp;<BR>&gt; An =
example =0A=
  set of sequences with an alignment of -3 is as =
follows:<BR>&gt;&nbsp;<BR>&gt; =0A=
  sc-h-e-me<BR>&gt; icecream-<BR>&gt;&nbsp;<BR>&gt; (s,i) are a pair, =
(c, c), =0A=
  etc.<BR>&gt;&nbsp;<BR>&gt; For right now, I'm only returning a =
potential =0A=
  solution (vs. a set of<BR>&gt; solutions), and I'm having problems =
with any =0A=
  set of sequences that<BR>&gt; aren't the same length.&nbsp; My results =
are =0A=
  listed below.&nbsp; I don't want to<BR>&gt; include the code for now =
since =0A=
  it's about a page long (printed out) but<BR>&gt; was hoping maybe =
someone had =0A=
  an idea as to why I'm getting such odd<BR>&gt; results?&nbsp; If code =
will =0A=
  help, I can exchange back and forth with whoever<BR>&gt; thinks they =
might be =0A=
  able to help me out.&nbsp; Your help is much<BR>&gt; =0A=
  appreciated!<BR>&gt;&nbsp;<BR>&gt; =
Rachel<BR>&gt;&nbsp;<BR>&gt;&nbsp;<BR>&gt; =0A=
  -- Each word/sequence you see has been predefined in my Haskell =
code<BR>&gt; =0A=
  -- This first example appears to work just fine<BR>&gt;&nbsp;<BR>&gt; =
Main&gt; =0A=
  printSeq icecream scheme<BR>&gt;<BR>&gt; ("icecream", =0A=
  "scheme--")<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;<BR>&gt; Main&gt; printSeq =
hate =0A=
  hatter<BR>&gt;<BR>&gt; ("hat-e", =
"hatte")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; =0A=
  Main&gt; printSeq scheme saturn<BR>&gt;<BR>&gt; ("scheme", =0A=
  "saatur")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Main&gt; printSeq saturn =0A=
  scheme<BR>&gt;<BR>&gt; ("saaturn", =
"scheme-")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; =0A=
  Main&gt; printSeq saturn hatter<BR>&gt;<BR>&gt; ("saaturn", =0A=
  "hatter-")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Main&gt; printSeq hatter =0A=
  saturn<BR>&gt;<BR>&gt; ("hatter", =
"saatur")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; =0A=
  Main&gt; printSeq mad saturn<BR>&gt;<BR>&gt; ("mad", =0A=
  "saa")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Main&gt; printSeq hate =0A=
  hatter<BR>&gt;<BR>&gt; ("hat-e", =
"hatte")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; =0A=
  Main&gt; printSeq snowball icecream<BR>&gt;<BR>&gt; ("snowb-all", =0A=
  "icecream-")<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Main&gt; printSeq mad =0A=
  computer<BR>&gt;<BR>&gt; ("--mad", =0A=
  "compu")<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;<BR>&gt; Main&gt; printSeq mad =0A=
  snowball<BR>&gt;<BR>&gt; ("mad", =0A=
  =
"sno")<BR>&gt;<BR>&gt;<BR><BR><BR>--<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>| =0A=
  Iavor S. Diatchki, Ph.D. =0A=
  =
student&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; =0A=
  |<BR>| Department of Computer Science and Engineering |<BR>| School of =
OGI at =0A=
  =
OHSU&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; =0A=
  |<BR>| <A =0A=
  =
href=3D"http://www.cse.ogi.edu/~diatchki">http://www.cse.ogi.edu/~diatchk=
i</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; =0A=
  =
|<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<BR><BR></FONT></P></BLOCKQUOTE>=0A=
=0A=
</BODY>=0A=
</HTML>
------_=_NextPart_001_01C2F312.9A907270--