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. I now =
need to =0A=
figure out how to return all optimal solutions, and I have an idea as to =
how to =0A=
start. If I have any more problems I may send out another =
email.</DIV>=0A=
<DIV> </DIV>=0A=
<DIV>Rachel</DIV>=0A=
<DIV>P.S. I need 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>> Hi,<BR>> <BR>> I'm a college =
student =0A=
trying to write a Haskell program, and I'm having<BR>> some =
problems =0A=
getting the correct output. I need to write a program<BR>> =
which will =0A=
return a set of optimally aligned sequences, with "optimal"<BR>> =
being =0A=
defined as such: mismatch or space (represented by a "-") =3D =
-1;<BR>> else 1 =0A=
for every pair (see below for what a pair is)<BR>> <BR>> An =
example =0A=
set of sequences with an alignment of -3 is as =
follows:<BR>> <BR>> =0A=
sc-h-e-me<BR>> icecream-<BR>> <BR>> (s,i) are a pair, =
(c, c), =0A=
etc.<BR>> <BR>> For right now, I'm only returning a =
potential =0A=
solution (vs. a set of<BR>> solutions), and I'm having problems =
with any =0A=
set of sequences that<BR>> aren't the same length. My results =
are =0A=
listed below. I don't want to<BR>> include the code for now =
since =0A=
it's about a page long (printed out) but<BR>> was hoping maybe =
someone had =0A=
an idea as to why I'm getting such odd<BR>> results? If code =
will =0A=
help, I can exchange back and forth with whoever<BR>> thinks they =
might be =0A=
able to help me out. Your help is much<BR>> =0A=
appreciated!<BR>> <BR>> =
Rachel<BR>> <BR>> <BR>> =0A=
-- Each word/sequence you see has been predefined in my Haskell =
code<BR>> =0A=
-- This first example appears to work just fine<BR>> <BR>> =
Main> =0A=
printSeq icecream scheme<BR>><BR>> ("icecream", =0A=
"scheme--")<BR>><BR>> <BR>><BR>> Main> printSeq =
hate =0A=
hatter<BR>><BR>> ("hat-e", =
"hatte")<BR>><BR>><BR>><BR>> =0A=
Main> printSeq scheme saturn<BR>><BR>> ("scheme", =0A=
"saatur")<BR>><BR>><BR>><BR>> Main> printSeq saturn =0A=
scheme<BR>><BR>> ("saaturn", =
"scheme-")<BR>><BR>><BR>><BR>> =0A=
Main> printSeq saturn hatter<BR>><BR>> ("saaturn", =0A=
"hatter-")<BR>><BR>><BR>><BR>> Main> printSeq hatter =0A=
saturn<BR>><BR>> ("hatter", =
"saatur")<BR>><BR>><BR>><BR>> =0A=
Main> printSeq mad saturn<BR>><BR>> ("mad", =0A=
"saa")<BR>><BR>><BR>><BR>> Main> printSeq hate =0A=
hatter<BR>><BR>> ("hat-e", =
"hatte")<BR>><BR>><BR>><BR>> =0A=
Main> printSeq snowball icecream<BR>><BR>> ("snowb-all", =0A=
"icecream-")<BR>><BR>><BR>><BR>> Main> printSeq mad =0A=
computer<BR>><BR>> ("--mad", =0A=
"compu")<BR>><BR>> <BR>><BR>> Main> printSeq mad =0A=
snowball<BR>><BR>> ("mad", =0A=
=
"sno")<BR>><BR>><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 =
=0A=
|<BR>| Department of Computer Science and Engineering |<BR>| School of =
OGI at =0A=
=
OHSU &nb=
sp; &nbs=
p; =0A=
|<BR>| <A =0A=
=
href=3D"http://www.cse.ogi.edu/~diatchki">http://www.cse.ogi.edu/~diatchk=
i</A> &n=
bsp; =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--