Help! (With CS Theory homework...)

Archive of the Sojourn3 General Discussion Forum.
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Help! (With CS Theory homework...)

Postby Sarvis » Tue Jan 29, 2002 4:07 pm

Our teachers, in their infinite wisdom, have decided that we shall not have help for our homework (which comprises 50% of our grade) after 6:30 the day before it is due. So I need yer help... *blush*

Ok, here are the questions and the answers I've attempted to make so far. I'm pretty sure they are wrong... correct answers and an explanation of how in the hell you get them would be much appreciated. Because I really have no idea... *sigh*

1) In each case, say what language is generated by the context-free grammar with the indicated productions.

e) S -> aS | bS | a
My Answer: (a*+b*)*a

f) S -> SS | bS | a
My Answer: (b*a*b*)^2 + b*a

2) Find the CFG's generating these languages:

b) {(a^i)(b^j)(c^k) | j = i + k}
My Answer: Bleh, just noticed I was trying to solve the wrong one. Will try this one... but probably can't do it either...

c) {(a^i)(b^j)(c^k) | i != j + k}

f) {(a^i)(b^j)(c^k) | i = j or i = k}

i) {(a^i)(b^j) | i < 2j }

3) In each case, show the grammar is ambiguous and find an equivalent unambigious grammar:

a) S -> SS | a | b

d) S -> aSb | aaSb | lambda

Ok... now I just gotta hope someone is on who is willing and able to answer these... heh. Of to beat my head against the wall some more in the meantime.

Sarvis
Gindipple
Sojourner
Posts: 676
Joined: Fri Jan 26, 2001 6:01 am
Location: O' Fallon, MO. USA
Contact:

Postby Gindipple » Tue Jan 29, 2002 4:23 pm

Ick!
That class was way too abstract for me.
Think I got a C- in it, or whatever it took to squeeze by in it.

Your best bet might be to find an IRC related channel. Since it sounds like you need help quickly.

Good Luck though.
Yayaril
Sojourner
Posts: 2552
Joined: Sun Feb 18, 2001 6:01 am
Location: Green Bay, WI

Postby Yayaril » Tue Jan 29, 2002 4:24 pm

You really should have posted this on the 'Will you do my homework for me?' section of the Sojourn3 bbs.


Yayaril
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Tue Jan 29, 2002 4:29 pm

Heh. I know the feeling Gind... but I'll be lucky to get a C at this rate. I don't have an irc client here either so that option's pretty much out. Just figured with all the good coders hanging around here I might stand a good chance.

Yayaril - Yep. Would have if that section existed... I really don't have many options right now since I can't obtain help anywhere else. Thanks to the teachers deciding it was more important to have us fail to do things on their timeschedule than for us to actually learn the material.

Sarvis
Mohis
Sojourner
Posts: 1
Joined: Tue Jan 29, 2002 6:01 am

Postby Mohis » Tue Jan 29, 2002 4:43 pm

1.e your answer seems correct to me, but can be simplified.
1.f consider S->SS->SSSS->SSSSSSSS->bSbSbSbSbSbSbSbS->babababababababa, which I dont think you're answer handles, and unless I've totally forgotten the notation abab fits your answer but cannot be generated by the given cfg. cfg's strings can start with a|b, but must end in a
cherzra
Sojourner
Posts: 1868
Joined: Fri Jan 26, 2001 6:01 am
Location: Holland

Postby cherzra » Tue Jan 29, 2002 5:02 pm

If you'd asked me this back when I was a senior, it would have been cake. Discrete mathematics was my favorite subject (me = Msc comp. science).

Now as a working man 3 years later, I removed all excess useless information from my brain. Sorry...
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Tue Jan 29, 2002 7:57 pm

Ok, I figured out answers for most of the questions (though they are probably wrong.) I still have no idea on 2f though. If anyone does let me know please... *beg*

Sarvis

[This message has been edited by Sarvis (edited 01-29-2002).]
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Tue Jan 29, 2002 8:35 pm

Hmmmmm, different than the CS Theory I learned, but most of that focused on Complexity and Number Theory, along with Discreet Algebraic Structures Image

Damned Turing Machines.

------------------
Elseenas of No House Worth Mentioning
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Tue Jan 29, 2002 8:37 pm

Actually, I think Turing Machines are in the next chapter...

You didn't learn context free grammars and crap? Damn... wish I'd gone where you went...
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Tue Jan 29, 2002 8:48 pm

Nope, didn't ever have to learn context free grammer Image

I did have to learn the basics of Turing Machines, but that was for my classes on AI and Algebraic Structures.

Don't wish too quickly, we call it the "Colorado School of Masochism" for a reason Image

(Besides, I am writing this from a Nonlinear Circuit Analysis lab and I'm a Math/CS Major!)
Gort
Sojourner
Posts: 919
Joined: Mon Jan 29, 2001 6:01 am
Location: Ft. Collins, CO

Postby Gort » Wed Jan 30, 2002 11:17 pm

" And they call it a Mine!..."

El, my cousin goes there, and my Uncle went there MANY years ago. You still in Colo? If so, there's a bunch of us here...


Toplack (livin in Ft. Fun) Frostbear
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Sun Feb 03, 2002 5:12 pm

I call it a death trap, but heh.

Yep, still here.

------------------
Elseenas of No House Worth Mentioning
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Sun Feb 03, 2002 5:13 pm

Not sure any of you would want to meet me though Image

------------------
Elseenas of No House Worth Mentioning
Karikhan
Sojourner
Posts: 471
Joined: Fri Mar 16, 2001 6:01 am

Postby Karikhan » Sun Feb 03, 2002 6:37 pm

O my friggin god thats homework?? for who!!!!
If my kids ever come to me with that I will just CRY!!!

and to think i used to be a math WHIZ!!! u know college level calculus in High school...

just DAMN

-Jen

[This message has been edited by Karikhan (edited 02-04-2002).]
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Sun Feb 03, 2002 9:04 pm

::comforts::

Heh, I used to think calculus was the end-all, be-all.

Then I learned that calculus is the microscopic particle at the tip of the iceberg.

------------------
Elseenas of No House Worth Mentioning
Gakka
Sojourner
Posts: 46
Joined: Sat Oct 27, 2001 5:01 am

Postby Gakka » Mon Feb 04, 2002 8:42 am

I can only plus and minus
Tanras
Sojourner
Posts: 219
Joined: Tue Feb 20, 2001 6:01 am

Postby Tanras » Mon Feb 04, 2002 5:04 pm

I don't have time to do all of these right now but the first one should be

(a + b)*a
Tanras
Sojourner
Posts: 219
Joined: Tue Feb 20, 2001 6:01 am

Postby Tanras » Mon Feb 04, 2002 5:11 pm

2nd is

(a+b)*(a+b)a
Tanras
Sojourner
Posts: 219
Joined: Tue Feb 20, 2001 6:01 am

Postby Tanras » Mon Feb 04, 2002 5:14 pm

if you want others i do dem tonight. Email me at magnich@stanford.edu
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Mon Feb 04, 2002 6:02 pm

:bonk Tanras: I needed you for that last week! :sniff: Although I think your answers are wrong. We went over them in class, and the answer to both of the first two is the same... heh.

So my point still stands. Image

Sarvis, just wants to graduate, get a job and stop being poor...
Karikhan
Sojourner
Posts: 471
Joined: Fri Mar 16, 2001 6:01 am

Postby Karikhan » Mon Feb 04, 2002 8:56 pm

I have to line people up and count toes ... damn that's a long line!
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Mon Feb 04, 2002 8:58 pm

Mathematicians Axiom:

The better you get at mathematics, the harder it gets to use actual numbers.

------------------
Elseenas of No House Worth Mentioning
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Tue Feb 05, 2002 1:28 am

Heh... I actually managed to explain an integral to my roommate last night. It took me half an hour, and most of my existing brainpower... but I got it right! Image

On a side note, it's interesting to note that while our professors consider this an important course for us to have, none of the professional programmers around sojourn could answer any of those questions.
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Wed Feb 06, 2002 10:07 pm

Sarvis:

Professors consider a great many things important that have absolutely no real world application, particularly for programmers.

On the other hand, they also do not emphasisize some things nearly enough.

CFG is only important if you are working in a field which uses it. Which anymore finding one is getting increasingly difficult.

*Please* though, for my sake and the sake of the programmers you will work with in the future, do the following:

1) Learn UML
2) Become at least vaguely familiar with asymptotic notation.

------------------
Elseenas of No House Worth Mentioning
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Thu Feb 07, 2002 12:35 am

UML: They are teaching UML in the beginning programming classes these days at my school. However I started a bit before that started, so don't know it yet... heh. Been meaning to learn it on my own, but not nearly enough time during the quarter... and no motivation during break. Image

Asymptotic Notation: err...? What?
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Thu Feb 07, 2002 12:49 am

Ok, so Asymptotic Notation is basically just another word for Big-O notation right? Or at least really really related to it?

Looked at a few websites, too much mathspeak for me... heh. But that's what I was able to come up with, and I did know about Big-O before... just don't use it all that much.
Tanras
Sojourner
Posts: 219
Joined: Tue Feb 20, 2001 6:01 am

Postby Tanras » Thu Feb 07, 2002 3:39 am

bleh yer right both are my 2nd answer:

(a+b)*(a+b)a
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Thu Feb 07, 2002 4:16 am

Sarvis:

Big O, Theta, and Omega notation Image

Mainly a personal peave of mine that so many so-called Computer "Scientists" don't understand even the most basic concepts behind algorithm complexity Image

------------------
Elseenas of No House Worth Mentioning
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Thu Feb 07, 2002 4:17 am

Example:

Someone I know was bubble sorting a linked list.

::sighs::

------------------
Elseenas of No House Worth Mentioning
Trogar
Sojourner
Posts: 138
Joined: Sun Mar 11, 2001 6:01 am

Postby Trogar » Thu Feb 07, 2002 3:36 pm

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR><font face="Verdana, Arial" size="2">Originally posted by Elseenas:
<B>Example:

Someone I know was bubble sorting a linked list.

::sighs::

</B></font><HR></BLOCKQUOTE>


Ever heard of StoogeSort? Its O(n^3). Now that's how you sort!

Trogar
Elseenas
Sojourner
Posts: 755
Joined: Thu Feb 01, 2001 6:01 am
Location: Golden, CO US

Postby Elseenas » Fri Feb 08, 2002 8:30 pm

Trogar:

AIEEEEEEEEE Image


------------------
Elseenas of No House Worth Mentioning

Return to “S3 General Discussion Archive”

Who is online

Users browsing this forum: No registered users and 31 guests