1. 0 and Infinity!!!


0 and Infinity!!! by gche043 (gche043) on August 9, 2003, 5:37 pm

For input file in question 1... how would i be able to tell between input for infinity(no arcs) and arcs with weight 0? or do we not have any arcs with weight zero?


Re: 0 and Infinity!!! by christian (celv004) on August 9, 2003, 7:22 pm

gche043 wrote:
  For input file in question 1... how would i be able to tell between input for infinity(no arcs) and arcs with weight 0? or do we not have any arcs with weight zero?


Yes I think we can assume that....




2. handling 1x1 matrices in Q1


handling 1x1 matrices in Q1 by frazzle (dazh001) on August 11, 2003, 1:01 am

Do you know whether we will have to handle 1x1 matrices in q1 as it would be a bit tricky distinguishing between order and the actual matrix itself




3. all pairs distance


all pairs distance by pump (jbai034) on August 10, 2003, 6:33 pm

in graph 2:
0 3 4
1 0 3
4 4 0

are they the shortest paths between each node?

if so, what is the value of K?




4. Problem about ASCII......


Problem about ASCII...... by zbao002 (zbao002) on August 10, 2003, 4:51 pm

When I copy the content of a txt file to another file, the output file is exactly same as the input file, that's fine...
But when I print the content of the original file onto the console, the output looks like this:

The content of the file is "asdf" and I found that the strange output is the ASCII code of "asdf"-_-'...

Anyone can tell me how to get the output which is same as the origin?
I'm using method to read from file.


by fever691 (yyan050) on August 10, 2003, 5:04 pm

have you tried reading your 105 notes? or try the api or other previous post


by zbao002 (zbao002) on August 10, 2003, 5:14 pm

fever691 wrote:
  have you tried reading your 105 notes? or try the api or other previous post


My stage I compsci courses were taken in Canterbury Uni, so...little bit different between Akl and Chch...

Any hints? Thanks...


by fever691 (yyan050) on August 10, 2003, 5:30 pm

zbao002 wrote:
  
My stage I compsci courses were taken in Canterbury Uni, so...little bit different between Akl and Chch...


the 101 and 105 notes are on the web, check under the courses page
or read Mark's class files, big hint there...or try the api...but yea I suggest the 105 notes :)




5. Input for Q1?


Input for Q1? by bugFull (myon002) on August 9, 2003, 4:41 pm

I am still confused about the input for Q1, does the user pass in a text file containing the weighted matrix for you to traverse through?

Or does the user enter the weight values another way?

ie. how does the user pass in his matrix into your program?


by knack (pduf006) on August 9, 2003, 5:17 pm

your program takes a filename as a parameter. in other words, args[0] will contain the name of the file which contains the matrices.




6. path of least uncertainty


path of least uncertainty by dyak001 (dyak001) on August 8, 2003, 6:29 pm

question:if I use Marks definition for least cost. Then the cost is always the amount I can extract from the situation no matter whether or not there is a the cost. So how do I know before I get whether or not I can afford it?I don't, so I may not get there, right.


Another way of looking: How do I know that I can always get there?
I only go if I'm willing to pay and it always cost the exact amount that I have.




7. Is Q1 to be tested with Graphs class files in same dir?


Is Q1 to be tested with Graphs class files in same dir? by Maximum Redg (rred015) on August 9, 2003, 6:24 pm

Hey all,,,


Just wondering are we expected to write the floyd.java file as a standalone program that doesnt implement any of the graphs classes from the handouts dir on mrks website?

Or will it be tested in the directory where these class files reside....

For instance, has anyone tried the Static method
public static int[] [] distanceMatrix(Graph G) @line 441 in GraphsAlgs.java?

When i call it, i get an ArrayIndexOut of bounds error within this file...

This is one reason why im wondering if we are expected to implement the graphs classes ourselves, and just use Mark's ones as a kickstart...


by Maximum Redg (rred015) on August 9, 2003, 8:07 pm

[quote:0081f57432]
5. The comment in the assignment that you should use the graph classes provided is a standard one I give every semester. Usually you really do need them, but this time the assignment is easier and you don't really need them. But feel free to steal pieces of code that may be helpful.



sorry, i just read it now :)


8. Running Q2 Soln with Q1 Code


Running Q2 Soln with Q1 Code by The Fri (gmar086) on August 7, 2003, 10:15 pm

Does this work for anyone? my solution to Q2 doesnt produce the desired output using the floyds algorithm I created using Q1, it produces a new matrix but one of the weights arent correct.

I thought floyds algorithm was ment to handle matries with negative arcs?

Cheers.


by fever691 (yyan050) on August 8, 2003, 1:12 pm

But the Floyd's algorithm finds the least cost from getting one node to another node. But the Dijkstra's algorithm finds the shortest path from a starting node to every other node.
but yea, read the course book, I don't think the two algorithm's are the same


by jwel027 (jwel027) on August 10, 2003, 10:11 pm

Floyds Algorithm does handle weights with negative arcs, the question is should we be examining the output from floyds algorithm under the conditions imposed by Dijkstra's? (did I spell that correctly?)




9. dijkstra's algorithm question


dijkstra's algorithm question by fever691 (yyan050) on August 8, 2003, 6:55 pm

I just want to make sure I heard right, but did Mark say that Dijkstra's algorithm can start at any node, and that even with negative weights Dijkstra's algorithm can still "sometimes" find the correct answer?


I think so by jsun027 (jsun027) on August 8, 2003, 8:53 pm

[I think]
When there are negative arcs, Dijkstra may or may not generate the correct answer. Our job is to find the smallest one that Dijkstra doesn't give the right answer....
[/I think]


Re: dijkstra's algorithm question by recah (ichi007) on August 9, 2003, 11:23 am

fever691 wrote:
  I just want to make sure I heard right, but did Mark say that Dijkstra's algorithm can start at any node, and that even with negative weights Dijkstra's algorithm can still "sometimes" find the correct answer?


yep u heard him right! Dijkstra's algorithm can sometimes find the correct path depending on the graph u have.




10. Q about Part2


Q about Part2 by mong (zmen001) on August 8, 2003, 7:01 pm

just want to know exactly wht format for part 2..
The sheet said we should use standard weighted adjacency matrix format..do we need to explain anything to the marker or just one matrix..that is it..also do we need to have our own UPI included????hurry up




11. the smallest example U can find!Q2


the smallest example U can find!Q2 by jkim126 (jkim126) on August 6, 2003, 5:30 pm

the smallest example U can find means what?


does it mean there is a smallest example or U can just create, imagine or

do any digraphs we think small?




12. A1 txt file 2 adjacent matrix


A1 txt file 2 adjacent matrix by skyblue (zwan033) on August 9, 2003, 3:43 pm

[size=18:8472471f4a] [color=red:8472471f4a]


by knack (pduf006) on August 9, 2003, 5:19 pm

[color=red:27e23f535a] [size=24:27e23f535a] use mike's graph files[/color:27e23f535a] [/size:27e23f535a]


by jimmy (syu034) on August 10, 2003, 1:47 pm

knack wrote:
  [color=red:7a5fb9f3e3] [size=24:7a5fb9f3e3] use mike's graph files[/color:7a5fb9f3e3] [/size:7a5fb9f3e3]

i am confused too


by david (jyue005) on August 10, 2003, 3:09 pm

In Mike's graph:

BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

where does the "System.in" come from?
If I have a "a.txt" file which contains the matrix, how could I read the content of the file?


by fever691 (yyan050) on August 10, 2003, 4:37 pm

you don't "have to" use Mark's graph classes. like he said, in one of his post. You can use his graph classes or jst simply do it yourself...if you've forgotten how to use arrays, go check out the 101 notes or the 105 notes for last semester


Re: A1 txt file 2 adjacent matrix by Bigbear (hyan052) on August 11, 2003, 2:42 pm

skyblue wrote:
  [size=18:43b5c846c8] [color=red:43b5c846c8]


Read the 105 note, I/O sections then I think u will get some ideas.

BTW, I didn't use the Java-Graph package to work out quesiton 1, but I think I got the right output


by cko011 (cko011) on August 11, 2003, 6:21 pm

man...we've really did learnt nothing on the Graph writing with java in lecture, how can guys generate code so fast? repeat?


but how 2 get WAM? by skyblue (zwan033) on August 12, 2003, 11:56 am

david wrote:
  In Mike's graph:

BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


[color=blue:51c1229a45]
I mean i want the weight adjaceny matrix,i can get the connective adjaceny matrix by using mike's GraphAdjMatrix class.


Re: but how 2 get WAM? by hrh (rhua009) on August 12, 2003, 12:26 pm

[/quote]
[color=blue:47f5adfc7c]
I mean i want the weight adjaceny matrix,i can get the connective adjaceny matrix by using mike's GraphAdjMatrix class.



So do u mean we can get the input in the form of a adjacency matrix by just using the GraphAdjMatrix class?
Do we need to get the input character by character and reconstruct it?
I'm really lost~~~
Please do help~~~
I'm still at the very very begining of Q1~~~


by cko011 (cko011) on August 12, 2003, 1:15 pm

anyone knows whetehr we can submit more than one java files or not? or just only the floyd.java? what if I have some abstract class file work with it?




13. red-black tree


red-black tree by dyak001 (dyak001) on August 8, 2003, 2:59 pm

is that hyphenated or not??




does it matter if the height of tree is the size of the Graph?


that last answer wasn't that enlightning but what do you mean
it has to maintain the DFS properties even if it's not a DFS




14. Can anyone help me for the Q1


Can anyone help me for the Q1 by sireesha (svar015) on August 9, 2003, 2:02 pm

Can anyone heilp me for the Q1



I retrieved the text file then what should i do
How the graphs in the website will be helpful to us


Re: Can anyone help me for the Q1 by christian (celv004) on August 9, 2003, 7:24 pm

sireesha wrote:
  Can anyone heilp me for the Q1



I retrieved the text file then what should i do
How the graphs in the website will be helpful to us


You don't need the graph files in from Mark's website. You should just apply Floyd's algorithm to the text you have retrieved.




15. dfs: when to time++ ?


by Jono (jteu004) on July 31, 2003, 2:51 pm

If you view it as we did it in tutorials, time is incremented in two places (for DFS):
1) When a node is put on the stack (like the pre-order)
2) When a node is removed from the stack (like the post-order)

You could also say that we do it once when we visit, and once more when we have finished with a node.

Jono.


dfs: when to time++ ? by knack (pduf006) on July 30, 2003, 12:40 am

hi all, this is a question about DFS (and BFS for that matter):

i am a little unclear on when exactly we should increment the 'time' variable.. it seems to be like whenever we visit a new node.. but not quite. If someone could enlighten me, that'd be peachy :)


by asheltie (ajoh064) on July 30, 2003, 12:13 pm

up to you i guess,

Mark has a global time++ counter so every node whether being visited or done has an incremented time on the last action.
but in the book they use 2 time++ inc's, one for the visted, one for the done time.

so going from node 1 -> 2 -> 3 and backup

the book: vT=1 -> vT=2 -> vT=3______backup______dT=1 -> dT=2 -> dT=3

Mark___: T=1 -> T=2 -> T=3______backup_______T=4 -> T=5 -> T=6

OTY - if not, can you let us all know Mark?




16. last reply


last reply by dyak001 (dyak001) on August 8, 2003, 3:01 pm

I meant preserve not maintain sorry, sillt no luck..




17. dijkstra and 24 hours


dijkstra and 24 hours by dyak001 (dyak001) on August 8, 2003, 9:51 pm

well I was trying to find out how long it would take for the earth to rotate

if dijkstra used his algorithm to locate a person anywhere on the globe. Whom would we start with and whom would we ask. How much mamory would it take if every person now and in the future was recorded in the database, assuming we knew the answer, only people were used and what would happen if each of them did not know their own name, except if it was told to them by someone else at the time we arrived at that particular person.


by asheltie (ajoh064) on August 9, 2003, 2:06 pm

it's a shame you're not edited by the moderator.
just because you use the name "Dijkstra" it seems to give you the right to chat about anything.

hmmmm......i had a chipmunk once, his name was Floyd, yeh, he was small and brown and ate a lot of chipmunk food. i wonder what Prim would say about Floyd eating alot of Chipmunk food. Probably, "Floyd eats alot of Chipmunk food".

see the relevance?

You see, Floyd, my Chipmunk did eat alot of Chipmunk food, but, and this is the complex part so try to keep up, Prim didn't know Floyd......HA...so how could he say that Floyd ate alot of Chipmunk food, hence find the shortest path in a weighted Chipmunk cycle.
What's a weighted Chipmunk cycle?

It's a bicycle built for Chipmunks, but thats's confusing becuase unlike the weighted cycles we are used to, this one doesn't have weights attached.


by gche043 (gche043) on August 9, 2003, 4:05 pm

haha... funny


$0.02 by aaa (aazz001) on August 11, 2003, 10:35 am

using dij's algo to calculate the minimum distance between humans, with the edges representing perhaps knowledge of the name the other humans "in the matrix" (!?) would require a matrix with an order of the # of ppl in the world..

pls consult your psychiatrist for further assistance with your problem.




18. TO those who've finished our 1st ass


TO those who've finished our 1st ass by jsun027 (jsun027) on August 8, 2003, 9:43 pm

Can any of you provide some inputs and their outputs, just to check my code works.
Would that be called cheating? I don't think so.




19. tickets


tickets by dyak001 (dyak001) on August 8, 2003, 8:52 pm

you're too late hun the tickets are now on their way, what a waiste.




you will not get another offer like that again!


next games not for another six months.....


by jsun027 (jsun027) on August 8, 2003, 9:24 pm

What's this about?




20. Q1 sample output


by knack (pduf006) on August 6, 2003, 12:39 pm

yeah.. in a weighted digraph's matrix, any zero not on the diagonal means there is no arc there - so the weight is +inf


Q1 sample output by fever691 (yyan050) on August 6, 2003, 11:28 am

Digraph 3: all-pairs matrix follows
0 1
+inf 0

just wondering is the +inf part of the matrix, so then if it is does that mean any zero except for the diagonal in the "all-pairs" matrix would have to be "+inf" ?


by fever691 (yyan050) on August 7, 2003, 12:01 pm

cko011 wrote:
  do u know which file is the sample output of Q1?


this is the sample output:

Digraph 1: negative weight cycle detected, aborting

Digraph 2: all-pairs matrix follows
0 3 4
1 0 3
4 4 0

Digraph 3: all-pairs matrix follows
0 1
+inf 0

you can find it in Mark's website in his "Handout" section for us


by cko011 (cko011) on August 7, 2003, 12:00 pm

do u know which file is the sample output of Q1?




21. computer..lab


computer..lab by dyak001 (dyak001) on August 6, 2003, 6:38 pm

is anyone able to use the java kit in the lab or has access to the network drive??/home directory//




22. Q2


Q2 by fshe010 (fshe010) on August 6, 2003, 10:58 am

so anyone know what's the standard output file of Q2?
is it only one matrix from the digraph that can show Dij algo doesn't work if negative arcs are allowed?


by fever691 (yyan050) on August 7, 2003, 1:36 pm

:P


by david (jyue005) on August 7, 2003, 1:08 pm

so, if I am lucky enough, then I could just guess one...
right? -_-;


by knack (pduf006) on August 7, 2003, 1:20 pm

haha yeah i spose, if you're that desperate

:P


by asheltie (ajoh064) on August 8, 2003, 10:21 am

ohhh,

that's why my prgram never stops running..........


by knack (pduf006) on August 8, 2003, 9:06 am

heh yeah i was real tired when i posted that
anyway you're supposed to replace all the zeros with +inf, except the ones on the diagonal. of course in your program, you represent +inf as some big big number, not actually "+inf"


by david (jyue005) on August 7, 2003, 1:32 pm

fever691 wrote:
   david wrote:
  so, if I am lucky enough, then I could just guess one...
right? -_-;


go to tutorials...might help...cos I jst clicked jst then too :D


I think I've already got the answer.
I'm just kidding. :P


by fever691 (yyan050) on August 7, 2003, 1:26 pm

david wrote:
  so, if I am lucky enough, then I could just guess one...
right? -_-;


go to tutorials...might help...cos I jst clicked jst then too :D


by david (jyue005) on August 7, 2003, 1:24 pm

I just feel a little bit unfair~~
anyway, I hope this could help someone.
:)


by fshe010 (fshe010) on August 6, 2003, 12:45 pm

ok.. i see.

the fisrt number 4 which means how big the matrix is,
but what the meaning of the last number 0


by knack (pduf006) on August 6, 2003, 12:41 pm

yeap. just a single weighted digraph's matrix - eg.
[code:1:d0b5005178] 4
0 3 4 1
-2 0 1 0
0 1 0 3
-1 0 4 0
0[/code:1:d0b5005178]

this is not the actual answer of course, i just made it up :P


by knack (pduf006) on August 7, 2003, 12:59 pm

no, just give the digraph which makes it not work


by david (jyue005) on August 7, 2003, 12:52 pm

For Q2, do we need to explain why Dijkstra's algorithm does not work?


by The Fri (gmar086) on August 6, 2003, 10:31 pm

I think the 0 refers to the next matrix, but since its of size 0, there is none


by knack (pduf006) on August 7, 2003, 5:50 am

yeah, the zero just marks the end of the file


by jsun027 (jsun027) on August 7, 2003, 8:23 pm

For Q2.
in Dijkstra algorithm, second part, the while loop, for each iteration,
it's looking for a vertex(in V(G) but not S) that is minimum distance to our
v.
[code:1:bc81869b12] find u (- V(G)\S so that dist[u] is minimum [/code:1:bc81869b12]

My questionn is, what if at this stage, there are two vertices that are with
the same dist, and this dist is the minimum, which one do we pick plz?


by jsun027 (jsun027) on August 7, 2003, 8:58 pm

[quote:8929afdf06]
knack
pduf006

Posted: Wed Aug 06, 2003 12:41 pm Post subject:

yeap. just a single weighted digraph's matrix - eg.
[code:1:8929afdf06]
4
0 3 4 1
-2 0 1 0
0 1 0 3
-1 0 4 0
0
[/code:1:8929afdf06]

this is not the actual answer of course, i just made it up :P



For our 220 ass01 Question 2, we are asked to submit in
"standard-weighted-adjacency-matrix-format". mark's example shown below:

4
0 7 1 0
7 0 0 3
1 4 0 6
0 1 2 0
8
0 1 0 0 0 0 0 32
1 0 1 0 0 0 0 0
0 8 0 1 0 0 0 0
0 0 2 0 3 0 0 0
0 0 0 1 0 14 0 0
0 17 0 0 1 0 1 0
0 0 0 0 0 16 0 1
110 0 0 0 0 0 1 0
3
0 0 0
2 0 2
0 1 0
0

I don't see any +inf in this format, does that say all the vertices are mutually reachable from one another? or we just substitute +inf(when there are no arcs) with 0s?

If we substitute +inf with a 0, Dijkstra algorithm takes in this standard-weighted-adjacency-matrix, when it comes to

"find u (- V(G) \ S so that dist[u] is minimum"

Wouldn't the algorithm mistake the 0 with an arc that carries 0 weight, but it actually means +inf(there is no arc).

and consequently when it comes down to

"dist[x] <- min{dist[x] , dist[u] + c[u,x] }"

it simply picks dist[u] =0 to update dist[x] , but in fact, dist[u] is +inf.
Then everything gets stuffed up.(woops...)... agree?
You see what I mean?
by knack (pduf006) on August 7, 2003, 9:04 pm

i know. but that's "standard weighted adjancy matrix" format. its pretty stupid i guess, but i dont much care anymore since i've submitted my assignment :P
i dont wanna think about this anymore


by jsun027 (jsun027) on August 7, 2003, 9:33 pm

come on mate! show some commitment! you've gotta make it perfect, simply because u want to, don't you?




23. ic red black?distance matrix


ic red black?distance matrix by dyak001 (dyak001) on August 5, 2003, 8:02 pm

does it make any differrence if there are two paths with the same total weights?


by knack (pduf006) on August 5, 2003, 10:53 pm

when? what context?




24. Ass01 Q01 negative weight cycle


Ass01 Q01 negative weight cycle by jsun027 (jsun027) on August 8, 2003, 12:11 pm

When we are detecting negative weighted cycle, which one do we play around with, the weighted adjacency matrix or the shortest distance matrix that would've been produced by our Floyd algorithm....or something else.


by asheltie (ajoh064) on August 8, 2003, 1:05 pm

at a guess....if you wait until you have the shortest distance matrix,

it's too late to detect the negative-weight cycle?

just a guess tho'
any1 else??


by jwel027 (jwel027) on August 8, 2003, 2:07 pm

can you ever get a non-zero entry on the diagonal?


by fever691 (yyan050) on August 8, 2003, 1:09 pm

I dunno if this helps but remember its a negative cycle if the total weight along the cycle is less than zero...


by asheltie (ajoh064) on August 8, 2003, 2:41 pm

yesss,

when you have a neg......*edited*


by jwel027 (jwel027) on August 8, 2003, 4:20 pm

sorry I asked.


by jsun027 (jsun027) on August 8, 2003, 7:53 pm

knack pduf006 <---
how did you detect the negative cycle please? not the answer, but some hints please?
all the folks haven done it.....please drop some hints here plz..~~


by knack (pduf006) on August 8, 2003, 8:22 pm

i think enough hints have been dropped in this thread already.. read a few posts up


by fez (jbro179) on August 9, 2003, 11:02 am

[quote:7ead10fc26] yesss,

when you have a neg......*edited*



How does that work? I thought a diagonal value meant the node had a loop onto itself, is that what the question means (q1) when it says "your program should be able to handle digraphs with and arcs"

?

by DannoNZ (dhaw022) on August 9, 2003, 4:06 pm

fez wrote:
  [quote:d39d1b6aec] yesss,

when you have a neg......*edited*


How does that work? I thought a diagonal value meant the node had a loop onto itself, is that what the question means (q1) when it says "your program should be able to handle digraphs with and arcs"

?



Yes but if that loop is negative, it's a negative-weight cycle...

by gche043 (gche043) on August 11, 2003, 11:17 am

dunno if this is gonna help but try running a matrix with negative weight cycle w\o checking it... look at the result and see if you can spot anything unusual


by jimmy (syu034) on August 12, 2003, 10:24 am

asheltie wrote:
  at a guess....if you wait until you have the shortest distance matrix,

it's too late to detect the negative-weight cycle?

just a guess tho'
any1 else??

how to detect the negative-weight cycle,(a cycle with total negative weight)?we need check triangles for each matrix ....
plz help




25. Q1 Timing Code


Q1 Timing Code by The Fri (gmar086) on August 7, 2003, 8:27 pm

Could someone please post the code to measure the time it takes for a section of code to run? I cant remember since I did 105 like 2 years ago.

Thanks


by drflower (dflo006) on August 7, 2003, 8:34 pm

Very simple...

[code:1:0d203d8ff5] long startTime = System.currentTimeMillis();
// do some stuff, call methods, whatever
long endTime = System.currentTimeMillis() - startTime;
[/code:1:0d203d8ff5]

System.currentTimeMillis() gets the number of milliseconds since Midnight (is it midnight ? or this year ? something like that...)




26. red and black treee


red and black treee by dyak001 (dyak001) on August 7, 2003, 8:17 pm

did I happen to mention how pleasing it was to see Mark in such fine spirits today during the lecture after tuesday. Obviously having a better day!

I still haven't heard if anyone has the notes for the last part of the lecture,so I thought I'd just post another happy forum message for all of us to reply to me!!



thank you for that! that was reaaaally great!!




27. Important clarification for assignment 1 Q1


by fshe010 (fshe010) on August 6, 2003, 10:56 am

so what u mean is in the input file you will use 0 to replace all infinite distance..is it?


one more question for the output file, u said we can use +inf to represent infinite in the output file ..so can i use . do that which u said in the lecture? i think output will be more tidey if use . than +inf


Important clarification for assignment 1 Q1 by Mark Wilson (mwil211) on August 5, 2003, 9:34 am

For Q1 (Floyd), we need to clarify the input format (weighted adjacency matrix). It is difficult to represent infinity, so I am using 0 in the (i,j) position to mean there is no arc from node i to node j. You can also interpret it to mean that there is an arc of weight zero, BUT this is not how I want to do it. That would give incorrect answers.

Q1 wants you to output the matrix d that contains in the (i, j) position the minimum weight of a path from i to j. The only possible area of confusion now is the diagonal: what should the (i,i) position be? The answer is it should be 0 for all nodes i. This is because a path can have no arcs and only one node (the empty path has weight zero). Of course if we had a loop of negative weight at a node, Floyd's algorithm would not yield zero for d(i, i), but in this case you are supposed to detect the fact and terminate with an error message.

If you end up not having any path from i to j then you are supposed to write out "+inf" to your output.

Here is a hint for how to avoid infinity. Compute the sum M of all the positive weights in the input matrix. No path can have length more than this, so we could use M+1 instead of infinity from the beginning.

Someone please remind me of this in lecture.




28. non negative path weights infinite distance matrixes and sus


by asheltie (ajoh064) on August 5, 2003, 4:44 pm

[quote:317d277d6f] I know, how can we possibly move from any relative position where there is only one path with less than a cost than not moving doesn't make sense!!The cost of not implementing the move becomes infinitely large so the distance from a node to itself becomes nonsensical in terms of ... big O notation ...



what has negative weights got to do with big-O?

by fshe010 (fshe010) on August 6, 2003, 10:51 am

i thinks Q2 which ask us to find the smallest example of digraph that show Dij algo doesnot work if negative weight arcs are allowed.


non negative path weights infinite distance matrixes and sus by dyak001 (dyak001) on August 5, 2003, 4:25 pm

does anyone know why dijkstra only likes non-negative path weights. Mathematically it does seem reasonable to have non-negative path weights and negative path weights for a MST, however what interpretation do we apply to graph G with n nodes where n is a finite non emty set(i.e. n >0) and a set of edges E with a finite set which is possibly empty, however in the case of a minimumset of a single node and a single path with a negative number, why does Dijkstra not indulge(in negative values)what interpretation do we apply to a minimum spanning tree with a negative minimum weight? if the cost is less that zero do we get an infinite loop? or in the case of there being a substantial tree do we get subtrees(subsystems) with weak components and ambiguous meanings for string selections. I don't see the difference for acceptance states and start states with no closure(not really sure about closure when acceptance states and start states are the same??no real possibility for subsets I guess?? ) it does indeed seem ambiguous!! I know, how can we possibly move from any relative position where there is only one path with less than a cost than not moving doesn't make sense!!The cost of not implementing the move becomes infinitely large so the distance from a node to itself becomes nonsensical in terms of ... big O notation ...


by knack (pduf006) on August 5, 2003, 10:46 pm

well, first of all dyak001.. a few newline characters never hurt anyone :P makes your post so much easier to read

now, onto your question
i cannot really tell you the answer, because then i would be telling you the answer to that assignment question.. but i'll try to explain without specifics.
[list:b23eba6acf]
[*:b23eba6acf] it is perfectly mathematically allowable to have negative weights. dijstra's algo *sometimes* fails on a graph with negative weights because of the way it works. it is a flaw in the algo.

[*:b23eba6acf] in the assignment, you are not allowed to use loops with total negative weight. i assume this is cos they are too easy - run dijkstra's algo on a graph with one and watch it break.

[*:b23eba6acf] you have to find another example of a graph that causes dijkstra's algo to return the wrong value. an example using the smallest graph possible gets you more marks.

[*:b23eba6acf] it has nothing to do with big-O..
[/list:u:b23eba6acf]




29. can anyone help me regarding this Q2


by pump (jbai034) on August 7, 2003, 3:05 pm

sireesha wrote:
  The question is saying that we should not have any -ve weight cycles
but from node2 to node1 is -1

so,that is an -ve weight cycle,isn't it

cheers


i just believe it should be a negative weighted cycle with fewest nodes/edges.


by sireesha (svar015) on August 7, 2003, 2:57 pm

The question is saying that we should not have any -ve weight cycles
but from node2 to node1 is -1

so,that is an -ve weight cycle,isn't it

cheers


by pump (jbai034) on August 7, 2003, 1:57 pm

"should have no negative weighted cycle"

as far as i know :
"should have done sth" means sth you should do but u didnot.

so:

"should have no negative weighted cycle" means there should be no
negative weighted cycle(according to Dijkstra's algo),but (in your answer) there are.It just gives a digraph which doesnot comply to the algo

is it correct?


by knack (pduf006) on August 7, 2003, 1:01 pm

"no negative weight cycles" means the digraph should have "no negative weight cycles"..


by ppflare (jlee210) on August 7, 2003, 2:04 pm

-___-

it states that there should be no cycle(s), so whether you have a cycle in your graph or not doesn't matter, but if you decide to put in a cycle in your graph it shouldn't be negative.


by pump (jbai034) on August 7, 2003, 2:11 pm

go to check your assignment sheet

"should done" doesnot mean "should do"



the former one done
but latter one done

is it, Mark?


by knack (pduf006) on August 7, 2003, 12:06 pm

i will try to un-confusion you :)

Dijkstra's algorithm sometimes doesn't work if the digraph has -tive wieghts.

An easy example of this is if the digraph has a negative weight - that is, it is possible to take a route starting at one node, take off around the graph, come back to the node you started at, and have the total cost less than zero.

Here's an example:[code:1:ef3209e92b]
node0----- 3 ---->node1---- 2 ------>node2
<------------------ -6 -----------/[/code:1:ef3209e92b]
here you can go node0->node1->node2->node0 for total cost -1

If you run the algo on this graph, it looks at node0 first, decides that the lowest cost route from node0 to node0 is 0, and adds node0 to the 'seen' list. this means that when it gets to node2, it doesnt update node0's distance because node0 has been 'seen'.

now, because that's so easy (!), you're not allowed to use it in the assignment question. you have to find a graph which does NOT have a negative weight cycle, only negative wieghts, but still causes Dijkstra's algo to fail (give the wrong answer)

oh and the smaller the example, the more marks you get
and of course smaller means less nodes/edges

hth!


by The Fri (gmar086) on August 7, 2003, 12:27 pm

no negative weight cycles you say?

does that mean the di-graph has to have a cycle or not?


can anyone help me regarding this Q2 by sireesha (svar015) on August 7, 2003, 11:36 am

can anyone help me regarding this Q2


It states Dijkstra algorithm does not work if -ve weight arcs are allowed
so,the above statement is easy to understand but the other one which is saying Your weighted digraph should have no negative weight cycles
but this statement makes me little bit confusion

thanx


by sireesha (svar015) on August 7, 2003, 4:13 pm

but the Question is saying we should n't have any -ve weighted cycle


cheers




30. two questions


by knack (pduf006) on August 6, 2003, 12:37 pm

yeah okay, i don't see why not..
i'll upload them when i get home - 8pm ish


by fever691 (yyan050) on August 6, 2003, 9:09 am

knack wrote:
  i *am* using mark's graph files, but he didnt provide an implementation of Floyd's algorithm to copy :P


so i guess that means that we can submit more than the three files that were stated in the assignment handout sheet then...


by knack (pduf006) on August 6, 2003, 9:42 am

hmm.. good point. i suppose maybe its assumed that the markers have Mark's files.. i doubt they'd make us upload them if we hadn't changed them..


by knack (pduf006) on August 5, 2003, 10:08 am

well i managed to generate some random weighted graphs - each cell has probability 50% for a 0, 50% for a random weight 0-50. so here's some benchmarks for q1 :)
[code:1:539b5baafa] matrix size time
50x50 0ms
100x100 16ms
500x500 906ms
1000x1000 6877ms[/code:1:539b5baafa]
these were performed on one of the UGL machines, the ones with cdwriters.

i've cut my times in half since i started optimising, and i've got another big optimisation in mind, i just have to make sure it won't break the algo :)


by asheltie (ajoh064) on August 5, 2003, 10:06 am

I think Questiion 1 is not going to be any different than any one else's implementation of Floyds Algo.
But there are so many ways of implementing the last one, I just wanted to know how well I was doing.
I spent 3 hours reading the provided class files, ditched them and spent 2 hours doing Question 3 on my own. If i created a slow implemtation I would like to know so I can revise/improve/go back to the provided class files. I'm just concerned that the recursion could be sped up with iterations on the large graphs.

I created a MatrixMaker class that makes......matrices

how's yours going?


by fever691 (yyan050) on August 6, 2003, 9:57 am

Knack would you be able to provide some of those "random matrix" that you got, for us to use?


by knack (pduf006) on August 5, 2003, 9:35 am

re: benchmarks
ummm question3 just requires output, do you mean question 1? and if so, how did you generate those huge weighted graphs? i've been benchmarking just by repeatedly processing the same graph


by fever691 (yyan050) on August 5, 2003, 2:46 pm

I was just wondering whether anyone's used Mark's graph class files......


by asheltie (ajoh064) on August 5, 2003, 10:34 am

nice,
if it includes the printout, and it looks like it does here's a massive time improver.

create a StringBuffer()
for every System.out.println(.....
replace it with buffer.append(....

don't forget to add ......+ "\n") at the end of your strings

finally, do just 1 of these at the end of the program

System.out.println(buffer.toString());

for me it knocked down times of 400m/s to 10 m/s


by knack (pduf006) on August 5, 2003, 7:14 pm

it *doesnt* include printouts :P [edit] remember Floyd's algo is O(n^3) [/edit]
but thanks for the tip :)

i *am* using mark's graph files, but he didnt provide an implementation of Floyd's algorithm to copy :P


two questions by asheltie (ajoh064) on August 4, 2003, 1:31 pm

Mark?
would you be willing to revise or accept a slight deviation on a [size=9:5ba63f09d3] small [/size:5ba63f09d3] question3 requirement.
The requirement states that the nodes and their visited status are to be output *before* a call to DFSv. This means the output never contains nodes that are grey (visited but not finished). If we output the visited status just inside the DFSv (after the colourising), we produce a clearer picture of the same requirement you want in your original question, it's a better picture for debugging at the least. just a thought.

My 2nd question is for any1,
what times are people getting for Question 3.
Some benchmark to see if we are producing productive DFS's would be nice. here's a few to start the ball rolling:

[code:1:5ba63f09d3]
matrix size 20 50 100 1000

DFS w/o output 0ms 0ms 0ms 40ms

DFS w/output 20ms 40ms 90ms 4500ms

[/code:1:5ba63f09d3] [size=18:5ba63f09d3] [/size:5ba63f09d3]




31. Q2 input format


by ppflare (jlee210) on August 7, 2003, 2:06 pm

didn't he say that we could use the maximum weight in the graph + 1 to indicate infinity?


by knack (pduf006) on August 7, 2003, 12:07 pm

smallest value of numberofnodes+numberofedges


Re: Q2 input format by christian (celv004) on August 7, 2003, 11:50 am

chsi021 wrote:
  I am aware that Mark has said he would use "0" instead of "+inf" for Q1 as the input for weighted adjecency matrix.

So wat about Q2?? would using "+inf" be ok? or it has to be "0"

Or doesn't really matter?


I wonder about this too....if we use 0, then what if one of the arcs have cost 0 - will that be interpreted as infinity then?

Christian


by fever691 (yyan050) on August 7, 2003, 12:04 pm

this might be a dumb question, but I gotta ask :P
does "smallest example" mean a example with the least number of nodes or a example with the smallest weight? or both?


by fever691 (yyan050) on August 7, 2003, 2:10 pm

ppflare wrote:
  didn't he say that we could use the maximum weight in the graph + 1 to indicate infinity?


isn't that for question 1?


Q2 input format by chsi021 (chsi021) on August 6, 2003, 8:50 pm

I am aware that Mark has said he would use "0" instead of "+inf" for Q1 as the input for weighted adjecency matrix.

So wat about Q2?? would using "+inf" be ok? or it has to be "0"

Or doesn't really matter?


by yren004 (yren004) on August 6, 2003, 8:53 pm

i've no idea either..
sorry


by yren004 (yren004) on August 7, 2003, 3:39 pm

what u talking abt?
we talking abt the input format of Q2!!!


by asheltie (ajoh064) on August 7, 2003, 4:00 pm

so much confusion.

he'll put 0's instead of [.] dots for floyd's bit (Q.1) which he wants us to turn into [+inf] for the output - yay

for (Q.2) i'm also confused.......

I find the lectures very confusing, it always looks like Mark's confused as well sometimes, from that i can assume we're experiencing the 'norm for an abstract subject like this




32. Assig Q3--sample answer?


Assig Q3--sample answer? by david (jyue005) on August 3, 2003, 2:10 pm

In the sample answer:
Immediately before call # 1 to DFSv:
Unvisited: 0 1 2 3 4
Visited, not done:
Done:

Immediately before call # 2 to DFSv:
Unvisited: 1 2 3 4
Visited, not done: 0
Done:
...

What does "# 1" mean?


by msir003 (msir003) on August 3, 2003, 3:16 pm

it mean the step that u take... "before #1" would mean : wots the 1st thing that u visit...


by knack (pduf006) on August 3, 2003, 3:38 pm

# stands for "number"




33. How fast should Q1 be?


How fast should Q1 be? by drflower (dflo006) on August 7, 2003, 3:10 pm

I was just playing around with some matrices to test how long my Floyds algo took with large graphs.

I created them randomly, with 50% of the nodes having infinity to begin with.

I tried one with
10 nodes: 0.000 seconds
100 nodes: 0.062 seconds
1000 nodes: 1 minute!!

So it really slows down... but I was wondering if other people have tried this ? Is this kind of speed acceptable do you think??


by asheltie (ajoh064) on August 7, 2003, 3:30 pm

i don't have my code here today, but will let you know.......they should all be similar if we're using primitives


by knack (pduf006) on August 7, 2003, 7:14 pm

mine was faster :)

but yeah floyd's algorithm is O(n^3) so its gonna get slow quite fast


by drflower (dflo006) on August 7, 2003, 8:32 pm

Thanks for that...

And it makes sense really.

With 100 nodes: 0.062 seconds

With 1000 nodes, where are multiplying the size by 10, so the time will be multiplied by 10x10x10, ie 62 seconds, or 1 minute

I wonder how big the input files that the markers will use are (???)


by asheltie (ajoh064) on August 8, 2003, 3:21 pm

finally, some times

including the file reading,

1000_matrix takes 62,000 ms
which seems the norm,

w/o the file reading the 100_matrix is 90-100m/s which seems okay'ish cause there's no tricks here




34. negative arcs in q2


-ve distances by dyak001 (dyak001) on August 6, 2003, 7:34 pm

well I think that -ve means that the intrinsic nature of Dijkstra doesn't allow unfinity to be included. If the possibility of the start states is infinite we could end up anywhere(infinite regression would take place), something which a computer might not find at all appealing, since each state can only be represented by 0's and 1's, this would severely restrict computational capacity for even the simplist of problems. By only allowing positive weights for a non-deterministic or deterministic finite automata we simplify the real world problems and decision making in computational mathematics. (32, 64 or 128 bit capacities).

cheers raag


negative arcs in q2 by msir003 (msir003) on August 5, 2003, 9:40 pm

Is -ve arc an arc that goes in the opposite direction to a directed arc with a positive weight? eg lets say that weight from node(0)-------->node(1) is 2. Would the -ve arc be from node1 back to node0 with the weight of -2??? thanx


by knack (pduf006) on August 5, 2003, 10:52 pm

no (i think this is what you mean):

node0 ------- -10 -------> node1

is NOT the same as

node0 <------- 10 --------- node1

a negative weighted arc is just an arc that it costs a negative amount to travel along.. say you have:

node0 -------- 4 --------> node1 ------- -2 -------->node2

then the cost to get to node2 from node0 is 2
you still can't get back from node2


by knack (pduf006) on August 6, 2003, 8:51 pm

come on, quit it. it stopped being funny last semester. seriously.


by jsun027 (jsun027) on August 7, 2003, 7:06 pm

[quote:0f0801a548] dyak001
well I think that -ve means that the intrinsic nature of Dijkstra doesn't allow unfinity to be included. If the possibility of the start states is infinite we could end up anywhere(infinite regression would take place), something which a computer might not find at all appealing, since each state can only be represented by 0's and 1's, this would severely restrict computational capacity for even the simplist of problems. By only allowing positive weights for a non-deterministic or deterministic finite automata we simplify the real world problems and decision making in computational mathematics. (32, 64 or 128 bit capacities).



I don't follow at all...
What is this "intrinsic nature" of Dijkstra please?
infinite regression?
These are all jargons to me.... could you please explain it in a simply way...

by knack (pduf006) on August 7, 2003, 7:11 pm

he's just trying to confuse you - ignore it :P


by jsun027 (jsun027) on August 7, 2003, 8:45 pm

For Q2.
in Dijkstra algorithm, second part, the while loop, for each iteration,
it's looking for a vertex(in V(G) but not S) that is minimum distance to our
v.
[code:1:fdc5c90562]
find u (- V(G)\S so that dist[u] is minimum
[/code:1:fdc5c90562]

My questionn is, what if at this stage, there are two vertices that are with
the same dist, and this dist is the minimum, which one do we pick plz? or it rather depends on the implementation....


by knack (pduf006) on August 7, 2003, 8:52 pm

the lowest numbered one




35. tuesday lecture


tuesday lecture by dyak001 (dyak001) on August 6, 2003, 6:55 pm

does anyone have notes for the last part of tuesdays lecture, I wasn't quite able to here what Mark was saying, but I was quite inspired by his tearful approach to lecturing, well I do hoope it was his passion and not some personal issues he's having that would be quite disturbing and defiantely inappropriate!!

thanks red




36. Q1 question


by knack (pduf006) on August 7, 2003, 1:00 pm

well it depends on when the while loop terminates i guess

i think we will be studying this stuff later in the course - i saw some things like that in the coursebook.


Q1 question by fever691 (yyan050) on August 7, 2003, 12:11 pm

I'm not too sure about how to check for a "cycle of negative total weight"
anyone able to give a hint?

and a negative weighted loop would be considered a cycle?


by knack (pduf006) on August 7, 2003, 1:34 pm

yep, its a negative cycle if the total weight along the cycle is less than zero


by knack (pduf006) on August 7, 2003, 12:16 pm

well.. i don't know whether i can answer your first question :\
hm.. just try to think about how a negative weighted cycle would show up during floyd's algorithm - in the "all-pairs matrix".

yes, i think a negative weighted loop would be a cycle


by fever691 (yyan050) on August 7, 2003, 1:07 pm

yay!!! after a "long long" time I jst worked out my first question...yea I feel stupid now, cos it's easy! :P


by fever691 (yyan050) on August 7, 2003, 1:23 pm

what if you have a matrix the is:
0 8 -5
3 0 0
0 -2 0
would this still be considered a "negative weighted" cycle?
because there is a cycle from

node 0 -----> node 2 -----> node 1 -----> node 0

but the cycle doesn't have "full" negative weights on each arc


by fever691 (yyan050) on August 7, 2003, 12:32 pm

knack wrote:
  well.. i don't know whether i can answer your first question :\

heheh had to try :D

but a question if
for loop
for loop
for loop
means O(n^3)
then what happens if
while loop
for loop
for loop
for loop

? or say within a while loop call another method, where that method contains other for loops like the O(n^3) ??


by shurik (apry004) on August 7, 2003, 7:16 pm

The sum of three arcs is -ve. therefore its going to b ive cycle
eg
-10+2+3= -5




37. Ass1 Q2


by Jono (jteu004) on August 4, 2003, 10:31 am

I think the confusion is between weighted and unweighted graphs.

In the adjacency matrix representation of an unweighted graph, we use a 0 for no arc, and 1 for an arc.

With a weighted graph, things are different. Now we need to store the weighting for each arc in the matrix (and 0 weight arcs are allowed). This means we need a new value for "no arc", for which we decided to use infinity.

Other possible points of confusion: I think originally Mark intended 0 to still be "no arc" (hence the large number of 0's in his original examples of weighted graphs). But since he decided to allow 0 weighted arcs, we have moved to inf for the "no arc" value re: [url] http://forums.cs.auckland.ac.nz:8181/viewtopic.php?t=5468[/url]

Jono.


by Mark Wilson (mwil211) on August 6, 2003, 3:23 pm

As I said in lecture Tuesday, for Q1 we will use 0 to mean infinity (no arc) in the off-diagonal positions. In your program you will need to replace these 0's with "infinity". To do this, it is probably best to compute M = sum of all positive arc weights, and use M+1 for infinity.


In the diagonal positions, 0 means either no arc or a loop of weight zero, which amounts to the same thing when computing distances.


Ass1 Q2 by msir003 (msir003) on August 3, 2003, 3:14 pm

hey, how the hell can u have a -ve weight btwn 2 nodes?? isnt the smallest weight 0, wen there are no arcs connecting them?? TUTORS/LECTURES HELP US!!!!!!! :) :) :)


by knack (pduf006) on August 3, 2003, 3:41 pm

weight 0 means it costs nothing to get from A to B
weight +infinity means you cannot get from A to B

you *can* theoretically have negative weights.. think of it as moving downhill - you gain gravitational potential energy :)




38. take a deep breath


take a deep breath by asheltie (ajoh064) on August 2, 2003, 3:13 pm

wow,

alot of people mispelled Ditjskra's name:

Mark,
what's [quote:9b8d74704d] "Breath First",


is it when you take that deep breath just before you run an algorithm, hoping like ** that it works??

[size=9:9b8d74704d] -GraphDemo.java line 38[/size:9b8d74704d]

by knack (pduf006) on August 2, 2003, 4:51 pm

[quote:7afbc44c75] alot of people mispelled Ditjskra's name:



That's "Dijkstra" :P

or was that a deliberate joke? I can never tell :)


39. Q3


by Bigbear (hyan052) on August 6, 2003, 1:37 pm

fshe010 wrote:
  ^-^ ok..
so could you tell me why the example of Q3 from lecture finished the DFS research when still got node 4 unvisit


I didn't visit all the nodes too


by fshe010 (fshe010) on August 4, 2003, 12:13 pm

we can't visit all nodes if we start from 0 node, so...


by knack (pduf006) on August 6, 2003, 12:33 pm

no, i think that would be cheating.


by fshe010 (fshe010) on August 6, 2003, 12:15 pm

could u tell me how many call # number of q3


by knack (pduf006) on August 6, 2003, 2:24 pm

..no i can't..

i must have missed that. are you sure he left it unvisited? it wasnt a tree all by itself? mr lecturer? mr tutor?


by knack (pduf006) on August 5, 2003, 9:37 am

so then when you can't go any further, start again from the next unprocessed node.. just like the algo in the book


by fshe010 (fshe010) on August 6, 2003, 12:48 pm

^-^ ok..
so could you tell me why the example of Q3 from lecture finished the DFS research when still got node 4 unvisit


Q3 by fshe010 (fshe010) on August 3, 2003, 2:39 pm

what's meaning of the first requirment of Q3 which is In every for loop , process nodes in increasing order of numerical label.


by knack (pduf006) on August 3, 2003, 3:42 pm

er.. how simple do you want it? first process node #1, then node #2, then node #3 etc etc etc :P


by david (jyue005) on August 14, 2003, 1:01 pm

...
Immediately before call # 5 to DFSv:
Unvisited: 4
Visited, not done: 0 1 3
Done: 2

why mike ends the DFS research without visiting node 4?
Or he just didnot finish it.


by Jo (ldin005) on August 14, 2003, 7:09 pm

i think the point is he said "Immediately before.." so everything listed after this line is the information right before doing the DFSv, then when the last node is finished there'll be no more DFSv to do, therefore the very last node is not listed.




40. Q3


by Jono (jteu004) on August 4, 2003, 10:39 am

Umm.. you can discuss how the algorithms work and how to use them, but please be careful to leave it at that. You should not discuss anything specific to the assignment (eg. which nodes you traversed in which order etc).

Cheers,
Jono.


by jimmy (syu034) on August 4, 2003, 9:02 am

knack wrote:
  it means 1 then 2 then 3 then 4 etc
numeric == numbers :)

do we need follow the number order 1,2,3,4,5 respectivity?or 5,1,2,3if 5 is root.


by knack (pduf006) on August 1, 2003, 3:10 pm

why?


by knack (pduf006) on August 1, 2003, 2:13 pm

i *think* we have to start at node 0


Q3 by msir003 (msir003) on August 1, 2003, 9:23 am

hey, in the "rules" for q3 it says that we have to go thru nodes in ascending order. does that mean we have to start with node 0? or can we choose any root, then go as far as we can and then go in ascending order???? (cuz if u start at node 0 there is more than 1 connected tree), thanx


by knack (pduf006) on August 2, 2003, 12:43 pm

well yeah, but where does it say you have to get one connected tree?


by asheltie (ajoh064) on August 1, 2003, 10:28 am

thanx,

for the answer,

at least thanks for telling us what to look for........


by shurik (apry004) on August 1, 2003, 2:23 pm

nope i think u need to start at root 6


by shurik (apry004) on August 1, 2003, 7:57 pm

coz there is no routes that go into 6


Re: Q3 by jimmy (syu034) on August 3, 2003, 2:54 am

msir003 wrote:
  hey, in the "rules" for q3 it says that we have to go thru nodes in ascending order. does that mean we have to start with node 0? or can we choose any root, then go as far as we can and then go in ascending order???? (cuz if u start at node 0 there is more than 1 connected tree), thanx

what is the meaning of numerial order?


by knack (pduf006) on August 3, 2003, 4:19 am

it means 1 then 2 then 3 then 4 etc
numeric == numbers :)


by fez (jbro179) on August 3, 2003, 1:14 pm

crap I did it out of numerical order and jumped from 1 to 3

I think you need to start at 0 and 6 :)


by knack (pduf006) on August 3, 2003, 3:43 pm

start at 0, then if you run out of nodes to process and there are sill some left, start again at the lowest numbered unprocessed node




41. Assignment 1 Q1


by jsun027 (jsun027) on August 8, 2003, 8:49 am

[quote:33472e640e]
Mark:
For Q1 (Floyd), we need to clarify the input format (weighted adjacency matrix). It is difficult to represent infinity, so I am using 0 in the (i,j) position to mean there is no arc from node i to node j. You can also interpret it to mean that there is an arc of weight zero, BUT this is not how I want to do it. That would give incorrect answers.
...
...
If you end up not having any path from i to j then you are supposed to write out "+inf" to your output.

Here is a hint for how to avoid infinity. Compute the sum M of all the positive weights in the input matrix. No path can have length more than this, so we could use M+1 instead of infinity from the beginning.



My question is, when our algorithm takes in the standard weighted adjacency matrix, how is it supposed to distinguish btween "there is no arc" and "there is an arc carrying 0 weight" which are both represented by "0" in Mark's standard weighted adjacency matrix.
Because, in the Floyd Algorithm, when it comes down to
[code:1:33472e640e]
c[u,v] = min(c[u,v], c[u,x] + c[x,v])
[/code:1:33472e640e]
Say, if there is no arc [u,v] , and it will be represented as c[u,v] =0. If c[u,x] + c[x,v] >0, the algorithm will think simply pick c[u,v] =0, even though it in fact means no arc [u,v] (which is +inf).

Mark suggested to replace 0 by m+1(total cost of arcs plus 1) , but how we supposed to find them in the first place, since we can't distinguish these ones from other 0s....

Folks! please come and help me out!

by knack (pduf006) on August 8, 2003, 9:02 am

i think we assume that the only arcs of zero weight will be on the diagonal. all the other zeros represent infinity.


Assignment 1 Q1 by Bigbear (hyan052) on August 7, 2003, 11:45 pm

In Q1, does our program only need to handle one weight adjacency matrix in the input file? Or we need to handle many matrices at one time?


by jsun027 (jsun027) on August 8, 2003, 8:33 am

Our program should be able to take multiple weighted adjacency matrices in the input file. We can tell that from the input and output example in mark's handout directory.


by shurik (apry004) on August 8, 2003, 2:50 pm

knack wrote:
  i think we assume that the only arcs of zero weight will be on the diagonal. all the other zeros represent infinity.

So u add all numbers in the matrix and add1 then u replace the sum with every 0 except ones at the diagonal


by asheltie (ajoh064) on August 8, 2003, 3:03 pm

YES


by shurik (apry004) on August 8, 2003, 3:16 pm

run through Floyd's algorithm and it would work


by jimmy (syu034) on August 8, 2003, 7:21 pm

shurik wrote:
  run through Floyd's algorithm and it would work

hi,guys,how to write the java program?fro Q1,anyone can give me a hint


by fez (jbro179) on August 9, 2003, 11:12 am

To get you started you need to get the matrix out of the txt file, Marks handouts dir has some java files that can help you there (not that I used them or anything)


by jimmy (syu034) on August 9, 2003, 12:23 pm

fez wrote:
  To get you started you need to get the matrix out of the txt file, Marks handouts dir has some java files that can help you there (not that I used them or anything)

on the website?


by shurik (apry004) on August 9, 2003, 12:29 pm

jimmy wrote:
   fez wrote:
  To get you started you need to get the matrix out of the txt file, Marks handouts dir has some java files that can help you there (not that I used them or anything)

on the website?

yea at his website "my handouts"


by jimmy (syu034) on August 9, 2003, 12:53 pm

shurik wrote:
   jimmy wrote:
   fez wrote:
  To get you started you need to get the matrix out of the txt file, Marks handouts dir has some java files that can help you there (not that I used them or anything)

on the website?

yea at his website "my handouts"

there are a lot of sources.even i don't know which will be useful ?
anyway i have found it,thanks a lot!


by Bigbear (hyan052) on August 9, 2003, 11:19 pm

jimmy wrote:
   shurik wrote:
   jimmy wrote:
   fez wrote:
  To get you started you need to get the matrix out of the txt file, Marks handouts dir has some java files that can help you there (not that I used them or anything)

on the website?

yea at his website "my handouts"

there are a lot of sources.even i don't know which will be useful ?
anyway i have found it,thanks a lot!


I didn't use the package of java-graph Mark provided, but I still got the correct output.

I finished the code, but I still get no idea what's going on in Q2.........:(


by jimmy (syu034) on August 10, 2003, 1:46 pm

Bigbear wrote:
   jimmy wrote:
   shurik wrote:
   jimmy wrote:
   fez wrote:
  To get you started you need to get the matrix out of the txt file, Marks handouts dir has some java files that can help you there (not that I used them or anything)

on the website?

yea at his website "my handouts"

there are a lot of sources.even i don't know which will be useful ?
anyway i have found it,thanks a lot!


I didn't use the package of java-graph Mark provided, but I still got the correct output.

I finished the code, but I still get no idea what's going on in Q2.........:(

how to do that?give me some hints?


by fez (jbro179) on August 10, 2003, 9:27 pm

[quote:96a3482b60] I didn't use the package of java-graph Mark provided, but I still got the correct output.

I finished the code, but I still get no idea what's going on in Q2.........:(



Me too! Im so stoked I got q1 done and working, but have not a clue on q2, I dont get that bit at the end of the question, "via a quickly decreasing function of n + e"

All the applets Ive found that implement it dont work, either that or my browsers java-machine sucks.

So what does n and e stand for?

by jwel027 (jwel027) on August 10, 2003, 10:16 pm

just means it has to be right. I hope the tutor that gave me those answers wasn't lying.


by Jono (jteu004) on August 11, 2003, 2:37 pm

Yes, n = nodes and e = edges. You are looking for the smallest graph (in terms of both nodes and edges) for which Dijkstra's gives an incorrect answer. This graph may or may not have a cycle.

Jono.


by jsun027 (jsun027) on August 12, 2003, 9:55 pm

can I have arcs that are 0 weight for Q2?
For Q1, we can't. That's for sure. Because, in standard weighted matrix, all off diagonal 0s are interpreted as +inf (arc doesn't exist)




42. Assignment01 Q2


Assignment01 Q2 by jsun027 (jsun027) on August 3, 2003, 11:43 am

Anyone knows why Dijkstra's algorithm doesn't work if negative weight arcs are allowed, please?

How can an arc be negative weight(cost) please?


by knack (pduf006) on August 3, 2003, 3:50 pm

i don't think i can tell you that.. it's sorta the assignment question :P

um.. just try and think about how it works and try running it on a few graphs with -tive weights, see if you can break it :)

btw - the assignment says "no negative cycles" - so you arent allowed to be able to go from A to A with less than zero cost - cos that's a really easy way of breaking Dijkstra :)




43. Answers to various questions on Ass 1


Answers to various questions on Ass 1 by Mark Wilson (mwil211) on August 6, 2003, 3:19 pm

I hope the following answers all the common questions:

1. Even though in Q1 using, say, . instead of +inf would be tidier, please stick to the instructions given for formatting.

2. The input file you are given
for Q1 will contain several digraphs in
the standard weighted adjacency
matrix format.

3. For Q1, please send your output to standard output (System.out.print), not to a file - it makes marking much easier. We will redirect to a file when we mark it.

4. Some of the standard format files and sample answers on my website were a bit corrupted - you may want to check them again now they have been fixed.

5. The comment in the assignment that you should use the graph classes provided is a standard one I give every semester. Usually you really do need them, but this time the assignment is easier and you don't really need them. But feel free to steal pieces of code that may be helpful.

6. I really do want just 1 file floyd.java for Q1. You may assume that all the Java graph files on my website are available to the markers in the same directory that your floyd.java will be.

7. Someone asked me why the adb was not working - it has been working since Monday, so try again. The standard deadline time is 9pm as listed on the course website. I think I have told someone it was midnight, sorry.




44. is it the point?(Q2)


is it the point?(Q2) by pump (jbai034) on August 6, 2003, 8:15 pm

Greedy Algorithms and Negative Costs
A greedy algorithm chooses the locally best option at each step, in hopes that this will produce a global optimum.
For Dijkstra's algorithm this is more than a hope: it guarantees shortest paths, provided all costs are non-negative. In this case one cannot get any cheaper by going further. It is a label setting method because once a cost (label) is determined, it need not be changed.

However this guarantee fails when there are negative costs. In this case, one can get cheaper by going further if one finds a negative link. Label correcting methods are needed, which might modify the cost to a node when a better cost is found. An example label correcting algorithm is given in the next section.

Note that negative cycles cannot be allowed: one could get an arbitrarily "short" path by looping repeatedly around the cycle

sometimes i found it is hard to follow the massive "proof"
but i tried to make it clear...



i guess the problem is:
if there is a negative arc in a cycle a-b-c-a so that the total cost of the cycle is negative, you will find the more times u walk around the cycle , u end up with less cost from a to c by keep looping

i.e u cannot find a *lowest* cost to walk from a to c.

is it the point?




45. algorithms


algorithms by dyak001 (dyak001) on August 1, 2003, 3:49 pm

o hi I've never done this before so I hope everyone understands what my question is, umm well for the assignment questions we have to use Dijkstras and Floyds algorithm to assess the minimum weight path for some grapg G. Oh I hope I spelled Dijkstra and Floyd correctly, anyway some graph G with n nodes and e edges, now for one of them I'm not supposed to use negative arc weights(so I won't...ha) for Dijkstras algorithm(i think), now for Floyds algorithm it doesn't matter(so I will ... ha) if we use negative weights even for a minimum graph with n nodes, where n is not an empty set and e edges where e can be an empty set for the minimum node vertice(s) problem where we get a total path sum less than zero, for some reason which I'm not aware of at the moment but Dijkstra does not like this(very Freudian i think) and Floyds not so fussed either way.

Now to my question does anyone knoe where I can find a copy of Dijstras and Floyds masterpieces :-).

I know one of them we starts with a increasing or decreasing weight list and selectively chose minimum weights at random(from anywhere....(Dijskra I think)), has a big O(n ...cubed...) time complexity,(greedy little sucker)..and we progressively work through the list until we have a minimum spanning tree... I think the difference with Floyds is that the selections are in an ordered arrangement, with any node as a start position, preferably a minimum weight node edge.(n..cubed aswell I think ...another greedy little sucker)

oh I do hope you can understand my difficulty and can help me out..that would be so great...thankssss


:-) cheers steve


by asheltie (ajoh064) on August 1, 2003, 4:19 pm

if you buy the 220 notes you'll find them there

btw,
you spelt Dijkstra wrong on line 12 (or 11 if you don't count an empty line as a line?)


by knack (pduf006) on August 1, 2003, 4:21 pm

they're both in the coursebook, read ahead a little..

floyd doesnt mind a few negative weights, but screws up on a negative *cycle*

dijkstra can't handle negative weights at all (in some situations)
the question there is to find the smallest example of such a case




46. Question for Q1 Ass1


Question for Q1 Ass1 by inkeol83 (ikim008) on August 11, 2003, 6:40 pm

if you see file from marks handout page.
There is 0 at the end of list.
Should my programe recognise that as a end of file?
or should I print
ie)
....
....
Digraph 3: all-pairs matrix follows
0 1 3
1 0 1
3 0 3

Digraph 4: all-pairs matrix follows

C:\Assignment>_


like this? with 0*0 matrix drawn?
or dont print diagraph 4?
tell me~!~!~!
i need to submit!


by knack (pduf006) on August 12, 2003, 10:07 am

the 0 is just an end of file marker, not a 0x0 matrix.




47. Cant I submit ass without NetAccount?


Cant I submit ass without NetAccount? by inkeol83 (ikim008) on August 11, 2003, 7:42 pm

Is it impossible to submit my assignmnet without NetAccount?
Because I could not get excess into ftp site to download NetAccount.


Re: Cant I submit ass without NetAccount? by jimmy (syu034) on August 12, 2003, 10:20 am

inkeol83 wrote:
  Is it impossible to submit my assignmnet without NetAccount?
Because I could not get excess into ftp site to download NetAccount.

off course,u need connect to netcount to submit assignment




48. Question 1....HELP!


Question 1....HELP! by ysakaed (yhsi014) on August 11, 2003, 7:54 pm

i am wondering....
as we are taking adjacency matrix format file as an argument..
but in the graph class file, it uses adjcency list as argument right??

as in the graph file..
[code:1:864ccee3c0]
//public class Graph extends GraphAdjMatrix
public class Graph extends GraphAdjLists
[/code:1:864ccee3c0]

so how should i store adjcency matrix??
i am confused and have no idea at all...
can anybody help???
thanks...


by jwel027 (jwel027) on August 11, 2003, 9:27 pm

make the Graph class an extension of the GraphAdjMatrix class(i.e. comment out the bottom one and delete the comments from in front of the top one)


by ysakaed (yhsi014) on August 12, 2003, 4:36 pm

jwel027 wrote:
  make the Graph class an extension of the GraphAdjMatrix class(i.e. comment out the bottom one and delete the comments from in front of the top one)


so we are allowed to modify the files provided?


by coolbest (ngol002) on August 14, 2003, 10:47 am

ysakaed wrote:
  
so we are allowed to modify the files provided?


Lets leave it at that: u dont even really need the files provided, unless u want to make yr life really misrable




49. tree arc, forward or backward


tree arc, forward or backward by dyak001 (dyak001) on August 12, 2003, 1:36 pm

is a strong component a strong component if it's a forward arc or a back arc, surely a forward arc or back arc cannot ever be a strong component since all sub components are not reachable from all nodes in the system, so if we have a single pair of nodes with a single path connecting them and the pairing is a strong component( undirected ), can it ever be a forward arc or a back arc, or can it be both a forward arc and a back arc in which case does that make it two weak components. In this case with two weak components is it a mathematical representation of the sub components contained within the pairing. So if one of the components is not present at all times that would then make it( the pairing ) a weak component, surely?


by knack (pduf006) on August 12, 2003, 5:28 pm

one day, you're gonna have an actual legit question and noone will bother reading it.


by twirl (mlow026) on August 14, 2003, 10:13 am

Forward arc, back arc; both part of a component.
Strong if all reachable, weak if not.
Simplify man. Simplify yah Yak.




50. Q1


Q1 by jzho020 (jzho020) on August 12, 2003, 1:48 pm

how to run Mark's program(those java files on the web)? the GraphDemo.java can't be compiled. are we supposed to write a program called Floy.java as a part of Mark's program or the Floy.java file is the whole program which can deal Q1? I don't know what Mark's program does and how I start Q1? I don't know what we are supposed to do? I am confused. Could someone make me clear.




51. code could someonr have a look and see if they can find the


code could someonr have a look and see if they can find the by dyak001 (dyak001) on August 12, 2003, 3:02 pm

could someone explain to me why this code works, It seems to run to previuosly compiled version. Since then it has been recompiled and run but produces the same output?

the parameters which were switched off were the PostOrd[l] ) variable, but somehow still produces output that the array is being assigned some values, although the assignment variable in the DFS method has been commented out and so should produce all zero's as the out put, however the output is the reverse of the array PreOrd[l] which is assigned the integer values at the begginning of the DFS method just prior to the call to DFS. Some of the comments have been deleted, however the code remains the same as that run on the computers in the lab at 2:50pm on the JCreator development environment.

<EDITED>


by Jono (jteu004) on August 12, 2003, 6:16 pm

I realise you were trying to determine whether there was a bug in your setup of JCreator, but the code posted was getting a bit borderline. Ideally sections of working code should never be posted to the forum, and in this case people may have tried to use it for answering an assignment question.

Best to ask demonstrators for help with those sorts of problems.




52. tests for part one!!


tests for part one!! by GonePostal (ssto040) on August 12, 2003, 3:06 pm

Can either Mark, or someone else please provide a weighted adjacency matrix file, with its corresponding output, so that we can test part 1 of the asst? I don't see how that can be considered cheating

thanks




53. the loop is a cycle or not?


the loop is a cycle or not? by fangwen27 (fliu028) on August 12, 2003, 3:14 pm

hello everyone

who tell me how many notes can make a cycle ?

if a note has a loop and the weight is negetive, i don't whether it is a cycly of negetive weight??

thanks


Re: the loop is a cycle or not? by jimmy (syu034) on August 12, 2003, 3:20 pm

fangwen27 wrote:
  hello everyone

who tell me how many notes can make a cycle ?

if a note has a loop and the weight is negetive, i don't whether it is a cycly of negetive weight??

thanks

3....more




54. need help!!!!


need help!!!! by fangwen27 (fliu028) on August 12, 2003, 3:42 pm

who can tell me
negtive weight loop is a negtive weight cycle or not??

if it is . please tell me why?

i remember a cycle should has 3 or more note. right?


by fshe010 (fshe010) on August 12, 2003, 4:31 pm

no.. it's different.
loop is from itself and finish on itself without visiting other nodes.


by peterpanwei (wpan008) on August 12, 2003, 4:32 pm

Cycle is a loop, it could only have 2 or 1 notes. The weight of the loop or cycle is the sum of the arcs in the loop(Cycle). i`m not gonna explan why, coz the book says the definition.!!




55. variable "u" & "v"


variable "u" & "v" by Felix (kcho089) on August 12, 2003, 5:33 pm

Can anyone tell me the difference between node u and node v?
this is insid the DFSv algorithm. I am confused when ilook at the algo to do my question 3. Wat do u mean by "v adjacent to u". Cheers!!


by asheltie (ajoh064) on August 13, 2003, 10:10 am

in the DFS you're looking @ each node in turn, the current node you are looking @ is labelled "V".
"U" is any node that has an edge from "V" to "U".

So if the matrix is:

0 2 0
1 0 4
0 3 0

and "V" is node 2
the node/s that "U" represents will be the one with the edge "3




56. Using Floyd's algorithm with negative arc weights


Using Floyd's algorithm with negative arc weights by BAU (itri002) on August 12, 2003, 5:43 pm

Hi,
I'm having some problems with Floyd's algorithm when I have negative arc weigths.
Can someone please confirm that instead of using <infinity> for non-existent arcs, we are to use the 1+sum of all POSITIVE weights?
Or should we be using 1+the sum of ALL arcs (both positive and negative weights)?
If you've had this problem, can you please give me some hints about where I might be going wrong?
For example, with the following weighted adjacency matrix (where infinity would be replaced by sum of positive weights which is 21)

0 3 6 7
(21) 0 4 3
(21) 2 0 6
(21) -4 -1 0

we should get
0 3 6 7
(21) 0 4 3
(21) 2 0 6
(21) -4 -1 0

except I get
17 -4 -1 0
for the last row because at some point it compares [3,0] to [3,1] +[1,0] which is 21 > -4+21 which is 17.
Any suggestions?
Thanks


by Blah (zshi005) on August 12, 2003, 7:29 pm

I have the same question as well. So I think the "infinity" value should be the sum of all positive numbers. There is no need to sum up all the absolute values of numbers even they are negative.
Anyone can clarify that?


by jsun027 (jsun027) on August 12, 2003, 10:05 pm

sum of the positive arcs + 1 will do.
THe idea behaind this is, use a unique real number to represent +inf(no arc), as long as this number is not to be repeated by any other entries in ur matrix. therefore this number is easily identified. we can substitute this number back and forth when we compute it and print it out.
sum of all the negative arcs - 1 is also another option I guess... think about that///


by christian (celv004) on August 12, 2003, 10:08 pm

Blah wrote:
  I have the same question as well. So I think the "infinity" value should be the sum of all positive numbers. There is no need to sum up all the absolute values of numbers even they are negative.
Anyone can clarify that?


Yes you don't need to sum anything besides the positive weighted arcs because the idea is to generate a value greater than the sum of the positive arcs to symbolize infinity.

Christian


Negative arc weights by BAU (itri002) on August 13, 2003, 10:30 am

Hi,
Can someone please confirm that for the negative arc weights, we replace all the non-diagonal zero values with max+1 BEFORE we perform any steps of Floyd's algorithm? And that these values will remain the same throughout until we replace them with +inf at the end?
And can anyone tell me if they get the same answer when running these two matrices through their algorithm?

matrix 1:
0 3 inf 7
inf 0 4 inf
inf inf 0 6
inf -4 -1 0

matrix 2:
0 3 21 7
21 0 4 21
21 21 0 6
21 -4 -1 0

Thanks


by BAU (itri002) on August 13, 2003, 11:33 am

Okay, I'm going to answer my own question for anyone who might be having the same problem (thanks Jono for your insight!):
The problem was occurring because I was doing the comparison for minimum against max(inf) when one of the sum elements is also max(inf) so that when the other sum element is a negative value, it will decrease the max value. So its easily fixed by only doing the comparison if neither of the sum elements is equal to max.
Of course, now that I know that, it makes sense when you look at the graph...




57. why does our groud floor computer lab just like a market???


why does our groud floor computer lab just like a market??? by skyblue (zwan033) on August 12, 2003, 6:28 pm

[color=red:5cbda10081]


study by dyak001 (dyak001) on August 12, 2003, 7:13 pm

sure




58. Marks algorithm


Marks algorithm by dyak001 (dyak001) on August 12, 2003, 8:20 pm

just in case Mark doesn't receive or read my email in time for assignment 1, could you ask him when they might change the files that have been compiled for the original ones that are compiled when I press the compile button. it seems as though when I have no code at all listed in the class module it still compiles according to the code that was there some days ago, gees I forget when, although I think I can safely assume that somehow the computer and it's designers(software) have not informed me that the only software at this present time which seems to run on grenwich mean time is number.. well I forget where I was sitting the other day, or earlier today but noone else seems to be having difficulties with their java development environemt...those pesky faults why do so many developers use beta copies to use on us students, If the number of faults found in the assignment is reflective of the quality programs they release then regression analysis and cost function analysis might indicate that the withdrawal of the product from the market for redevelopment and replacement at such a late date might be astronomical. It must be a document driven process which usually requires such a high quality of programmers and developers involved inthe design of the product , since such bad quality programs and such a horrific number of faults at such a late date would indeed indicate under regression analysis that the cost curve would be exponential.


by Maximum Redg (rred015) on August 13, 2003, 5:31 pm

What are you on???!!




59. mangement and processes


mangement and processes by dyak001 (dyak001) on August 12, 2003, 10:08 pm

any system of rules is deterministic as it determines where, how and when resources are to be managed and resources ditributed within the context of that particular system. A deterministic and containing only one start state and a non-deterministic system more than one start state, so a non-deterministic system introduces uncertainty regarding start states and outcomes, however each subsystem is necessarily deterministic......and therefore must be a finite and descrete set of components.




60. About Q3


About Q3 by Blah (zshi005) on August 13, 2003, 12:16 am

For Question 3, are we supposed to run DFS on every node or run the DFSv from node 0 is enough?


by asheltie (ajoh064) on August 13, 2003, 10:11 am

read the asssignment,
sumwhere it mentions the order of reading the nodes, from that you'll find which node to start with


by Maximum Redg (rred015) on August 13, 2003, 5:28 pm

Lol look at the timestamps of the posts....

asheltie is so "on to it" that he posted a reply before the question was asked :P

A++


by asheltie (ajoh064) on August 13, 2003, 8:03 pm

damn it you're right.........

i had this vision and ...............ooohh, it's gone.

2 moro i predict sum1 will ask a question about..................graphs!


by dyak001 (dyak001) on August 29, 2003, 12:59 pm

hey when you get an answer can you let me know aswell, I'd reaaly be interested in finishing my dfs asap.

how does it go again... no names, no mike
know who!!, know how??
know who!!, not what!!




61. how to take a file??


how to take a file?? by fangwen27 (fliu028) on August 13, 2003, 2:21 pm

hello :

who can tell if i want my program can take a file, can i run
"java floyd<test.txt" command in DOS model?


by knack (pduf006) on August 13, 2003, 2:38 pm

your program should take a filename as a parameter - it should understand "java Floyd file1.txt"




62. serious taking file problem, jcreator


serious taking file problem, jcreator by Jo (ldin005) on August 13, 2003, 3:06 pm

i am getting panic attacks. could someone help me out plz?
I am trying to pass a file name to the main method. i tried moving the source file to c:\ then compile and run it using "javac filename.java", "java filename argument" in Dos-command line emvironment did not work --> "bad command".
then used
in = new BufferedReader(new FileReader(args[0] ));
even
in = new BufferedReader(new FileReader("C:\testmatrix.txt"));

with the second one, jcreator generated ioexception file not found
with the first one after went
configuration -> option -> sdk tool->run application
-> parameter ->prompt for main method -> browse for file -> apply
i got array index out of bound exception, what else has i got to do?


by asheltie (ajoh064) on August 13, 2003, 3:33 pm

i'm a little confused,

[quote:ba24c507cd] I am trying to pass a file name to the main method. i tried moving the source file to c:\ then compile and run it using "javac filename.java", "java filename argument"


you mention the word "filename" as the name of your .java file AND say that you are trying to pass a "file name" to the main method?

just post the actual text that you write in the command line and maybe it will become clearer - cheers

by Jo (ldin005) on August 13, 2003, 4:04 pm

i guess panic state is not helping, you are right i should have made it clearer. what i meant to say was:

I am trying to pass a file name to the main method. i tried moving the source file and the text file that contains the matrix to c:\ then compile and run it using "javac floyd.java", "java floyd matrix.txt"

any help is very much appreciated.


by asheltie (ajoh064) on August 13, 2003, 4:11 pm

the problem may be that you wrote
[quote:010a241905]
in = new BufferedReader(new FileReader("C:\testmatrix.txt"));



now you're saying
[quote:010a241905] "java floyd matrix.txt"


1 of these things is not like the other....can you work out which one?

by Jo (ldin005) on August 13, 2003, 4:26 pm

both matrix.txt and testmatrix.txt are text files that contain matrices, they are all placed in the same folder, they have the same purpose: to be taken by the main method as an argument. and i use only one of the files everytime i try to compile or run. because of the same format and purpose they should only give different weighted adjacency matrices after i ran the floyd.java , at this point. What i concern is that somehow the files can not even be located, or not passed through to the main method. Any idea?


by Jo (ldin005) on August 13, 2003, 5:45 pm

i'm on the verge of tearing my hair out.

i finally understand why i can't use the command "javac floyd.java", "java floyd matrix.txt" at C:\ in Dos-command line.
it's something to do with location of the java bin and compiler and all.
short cut to solve this at the time is to move floyd.java, floyd.class and matrix.txt into folder: jdk.whatever\bin
and do everything in this folder, the ultimate solution is reseting the whole compiler - text editor - class path... somehow. damn i could use a gun shooting lesson.
asheltie thank heaps for trying really.


by asheltie (ajoh064) on August 13, 2003, 8:01 pm

i couldn't see that one coming. so the message was for the compiler path not found.......of course, now

You can use the Control Panel/System/Advanced tab
under System variables just add the path into the line that says PATH

good luck.

if it's too hard to do right now, just type the full path of the java compiler and leave your floyd file wherever you like,
e.g
D:\jdk1.4.2\bin\javac.exe floyd.java
D:\jdk1.4.2\bin\java floyd matrix.txt

just don't close the black skin or you'll have to retype the long pathnames everytime you want to compile or run.




63. please give me a help!!


please give me a help!! by fangwen27 (fliu028) on August 13, 2003, 4:08 pm

hello everyone?

i meet a problem !
i don't know how to take a file as a parameter beacause i haven't studied compsic105.

i only know run "java floyd< filename.txt" ,but someone tell me i should run "java floyd filename.txt" . i should not use "<".
now i have not any idea .

please give me help.

thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Re: please give me a help!! by mochagerl (claw026) on August 13, 2003, 4:14 pm

fangwen27 wrote:
  hello everyone?

i meet a problem !
i don't know how to take a file as a parameter beacause i haven't studied compsic105.

i only know run "java floyd< filename.txt" ,but someone tell me i should run "java floyd filename.txt" . i should not use "<".
now i have not any idea .

please give me help.

thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


use:

public static void main(String argv[] ){
...

BufferedReader input = new BufferedReader(new FileReader(argv[0] ));
...
}
then java floyd input.txt should work- its what i used neway.

Hope that helps:)


Re: please give me a help!! by zbao002 (zbao002) on August 13, 2003, 4:33 pm

mochagerl wrote:
   fangwen27 wrote:
  hello everyone?

i meet a problem !
i don't know how to take a file as a parameter beacause i haven't studied compsic105.

i only know run "java floyd< filename.txt" ,but someone tell me i should run "java floyd filename.txt" . i should not use "<".
now i have not any idea .

please give me help.

thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


use:

public static void main(String argv[] ){
...

BufferedReader input = new BufferedReader(new FileReader(argv[0] ));
...
}
then java floyd input.txt should work- its what i used neway.

Hope that helps:)


Part of my codes are:



and it works OK.What is the difference between ?I didn't take stage I compsci paper in AKL Uni as well...

Thanks


by fangwen27 (fliu028) on August 13, 2003, 4:49 pm

thanks !!!!!!!!!!!!!!!!!!!!!!!


i write some code , but when i compile them , always there are some errors , i don't know why?
[/code]


by Maximum Redg (rred015) on August 13, 2003, 5:23 pm

[quote:b27204e28b] and it works OK.What is the difference between String argv[] and String[] args?I didn't take stage I compsci paper in AKL Uni as well...



Ok, look at the mathod declaration...

public static void main(String args[] ) {}

now its actually the same as any method you want to declare...

its a publiclly accesible method, froma static context (menaing it cannot be instantiated)
its return type is void...

And its name is "main"

Following so far??

Ok now when u make your own method, if you want to pass it parameters how do u do it?

public void myMethod(int myNumber) {}

So in this method, one of the arguments you must pass it is an integer called myNumber

This is exaclty the same for the main() method, in that it simply has a String array passed, usually called "args"

But you can call it whatever you like.....

Get it?

by zbao002 (zbao002) on August 13, 2003, 5:31 pm

Thanks a lot to the person upstairs!




64. Handling multiple matrices...


Handling multiple matrices... by zbao002 (zbao002) on August 13, 2003, 4:46 pm

I am using the following codes to handle multi matrices:

... ...
while (token.hasMoreTokens()) {
.....
try{
...
}
catch{...}
}


But it does NOT work at all. My programme print out only the first matrix in the file.
Anyone give me a hint plz? Or tell me how you guys implement this...
Thanks!




65. recursion


recursion by dyak001 (dyak001) on August 13, 2003, 6:28 pm

hi, me again..
I was wondering if anyone knows a really good lawyer, who deals with possible harrassment, information privacy and human rights cases...




Yey team and a really big hi and thanks to all you guys...you've been such a great help...


p.s. no I don't like oysters...




66. just figured out dyak


just figured out dyak by aaa (aazz001) on August 14, 2003, 4:33 pm

it's just a chatbot.. don't get worked up by it!!

a couple of years ago i played a trick on a number of my friends on icq - installing a chatbot under an anonymous account, saying "hello" to them to start a conversation & sitting back to watch the inevitable battle-of-the-(t)wits that would ensue.

found it real funny how some people would start arguing with and ridiculing the bot, and remember laughing outloud when one guy i know starting calling it "stupid" - he was the one sitting there getting worked up by an algorithm!!

the most interesting log i gained from the experience was one night - went to bed straight after starting the bot on a conversation with a female friend of mine.. wake up in the morning to find that she'd spent over an hour talking to it & had even ended up propositioning it with cybersex!!! goodness gracious... the singularity may be closer than we think!!@#

if anyone wants a copy of the log i'll send it to them, obviously with names & ip's changed to protect the innocent...


by harsper (jlee188) on August 15, 2003, 12:10 pm

could u plz send me? i want to see how clever bots can be


by asheltie (ajoh064) on August 15, 2003, 12:26 pm

unless you can convince us that the uni allows anything to join the forum, which i doubt..........and that you've been given priv's to have 2 usernames......?? unlikely, you're just trying to escape from the schitzo world you've been living. So to help with your "self-recovery" i'll accept your poor attempt to rid yourself of this personality and let's hear no more.

it made no sense at all with it's poor logic so it could be reasonable to assume it's dumb. I guess it's creator should take that label also


Re: just figured out dyak by mochagerl (claw026) on August 19, 2003, 9:51 am

and me too, please?

claw026. thanx:)


singularity by dyak001 (dyak001) on August 27, 2003, 1:09 pm

is that refering to your frame of reference or something else?


by gche043 (gche043) on August 27, 2003, 3:09 pm

me too thanx

gche043


by vpat043 (vpat043) on September 15, 2003, 2:11 pm

hi. can u send it to me as well?




67. paths and logic


paths and logic by dyak001 (dyak001) on August 14, 2003, 6:33 pm

does anyone know what the definition for a path and logic is.

i think logic might involve abstract paths of least uncertainty defining a model which uses both rule based systems of meaning, such as the general language used in outlining attributes and characteristics that are identified within possibly an open system( description ), such as the movement of an object in space in such a way as the language used to precisely outline the general characteristics of the system( structure ) in question in a scientific manner.( analysis ) such that the general characteristics, variables and attributes of the system provide the path( means ) of least uncertainty in identifying a that system. gee wiz uh huh...sounds like ummm one of those essay thingys, papers that those guru guys write umm gee wiz.....................hey...............................




68. paths and logic


paths and logic by dyak001 (dyak001) on August 14, 2003, 6:51 pm

gee let me get this straight, if we talk about a paricular way we just describing the system using general language.o.k. that's fairly basic, got that bit.

.a couple of questions then about logic and reasoning for dijkstra and floyd..

.how do we identify the difference between case base reasoning and structural aspects of logic within various modes or processes?

o.k. we've got open systems which are dynamic and have dynamic states, some non-deterministic systems...o.k. so far so good

.and we've got closed systems which have static states, where processes dictate sequential step by step operations which are triggered while the process is in operation..such as recursion..and deterministic systems and some non-deterministic systems...

.some non-deterministic systems models attempt to simplify complex real world systems which otherwise might not be able to be understood using any other methodologies and/or techniques....syetms such as those used in mathematics, physics or biology....( fuzzy systems etc )

some non-deterministic and deterministic processes for identification and analysis such as those used in computer science, language implementation, all use case base reasoning tools for the processes..??not qite sure but does that sound about right?

.




69. Moderator!


by Jono (jteu004) on August 18, 2003, 10:24 am

I've been deleting posts that are blatantly off topic (although it is best to err on the side of caution, rather than delete a possibly valid question). If you don't like anything else posted, just be patient. Topics that are irrelevant will not be replied to and thus will sink to the bottom of the forum.
Survival of the fittest.

Jono.


Moderator! by knack (pduf006) on August 14, 2003, 11:27 pm

please kill dyak001 so that the forum doesn't completely fill up with sh^h^hrubbish




70. mram021 - I have your disk


mram021 - I have your disk by SamD (sdan017) on August 16, 2003, 1:34 pm

Hi
I found a disk belonging to Manasa Ramakrishna in the stage 2/3 labs over the weekend. If you're Manasa then please let me know what you want done with it.
You can email me at sdan017@ec.auckland.ac.nz
Thanx
-SAM-




71. converting dfa and nfa


converting dfa and nfa by dyak001 (dyak001) on August 26, 2003, 3:47 pm

could someone tell me why a regular expression from a dfa which accepts a string 10 and the nfa with the regular expression which accepts the string 10(10)* as in the example in the lecture on friday is an nfa. O.K. it has kleene closure by adding the cycle as a part of the regular expression, but when you convert the dfa to nfa form you get the same machine without the closure. There is only one start state in both and although there closure of the language L, allows a subset of strings 2Q with the nfa and the dfa doesn't, what actually makes it an nfa and not a dfa. Is it just the 2Q regular expression with kleene closure. What if we have machine with more than one start state but no Kleene closure. ALike one that accepts the regular extression 10 ||( e + (10) )...where e is the empty expression and the lhs != rhs. i.e. accept states for the strings are different.


by asheltie (ajoh064) on August 28, 2003, 10:34 am

well if you go to tutorials we covered the empty string, it only works if the start state IS also an accepting state.
and if you went to the lectures we saw a ....||..... language being converted from NFA to DFA.
[quote:2d9d503784]
What if we have machine with more than one start state but no Kleene closure. ALike one that accepts the regular extression 10 ||( e + (10) )...where e is the empty expression and the lhs != rhs. i.e. accept states for the strings are different.


thus, concern about clean closure seems mis-directed here, aproximately


72. q2 & q3 ass2


q2 & q3 ass2 by dyak001 (dyak001) on August 29, 2003, 2:15 pm

I don't have a copy of the exercises in the course book for q2 & q3 and was wondering if someone could post a copy?

cheers




73. q1 e,f dfa


q1 e,f dfa by dyak001 (dyak001) on August 29, 2003, 2:48 pm

1 e
what does he mean there is no dfa that accepts the language L={0^n 1^2n | n>=0}, what about if we have something similar to his answer on friday with the b^3n then we get L={ 0^n 1^2n | n >=0 }, contains the subset of the dfa... 0*1*


phew!!
1 f
what does he mean only a prime number of 0's




74. q1 a all words with 3k b's


q1 a all words with 3k b's by dyak001 (dyak001) on August 29, 2003, 3:11 pm

what doea that mean??if we only have some characters like a,b,c for our alphabet then where is the integers in the language L={}. Can we have like 2K a's as a part of the language and 0k c's aswell? or does it have to exactly match the 3k b's....?so does that mean we can only have the language that exactly matches L={a*(3(nb))*)c* | n >=0} || L={a*(nb)*c* | n/3 is a whole number W >=0 } is that the form that the form we should express it in when outlining the logic? I think I'm still not quite sure when a dfa is a dfa and not an nfa or does it matter??is an nfa always convertible to a dfa? or never? Strictly speaking if we convert the nfa to a dfa is it the same machine? these and many questions more///////////




75. saving time 230


saving time 230 by dyak001 (dyak001) on August 29, 2003, 3:22 pm

just to save time I thought I'd post this in 220 forum... has anyone finished the assignment yet?...how long did it take? if it took you like more that a week, can I have a copy, my girlfriends really on my case about spending some more "quality time" with her. I know some of you geniouses/ers who can wiz through this stuff might be able to help me out? She(my girlfriend ) is beginning to think!! that the computer is more important to me than her....


thanks Serge




76. Anyone knows how to create a pdf file?


Anyone knows how to create a pdf file? by Blah (zshi005) on August 29, 2003, 4:14 pm

As stated in the title...


Re: Anyone knows how to create a pdf file? by hrh (rhua009) on August 29, 2003, 4:32 pm

I want to ask the same question~~~~~


Re: Anyone knows how to create a pdf file? by shurik (apry004) on August 29, 2003, 7:09 pm

try to change extension


by knack (pduf006) on August 29, 2003, 7:17 pm

haha i wouldnt

you can do it at uni i think

or find a program on the net, use google


by shurik (apry004) on August 29, 2003, 8:38 pm

why not?


by knack (pduf006) on August 30, 2003, 6:54 pm

cos changing the extension of a txt file or word document does not convert the format, of course..

it won't work, adobe acrobat will say 'error opening file' or something

try it and see


by skal011 (skal011) on August 31, 2003, 11:41 pm

to create a pdf file......we need to use pdf writers.................
pdf writers are shareware!
can the lecturer re-think this submission criteria please!


by jlin093 (jlin093) on September 5, 2003, 4:03 pm

To create PDF file you need to install software called Arcobat (NOT Arcobat Reader) which you NEED to buy(VERY EXPENSIVE or you can download from web, hope your guys can find it...^_^ ).


by DannoNZ (dhaw022) on September 7, 2003, 12:23 am

jlin093 wrote:
  To create PDF file you need to install software called Arcobat (NOT Arcobat Reader) which you NEED to buy(VERY EXPENSIVE or you can download from web, hope your guys can find it...^_^ ).


Hmm it seems this assignment is encouraging illegal activity already... :(


by fez (jbro179) on September 7, 2003, 3:27 pm

they wouldnt make us buy stuff, maybe its on the 101 CD, I saw some acrobat stuff there.


by chsi021 (chsi021) on September 9, 2003, 9:06 pm

http://www.pdf995.com/download2.html
This one converts to pdf from any file format


by tmevo6 (cwon093) on September 11, 2003, 5:16 pm

Anyone who use a Mac will be able to create PDFs easily as this function was built-in to the OS.

If you don't use Mac and don't want to install softwares into your computer, you can create PDFs online at Adobe's web site. Here is the link:

http://createpdf.adobe.com/?v=AHP

Sing up for a free trial and you can create 5 free PDFs.

Hope these helps.


by The Fri (gmar086) on September 13, 2003, 5:34 pm

You can also try using the program on our 220 resources page

says and I quote

[quote:eebbef5674]
for drawing graphs and automata in pdf format



You just gotta get my head around using the damn thing.


77. ass2


ass2 by shurik (apry004) on September 4, 2003, 12:39 pm

For the regular expansions after the expanding we need to draw DFA and NFA. Do we need to draw them with brackets or without them

part1

1 to 1 with (ab|c) as a loop

or

with open brackets (expanded brackets)
1 to 2 is a
2 to 3 is b
and so on...




78. question about notation '|'


question about notation '|' by jlin093 (jlin093) on September 5, 2003, 4:09 pm

hi, guys, can someone explain what '|' means?

Does it mean union?

here is example "a|ab".


Re: question about notation '|' by shurik (apry004) on September 5, 2003, 5:07 pm

jlin093 wrote:
  hi, guys, can someone explain what '|' means?

Does it mean union?

here is example "a|ab".


it means a and ab
| is a plus

eg
(a |ab)(ccc|d) = accc ,ad,abccc, abd

hope this helps its like maths




79. Assignment One Q2


by shurik (apry004) on September 9, 2003, 3:40 pm

I dont really rem coz i was changing it a lot but i think
like in the text file and then i put my name id and upi after the numbers


by Jim (jshe081) on September 9, 2003, 3:31 pm

hut wrote:
  mine is as below. and i got full mark for this part.

0 1 2
0 0 0
0 -3 0

our difference is only that my total weight is 0 while yours is 1. i do not think it is fair to mark yours as wrong actually.


Did you put just that in the text file you submitted or this

3
0 1 2
0 0 0
0 -3 0
0


Assignment One Q2 by Jim (jshe081) on September 7, 2003, 11:46 am

can someone who got full marks display there answer, or can someone else tell me why this is wrong, thanks

0 1 2
0 0 0
0 -2 0


by fez (jbro179) on September 7, 2003, 3:30 pm

yeah id be keen for that too, didnt really know what i was doing on that question but I thought I had it right


by asheltie (ajoh064) on September 7, 2003, 3:50 pm

i submitted that matrix and got full marks - lol

but then my marker wrote this,
[quote:cf8a6b4506]
Your programs were TOO fast. (I am sure, this is because your program produced the short, yet WRONG answers!)


and still gave me 91% - ???? go figure

i thought capitals were deemed shouting ??? is that normal behaviour for markers

by hut (twan029) on September 7, 2003, 7:46 pm

mine is as below. and i got full mark for this part.

0 1 2
0 0 0
0 -3 0

our difference is only that my total weight is 0 while yours is 1. i do not think it is fair to mark yours as wrong actually.


by shurik (apry004) on September 8, 2003, 9:22 am

ok then what's wrong with my one

0 1 1
0 0 0
0 -2 0


by asheltie (ajoh064) on September 8, 2003, 4:29 pm

looks okay, i didn't think you had to give a result less than zero. just show that the algorithm will not pick the least weighted option.
In all the cases here that seems satisfied.
get it remarked,
altho sum markers deduct more for annoying them a 2nd time.


by shurik (apry004) on September 8, 2003, 10:06 pm

i got 0 for this,

Can i ask for remark or smth?


Re: Assignment One Q2 by christian (celv004) on September 9, 2003, 10:32 pm

Jim wrote:
  can someone who got full marks display there answer, or can someone else tell me why this is wrong, thanks

0 1 2
0 0 0
0 -2 0


I got full marks for this:

[code:1:384aa920e6] 3
0 1 2
0 0 0
0 -2 0
0[/code:1:384aa920e6]

Christian


by hut (twan029) on September 10, 2003, 1:52 am

Jim wrote:
  
Did you put just that in the text file you submitted or this

3
0 1 2
0 0 0
0 -3 0
0


yes, with the nodes number 3 and closure 0.




80. marking schedule for assignment 1


marking schedule for assignment 1 by hut (twan029) on September 7, 2003, 2:17 pm

hi, does anyone know where i can find the marking schedule for assignment 1? i got an unexpected low mark. really wanna find out what is going on.

thanks!

(or if some tutor has it, could you please send me a copy? thank you very much! my email is twan029@ec.auckland.ac.nz)


by hut (twan029) on September 7, 2003, 7:30 pm

have contacted with the marker and it has been fixed.

but still have question about my updated mark.




81. Assignment 1 mark


Assignment 1 mark by yren004 (yren004) on September 7, 2003, 5:28 pm

what u guys got for assignment 1?
they deducted me 15 marks for speed!
how's u guys?


by chsi021 (chsi021) on September 9, 2003, 11:47 am

Somehow I have this feeling that assignment 1 was badly marked!
not saying it's markers fault or anything, maybe it was the inconsistent marking schedule??

If possible, could we please get a copy of the marking guidelines/ requirements, and the testing samples. Not just for the marks, but for the sake of knowing what is actually the expected knowledge from us!

But then again.......... I suspect any tutor/ Mark Wilson will see these posts at all.........


Re: Assignment 1 mark by christian (celv004) on September 9, 2003, 10:28 pm

yren004 wrote:
  what u guys got for assignment 1?
they deducted me 15 marks for speed!
how's u guys?


I got 99 of 100 so I'm pretty happy!

Christian


by hut (twan029) on September 10, 2003, 2:09 am

chsi021 wrote:
  Somehow I have this feeling that assignment 1 was badly marked!
not saying it's markers fault or anything, maybe it was the inconsistent marking schedule??


yes, i have the feeling too(but not only this assignment.). actually i got zero for question 1 at first. then i contacted my marker and he sent me the test input and sample output. mine is the same except the first digraph ONLY which i think the sample output is wrong. (i posted that in my another thread.) anyway, when i got my updated mark, i still got TWO wrong outputs somehow. and then, no reply for my enquiry any more. i think maybe i must have caused too much trouble.

i also think we should get the mark schedule posted. is there any one knowing who is supervising the assignment marking? thanks!




82. a question relevant to assignment 1/question 1


a question relevant to assignment 1/question 1 by hut (twan029) on September 7, 2003, 7:54 pm

if there is a matrix having only one entry, 1. does that mean that is a digraph which has only one node and there is a loop which weights 1?then, the shortest distance from this node to itself should be 0? or 1?

thanks!


p.s.
the digraph in the standard format is:
1
1
0




83. sample answer


sample answer by jzho020 (jzho020) on September 10, 2003, 9:31 am

can we have the sample answer for assignment 1? it's good for us to have a look at the code because we could improve our skill by doing that. If we are allowed to have get the sample answer, that will be great.




84. The reason why 220 is so ....xxx? (marker??)


The reason why 220 is so ....xxx? (marker??) by zerodays (dlee064) on September 11, 2003, 5:44 pm

hm.... sorry about this hassle.

-------------------------------------------------------------------------------
assignment get marked by different markers, thats cool

we do the assignment differently. thats cool

marker marks the assigment. thats right

depending on who the marker is. that is how lucky you are,

you can 15 or MORE marks. thats, 15% of total 8.333% even though the Answer were same. especially for Q2 in Ass1.





So anyone who put 4 nodes in Q2 should get 25 Marks. not 10


Re: The reason why 220 is so ....xxx? (marker??) by shurik (apry004) on September 11, 2003, 5:55 pm

What bout 3?


by zerodays (dlee064) on September 11, 2003, 6:25 pm

for Q3, yes, yes assuming the answer we put are exactly like in the sample style, and right.
there shouldnt be any reason for deducting.



for Q2, given a valid answer that Dijsktra won't work for Negative matrix with example of 4 NODES, which I and my friend did , exaclty same nodes.... had a different marking result, and i dont mean by 1 or 2 marks.


by christian (celv004) on September 15, 2003, 11:31 pm

zerodays wrote:
  for Q3, yes, yes assuming the answer we put are exactly like in the sample style, and right.
there shouldnt be any reason for deducting.



for Q2, given a valid answer that Dijsktra won't work for Negative matrix with example of 4 NODES, which I and my friend did , exaclty same nodes.... had a different marking result, and i dont mean by 1 or 2 marks.


Why would you use 4 nodes when the assignment asks for the smallest graph you can find showing that Dijkstra doesn't work? Should be easy to do it with 3 nodes....

Christian


by zerodays (dlee064) on September 16, 2003, 9:20 am

4nodes was what i thought of it as shortest path,

i aint here to say 4 nodes is right, but it is closest,

i write becuz of different brain interpretation between markers.




85. Starting Assignment 2


Starting Assignment 2 by fez (jbro179) on September 11, 2003, 8:56 pm

Anyone else having trouble starting this assignment?
Ive read the notes over and over for Automata, still have no idea how to do Q1, Q2 I have attempted, got the NFAs (though one of them came out a DFA and dont know how to get an NFA for it so I guess Im doing it wrong) and am pretty much lost.

Just want to know if anyone else is having trouble


Re: Starting Assignment 2 by shurik (apry004) on September 12, 2003, 8:34 am

Same here i thought i was doing NFA but after reading the notes i realised its DFA.




86. answers to assignment 2


answers to assignment 2 by dyak001 (dyak001) on September 12, 2003, 9:15 pm

now that I have your undevided attention.when is an answer an answer?
An answer is only an answer if it is all I know!! Which means does anyone have a copy of the questions in parts of assignment two that involve exercises from the course book. Gee wiz if you give me the questions I won't tell you my answers!!




87. Answer format for assignment 2


Answer format for assignment 2 by The Fri (gmar086) on September 13, 2003, 5:41 pm

What sort of format are they looking for?

do we have to draw the DFA or is it acceptable to show the starting states, finishing states, transition table, etc?

in otherwords, do we need to represent our answers graphically or textually?


by VAhuja (vahu002) on September 14, 2003, 12:22 pm

Graphically...


by shurik (apry004) on September 14, 2003, 12:33 pm

r u sure coz i was thinking doing it as tables


by jwel027 (jwel027) on September 15, 2003, 11:37 am

I was thinking of an adjacency list


by VAhuja (vahu002) on September 15, 2003, 4:39 pm

Well, if you go to the Assignments page, you will find a link to a tool for drawing graphs. So, I think we have to do it graphically.




88. Ass2 Q1,a --??


Ass2 Q1,a --?? by Jim (jshe081) on September 14, 2003, 12:00 pm

are we treating 0 as a positive integer


by knack (pduf006) on September 14, 2003, 7:26 pm

i believe not.. but i could be wrong :P




89. ass2


ass2 by jwel027 (jwel027) on September 16, 2003, 10:25 am

if we have two regular expressions R1 & R2, sigma = {a,b}

R1 = a
R2 = b*

and we have another regular expression R3

R3 = R1|R2

should R3 accept the empty string because R2 has to?


by VAhuja (vahu002) on September 16, 2003, 10:38 am

In terms of logic, I don't think it should accept the null string.

A U {} = A...


by The Fri (gmar086) on September 16, 2003, 4:34 pm

I view it as R3 = a|b*

so yeah, I would of thought that it would accept the empty string since b^0 is acceptable




90. Comments on Assignment 1 marking


Comments on Assignment 1 marking by Mark Wilson (mwil211) on September 16, 2003, 4:46 pm

Since many people seem bothered by Ass 1 marking, here are the general guidelines given to markers. They are allowed some flexibility in interpretation but should be consistent. If you believe an error has been made in marking, contact the course administrator.

--
For Q1, you should mark 55% on correctness (using testfloyd1) and 45% on speed. Run mine and compare with students. If theirs does not compile and there is no obvious reason that can easily be fixed, give 0. Otherwise deduct 10%, fix, and run.
If they get less than 5/10 right on testfloyd1, they don't get to do speed testing.

Each of testfloyd2, 3, 4 is used for the speed testing, independently. A factor of 5 worse than mine scores 0, and a factor of 0.75-1 scores full marks. You decide the scores for the other ranges .

For Q3, don't be too tough on obvious cut and paste errors but do deduct something for carelessness. Be very tough on anything that is a clear error of logic.

For Q2 they don't need to give any justification why their example works. Choose some decreasing function of n + e that is 1 when n+e=6 and 0 for n+e >=10, and award marks accordingly. If they have a negative weight cycle, give them 0 for the question.

-----


Also, a correct answer for Q2 is

0 1 2
0 0 0
0 -2 0
0

I can make available the test files for Q1 if enough people want them. My solution java program I would prefer to keep. It is not a great example of programming style. I am happy to discuss it individually in office hours with those who care enough about it to come.


by hut (twan029) on September 17, 2003, 1:34 am

thanks for the explaination of the assignment marking!

and i hope we can have the test files for Q1 available. thank you!


by asheltie (ajoh064) on September 17, 2003, 8:55 pm

i am curious and a habitual speed freak so of course i would like to see your java files.
you can still keep them.
your mentioning of the fibonacci heap was a teaser Mark, and you haven;t yet explained it to my 3rd year friends....damn,
hope you're lecturing my 3rd year papers.

if you change your mind about showing your java files call me.


by fshe010 (fshe010) on September 18, 2003, 4:29 pm

yeah,, i really need to see the test file ofr Q1 , because i did some wrong in first question but i still dont know why it was wrong.


by VVTL-i (ocho004) on September 29, 2003, 1:48 am

I too would like to would like you to make Q1 test files available, I hope you still read or forum.




91. what is the meaning of "n"


what is the meaning of "n" by jjin008 (jjin008) on September 27, 2003, 5:55 pm

the relationship between L1 n L2


Re: what is the meaning of "n" by christian (celv004) on September 28, 2003, 1:53 am

jjin008 wrote:
  the relationship between L1 n L2


It's the intersect, which is the parts of L1 and L2 that are equal. So if L1 = {a,b,c} and L2 = {a,d,e} then L1 n L2 would be {a}.

I think.

Christian




92. A2 Q1 (a)


A2 Q1 (a) by byan013 (byan013) on September 18, 2003, 1:44 pm

i confused Q1 (a)
what does 3kb's mean in this question?
can someone understand this question explain to me please?


by byan013 (byan013) on September 18, 2003, 1:46 pm

i have some idea: does it mean we need to build DFA that accepts
multiple 3 times of b (b is the input alphabet) ??


by jwel027 (jwel027) on September 19, 2003, 2:44 pm

yep


by Blah (zshi005) on September 19, 2003, 3:22 pm

Then what does the {a, b, c} stuff mean?


by twinkle_star (vsha026) on September 19, 2003, 4:09 pm

What i understand from the question is that- the input alphabets are gonna be a, b or c (thats why the {a, b, c}). there can be any number of a's or c's. but there is a restriction on the number of b's. the input number of b's should be a multiple of 3, i.e 3, 6, 9...so on.
we have to build a min DFA that accepts inputs like abbbc, abacbbcababcb, but rejects inputs like abb, abc.
hope that helps :)


by jsun027 (jsun027) on September 27, 2003, 11:42 am

About this "3k b" thingee...
Is our DFA only supposed to accept an input that has multiple of three "b"s IN A ROW...or, it doesn't matter where these "b" are, as long as there are mutiple number of three "b"s.

say,
It would certainly accept "abbbc"
Is it supposed to accept "ababcbs" as well, please?


by jbal034 (jbal034) on September 27, 2003, 1:15 pm

[quote:5119cf6eca] we have to build a min DFA that accepts inputs like abbbc, abacbbcababcb, but rejects inputs like abb, abc.
hope that helps :)



well does that mean that the b's can be anywhere caz from what i understood it could be like this for eg.. abbbbbbca like 3k b's continiously...

could some one please clarify me on this.. thx :)

by christian (celv004) on September 27, 2003, 2:31 pm

jbal034 wrote:
  [quote:458b8d5c8a] we have to build a min DFA that accepts inputs like abbbc, abacbbcababcb, but rejects inputs like abb, abc.
hope that helps :)


well does that mean that the b's can be anywhere caz from what i understood it could be like this for eg.. abbbbbbca like 3k b's continiously...

could some one please clarify me on this.. thx :)


I think the machine is supposed to handle 3k b's, whether they are consequtive or not. That means it's supposed to handle, abbba, abbbc, bbb, bbbbbb, ababab, or simply any word containing a multiple of 3 b's...

Christian


93. Go to the following room for the test on 25 Sept


Go to the following room for the test on 25 Sept by Mark Wilson (mwil211) on September 18, 2003, 2:29 pm

Building:109(General Library), Room:B10---> Family Name: A ~ D
Building:115(Lower Lecture Theater), Room:201---> Family Name: E ~ L
Building:109(General Library), Room:B15---> Family Name: M ~ T
Building:115(Lower Lecture Theater), Room:308---> Family Name: V ~ Z


Please try to get there by 615pm at the very latest. Reading of test starts at 620pm. Test ends 730pm.


by tmevo6 (cwon093) on September 18, 2003, 10:12 pm

Can anyone please tell me where Rm 308 of LLT is?

Thx so much


by shurik (apry004) on September 18, 2003, 10:16 pm

i think its just LLT


by tmevo6 (cwon093) on September 18, 2003, 10:33 pm

I was thinking about that too, but I noticed that:

[quote:c852c92e98] Building:115(Lower Lecture Theater), Room:201---> Family Name: E ~ L
Building:115(Lower Lecture Theater), Room:308---> Family Name: V ~ Z



I now think that they are different rooms in a building, am I right?

by shurik (apry004) on September 18, 2003, 10:39 pm

oh true

check the map it got the building numbers, may b one of those rooms is ULT. yea just check the map with biulding numbers.




94. Note on this week's tutorial


Note on this week's tutorial by Jono (jteu004) on September 18, 2003, 3:53 pm

Just remembered a rule that was omitted from the concatenation list...
Rule 1.5 : If a start state of M1 is also an accept state, then the start states of M2 are also start states in M12 (the new automaton).

Cheers,
Jono.




95. (a|b)* and (a*|b*) ??


(a|b)* and (a*|b*) ?? by byan013 (byan013) on September 18, 2003, 4:20 pm

what is the difference between (a|b)* and (a*|b*) ???
are there the same thing??
somebody help please!


Re: (a|b)* and (a*|b*) ?? by christian (celv004) on September 18, 2003, 4:21 pm

byan013 wrote:
  what is the difference between (a|b)* and (a*|b*) ???
are there the same thing??
somebody help please!


I think that would be the same thing....


Christian


Re: (a|b)* and (a*|b*) ?? by shurik (apry004) on September 18, 2003, 4:25 pm

i dont think so

i think (a*|b*) u dont really need brackets so when i expand it i think i woud get this

a,b,aa,bb,aaa,bbb,......


by twirl (mlow026) on September 19, 2003, 1:04 am

they would have to mean different things.
For (a|b)*, the * is the 1st precedence.
So what do you do with the *?
How do you apply Kleenes to the brackets?
We don't have egs in our lecture notes.
I'm guessing you have multiple As and Bs together.
Like aaabaaaabbbbaabababbbaaaa....


by inkeol83 (ikim008) on September 19, 2003, 8:52 pm

(a|ab)* ==> {a, ab, aa, abab, aaa, ababab, .... }
This is what i think but not sure.. have not attended lecture..


by shurik (apry004) on September 19, 2003, 9:24 pm

inkeol83 wrote:
  (a|ab)* ==> {a, ab, aa, abab, aaa, ababab, .... }
This is what i think but not sure.. have not attended lecture..


no its not u need to *
a ab aab aba aaba abaa .....


Re: (a|b)* and (a*|b*) ?? by lance (yhua059) on September 19, 2003, 9:38 pm

byan013 wrote:
  what is the difference between (a|b)* and (a*|b*) ???
are there the same thing??
somebody help please!


No, they are not.

(a|b)* = {a, b}* = {emptyString, a,b,ab,aa,ba,bb,aba........}
(a*|b*) = a* U b* = {emptyString, a,aa,aaa,aaaa,aaaaa.....b,bb,bbb,bbbb,bbbbb......}


by byan013 (byan013) on September 22, 2003, 8:25 pm

i think lance is right


by inkeol83 (ikim008) on September 27, 2003, 3:08 pm

Is Lance perfectly sure?

(a|b)* = {a, b}* = {emptyString, a,b,ab,aa,ba,bb,aba........}

if sure show me exact input strings available..
I dont quiet get your answer..


by jbal034 (jbal034) on September 27, 2003, 6:22 pm

got the same problem here son heh :)

i thinking mad about this..


by jsun027 (jsun027) on September 27, 2003, 4:35 pm

Say lance is right,

[quote:0461a6d350] (a|b)* = {a, b}* = {emptyString, a,b,ab,aa,ba,bb,aba........}



How can we come up with an automaton to handle these inputs?

I can build a machine accepts a, another machine accepts b, put them next to each other, is NFA for a|b. but how to express (a|b )* plz?

by chsi021 (chsi021) on September 27, 2003, 9:44 pm

I think all of these are mentioned in the tutorila... ^.*

so just as a suggestion:
1) make the NFA (a|b ) having same start state.
2) take the closure of that




96. Answer format


Answer format by hrh (rhua009) on September 19, 2003, 10:42 am

In order to answer the Q1, do we need to draw the graph of the DFA/NFA, or we just need to express it in words, like M=(Q={a,b,c}.......)?

Also, if we need to draw the graph, how can we draw graphs in the notepad? anyone can give me an advice?

Anyway, what program r u all using? notepad or ppt?




97. Lan


Lan by Lingario (bsme001) on September 19, 2003, 8:05 pm

Hi all. just to let you know way way in advance.
me and some other people are trying to organise a lan for after the end of year exams. it will be a whole day lan, and the comps will be setup the day before so no hassels

so keep an eye out and try to make it if you can

(¯`·.¸lingario¸.·´¯)


by japt003 (japt003) on September 19, 2003, 10:46 pm

Make sure you get some good stuff and we'll be there.


by japt003 (japt003) on September 19, 2003, 10:53 pm

Make sure you get some good stuff and we'll be there.


by yche276 (yche276) on September 26, 2003, 8:01 pm

what is lan????




98. a|(a|b)*(bc|(ba|ccc)*)* <-- Question!!


a|(a|b)*(bc|(ba|ccc)*)* <-- Question!! by inkeol83 (ikim008) on September 19, 2003, 9:08 pm

tutor was teaching this stuff and divided this fomular
10*(10*10)0*0 into 3 parts..

m1 = 10*
m2 = (10*10)
m3 = 0*0


and concadinated them..

If this is the right way of solving problem than where do I cut from the input?

[code:1:73c2d5f823]
ie) a|(a|b)* (bc|(ba|ccc)*)*
m1 m2[/code:1:73c2d5f823]
Is there any way to diveide m2?


by jwel027 (jwel027) on September 22, 2003, 9:00 pm

inkeol83 wrote:
  If this is the right way of solving problem than where do I cut from the input?
a|(a|b)*(bc|(ba|ccc)*)*

I'd like to know too, as when I was originally working this out, I got this huge machine with 28 nodes where I was working on R1 R2, with

R1 = a|(a|b)*
R2 = (bc | (ba | ccc)*)*


but I found it much easier to work on the expression R1 | R2

R1 = a
R2 = (a|b)*(bc(ba|ccc)*)*


which yielded a machine with just 13 nodes that whittled away to about 7 or 8 nodes after minimization




99. Pseudo vs working knowledge


Pseudo vs working knowledge by SamD (sdan017) on September 22, 2003, 11:52 am

Does anyone know (100% sure) if we will have to know the pseudo code to things like BFS, DFS, Floyd, etc for the test or if we just need to have a working knowledge of how to do everything?
Like, knowing how to do things is easier than knowing the coding steps - so does anyone know which it is?
Thanx




100. Assignment 2 Part 2; follow-on?


Assignment 2 Part 2; follow-on? by DannoNZ (dhaw022) on September 22, 2003, 1:53 pm

For the questions 2-5 of part 2, are these supposed to follow on from each other, or are we supposed to start over each time?




101. Assignment2 due data?


Assignment2 due data? by david (jyue005) on September 22, 2003, 5:35 pm

on the course web page, it shows
Assignment 2 due 26 September 2003

in the assignment dropbox, it shows
COMPSCI.220.C.SS Compsci220 Ass-2 Mon Sep 29 21:00:00 2003

then... -_-''


by ysakaed (yhsi014) on September 22, 2003, 8:53 pm

i am guessing its has been extended :D


by SamD (sdan017) on September 22, 2003, 9:32 pm

Yeah - the assignment due date is Monday - I have an email from Michael Dinneen saying that - so yeah...
Thank goodness!




102. Q) difference between NFA and DFA


Q) difference between NFA and DFA by inkeol83 (ikim008) on September 23, 2003, 1:58 am

I dont know which is which..
If there is more than one starting state than it is NFA
but condition (May have more than one transition for a given character)
I dont understand what it is..
Sum1 explain.. plz


by hotshotec (lchi026) on September 23, 2003, 10:15 am

If i'm not wrong what that means is that for each state, if it has like 2 'a' transitions coming out of it going ot different states then it is an NFA....


by GonePostal (ssto040) on September 24, 2003, 9:37 pm

It means that if you have two arrows going from the node with the same letter, then it is an NFA. Its ok to have more than one outgoing transition as long as each transition represents a diferent letter.




103. error in Q2 4.8.2 (5)?


error in Q2 4.8.2 (5)? by hrh (rhua009) on September 23, 2003, 10:20 am

what's the precedence of "!" ?
the question doesn't mention that~~~


Re: error in Q2 4.8.2 (5)? by christian (celv004) on September 24, 2003, 12:09 am

hrh wrote:
  what's the precedence of "!" ?
the question doesn't mention that~~~


I've noticed that as well and sent a mail to MJD, hoping to get an answer in time...

Christian


by The Fri (gmar086) on September 24, 2003, 10:21 am

Post his response here if you would please.


Re: error in Q2 4.8.2 (5)? by christian (celv004) on September 24, 2003, 4:01 pm

christian wrote:
   hrh wrote:
  what's the precedence of "!" ?
the question doesn't mention that~~~


I've noticed that as well and sent a mail to MJD, hoping to get an answer in time...

Christian


According to the tutor which i asked after the tutoriual today, the "!" has the highest presedence of all the productions.

Christian




104. Stupid PDF


Stupid PDF by Maximum Redg (rred015) on September 24, 2003, 12:04 pm

Having done the assignment on paper, i decided to begin putting it into a PDF file and submit it...

More fool me to think this would be an easy task...

I downloaded the ipe program on the resource page, and after drawing my first answer realised i couldnt get the text i had written in the editor to show up in adobe acrobat reader...

So i sought out other PDF creaters, and downloaded around 5 others, each one requiring administrative rights to install, rendering them absolutley useless...

What the hell is wrong with Word .doc files?
You can draw pictures, import bitmaps, and they actually display the text you have typed in....

Im probably missing something completely obvious that is making my text not appear, but i still think its stupid to have to learn how to use some third party program to create pdf's when micro$oft word is entirley capable of performing exactly the same task!

-Rob-


by mong (zmen001) on September 24, 2003, 12:20 pm

strong agree...change to use Word!!!!!!!!!


by Jill (xche027) on September 24, 2003, 1:26 pm

Agree!!Agree!!
There is no point to put our time on this kind of stuff!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Change it to doc. please!!!!!!!!!!!!!!!!!!!!!!


by VVTL-i (ocho004) on September 24, 2003, 2:35 pm

I agree Maximum Redg! Lets make this into a poll.


by knack (pduf006) on September 24, 2003, 7:28 pm

yes, the more exclamation marks you put, the more people will see your point of view

:p

anyway, i guess the reason pdf was chosen is cos it's portable.. not all the markers use windows and office i am guessing (shock horror)

it is a bit of a bugger to make them though, esp. if you havent before (i havent)

i would prefer to have this be a paper assignment.. it would be so much easier to hand in a sheet of refill


by Maximum Redg (rred015) on September 24, 2003, 7:34 pm

Has anyone figured out how to make text appear in the pdf using that sh*tty editor that is on the resource page?


by VVTL-i (ocho004) on September 24, 2003, 7:41 pm

Have u tried downloading a warez Adobe PDF Writer already?

And does anyone know the answer to my thread question below this one? (Test Coverage)


by lance (yhua059) on September 24, 2003, 7:43 pm

download pdf995
use Word, then "print" to .pdf file.


by Ultrafilter (tzha022) on September 24, 2003, 8:14 pm

If you're using computer in the lab, you could print the file to .ps then convert it online with ps2pdf.com (MS Word will print your .doc to a .upf file or something like that, you need to change the ext name to .ps manually).
Also, MS Visio on CS dept's computers is very handy when dealing with automata.


by Maximum Redg (rred015) on September 24, 2003, 8:19 pm

[quote:c883cc3e3e] I agree Maximum Redg! Lets make this into a poll.



Dammit, they disabled the ability to create poll topics in this forum...

Damn shame too :)

BTW Thx, ill try the ps2pdf now....

-Rob-

by Blah (zshi005) on September 25, 2003, 10:08 pm

Stop guys. There is an easy way to convert your word file to pdf file.
[url] http://web.com.auckland.ac.nz/services/student/studentpdf.htm[/url]
Check the above link and you will all be on the spot...


by fever691 (yyan050) on September 26, 2003, 8:56 am

umm...isn't that service for students with access to the business school computers?


by yche276 (yche276) on September 26, 2003, 7:29 pm

do we have to use com school computer???


by Blah (zshi005) on September 26, 2003, 8:04 pm

I got the r drive from the cs lab anyway. I am not sure whether others got that as well:P




105. Test coverage


Test coverage by VVTL-i (ocho004) on September 24, 2003, 5:57 pm

Hello fellow hardworking students,

Can somebody who knows tell me, if Mark's section for our test include (and automata theory) would be within the test material.

If someone can point out what includes and excludes, that'll save my day!

Thank you all~

VP1


by Maximum Redg (rred015) on September 24, 2003, 8:11 pm

Hmm, check your email, i got one from Mike a couple of days ago clearing this up, i deleted it... but i think it was something along the lines of that there will only be automata theory, and not the stuff hes been doing with parse trees and grammar....

i think.....




106. Test Times...


Test Times... by chsi021 (chsi021) on September 24, 2003, 10:17 pm

[color=darkblue:5a565c5420] This is from another thread........[/color:5a565c5420]

[quote:5a565c5420="Mark Wilson"]
Please try to get there by 615pm at the very latest. Reading of test starts at 620pm. Test ends 730pm.


[color=darkblue:5a565c5420]
Umn......... just wanna make sure, is the test really [size=18:5a565c5420]
or count the reading time in from 6.20??

only goes for an hour???

On the course web page under [/color:5a565c5420] [color=indigo:5a565c5420] "Tests and Exams" [/color:5a565c5420]
it indicated the test is [color=red:5a565c5420] 6-8 pm[/color:5a565c5420] .......

[color=olive:5a565c5420] I'm so confused...............[/color:5a565c5420]


107. Do we have the lecture today?


Do we have the lecture today? by Bigbear (hyan052) on September 25, 2003, 12:28 pm

Do we have the lecture today?


by byan013 (byan013) on September 25, 2003, 1:54 pm

no




108. COMPSCI.220FT Graph Q1


COMPSCI.220FT Graph Q1 by Bigbear (hyan052) on September 25, 2003, 2:01 pm

1. Write down the strong components of the digraph whose adjacency
lists representation is given below.
0: 2
1: 0
2: 0 1
3: 4 5 6
4: 5
5: 3 4 6
6: 1 2
ANSWER:
{1, 2}, {3, 4, 5}, {6}


Where is the node 0?
i think the answer should be {0,1,2} {3, 4, 5}, {6}


by bhavik (btha002) on September 25, 2003, 3:41 pm

yes ur right




109. qu2 ass 2


qu2 ass 2 by jwel027 (jwel027) on September 26, 2003, 1:00 am

is the unary production a recursive one? I've got something like

<this> -> -<this> | <next> (thats a minus sign at the front of <this>)

and by this production, I should be able to parse something like -------4 as a valid string. I think it should be like

<this> -> -<next> | <next>

where the next production should catch stuff like bracketed expressions and the root production and things like that. Any advice, anyone?




110. a|(a|b)* =


a|(a|b)* = by christian (celv004) on September 26, 2003, 3:01 pm

is it: {es, a,b,aa,bb,aaa,bbb,....,}

or: {es, a,b,aa,bb,aba,bab,abab,baba,....,}

es = empty string.

Anyone who knows?

Christian


by jwel027 (jwel027) on September 26, 2003, 4:06 pm

I think it's the latter because the (a|b)* term on the right picks up basically every combination of a's and b's in the language that the "a" on the left doesn't (assuming sigma is {a, b}) including the empty string.




111. 4.8.4 Q5


4.8.4 Q5 by HHS (hhua058) on September 29, 2003, 11:21 am

What is the meaning of "#" and x#y?




112. IPE!!!!


IPE!!!! by yche276 (yche276) on September 26, 2003, 7:28 pm

I saved my work as a PDF file in IPE. But the adobe reader can not open it!!!! Some one help me please!!!!


by mong (zmen001) on September 26, 2003, 8:22 pm

that is y I suggest to change Word to submit lo..if someone wish..convert them by theirself lo..they know how to convert to PDF anyway...><!!


by mong (zmen001) on September 26, 2003, 9:06 pm

sorry to say that lo..finally I got mine one converted succesfully...good...hoho


by shurik (apry004) on September 26, 2003, 9:48 pm

how did u manage that?


by mong (zmen001) on September 27, 2003, 10:52 am

just like someone said on the forum..go to adobe web site and click free trial..apply one account..then u can convert 5 free .pdf document lo..hahha..that works.......




113. I am soooooooo confused by (a|bc)*


I am soooooooo confused by (a|bc)* by inkeol83 (ikim008) on September 27, 2003, 2:59 pm

this confuses me because many different thoughts are on forum and I think is correct but still not sure!!
I want to know the true answer for it..
I might have drawn wrong automata for all questions..


by chsi021 (chsi021) on September 27, 2003, 9:48 pm

yes the regx (a|bc)* means something like

aaaaabcbcaaaabcbc

ie. any number of a's and any numbers of bc's in any order for any number of times.

you can think of it this way,
1) choose from either a or bc
2) do as many times of 1) as you like!

HTH ^^




114. about ((ba|ccc)*)*


about ((ba|ccc)*)* by jjin008 (jjin008) on September 27, 2003, 4:33 pm

i am confuse about this , who can give me a regular expressions




115. About Question 3.3


by jbal034 (jbal034) on September 27, 2003, 6:21 pm

i agree [quote:fa9e0df82c] It's the "|" .


About Question 3.3 by Blah (zshi005) on September 27, 2003, 5:05 pm

Does anyone know what the "+" sign denote for? Does that mean the "|" operator or the actual plus operator?
Cheers!


by VAhuja (vahu002) on September 27, 2003, 5:31 pm

It's the "|" .


by fez (jbro179) on September 28, 2003, 3:13 pm

Me too
While on the topic of Q3, im confused about part 1, not sure how to display whitespace in context free grammar. Any examples I can look at? (Ive already googled, didnt get much)


by asheltie (ajoh064) on September 28, 2003, 4:16 pm

maybe you did get an answer - but it was white space so you missed it?




116. (bc|ba|ccc)* and (bc|(ba|ccc)*)*


(bc|ba|ccc)* and (bc|(ba|ccc)*)* by jsun027 (jsun027) on September 27, 2003, 10:06 pm

As long as inputs are concerned, wot is the difference between automata (bc|ba|ccc)* and (bc|(ba|ccc)*)* ?
They accept the same set of inputs. don't they? plz?


by VAhuja (vahu002) on September 28, 2003, 11:02 am

They are not the same...You can refer to a previous post with a similar question..




117. What is the point of a|(a|b)*(bc|(ba|ccc)*)*?


What is the point of a|(a|b)*(bc|(ba|ccc)*)*? by gche043 (gche043) on September 28, 2003, 12:49 am

Let me ask all of you, do you think it will be any point of making this automaton? i manage to get the answer (i hope i did) and its this long a$$ DFA i also had the pleasure of minimising.

What is the whole point of doing this? so that i can waste a whole day of my life trying to figure a pointless stuff... i think the previous 2 automata will give me enough practice... it is boringly easy unlike most of the other assignments where there would be some kind of challenge.

I think this is the equivalent of copying out a page out of the compsci text for a 100 times.




118. Question about NFA and DFA


Question about NFA and DFA by inkeol83 (ikim008) on September 28, 2003, 1:05 am

_____|__1___ |__2____<-- inputs
__a__|_empty_|__b___
__b__|___c___|__a___
__c__|___a___|__b___

this is transition table and there is a --1--> empty
Than is that not DFA? so NFA?

Or transition going to Empty state doesn't matter for finding out which Finite Automata it is?


Re: Question about NFA and DFA by christian (celv004) on September 28, 2003, 1:56 am

inkeol83 wrote:
  _____|__1___ |__2____<-- inputs
__a__|_empty_|__b___
__b__|___c___|__a___
__c__|___a___|__b___

this is transition table and there is a --1--> empty
Than is that not DFA? so NFA?

Or transition going to Empty state doesn't matter for finding out which Finite Automata it is?


I think you can have an empty state in a DFA, it just means it is a not very usable machine.....You need to put the empty state in the transition diagram, though.

Christian




119. 4.8.2


4.8.2 by lance (yhua059) on September 28, 2003, 2:33 am

are we expected to give grammers which always extend privious questions?
i.e. question 5 extends 4
4 extends 3
3 extends 2
2 extends 1


by VAhuja (vahu002) on September 28, 2003, 12:39 pm

I think the questions are independent of each other...


by shurik (apry004) on September 28, 2003, 12:59 pm

i think they extend each other


by jsun027 (jsun027) on September 28, 2003, 7:12 pm

Each grammar should based on the its previous one.
We can tell that from the 4.8.2.5. The example contains comparison operators, which should be added to our grammar in 4.8.2.3
That's what I think.


by The Fri (gmar086) on September 28, 2003, 8:56 pm

Great minds think alike


by recah (ichi007) on September 28, 2003, 10:27 pm

[quote:906a65fc4c="The Fri"] Great minds think alike


each q extends the previous one :)

by yren004 (yren004) on September 29, 2003, 1:27 pm

Agree...




120. 4.8.2 Q5


4.8.2 Q5 by byan013 (byan013) on September 28, 2003, 5:20 pm

do we need to do Q5 on 4.8.2 ??
the question has a * on it


by The Fri (gmar086) on September 28, 2003, 6:01 pm

You mean 4.8.4?

Im assuming we do, since the assignment specs say Sesction 4.8.4 (1-5) and not (1-4)


by byan013 (byan013) on September 28, 2003, 6:08 pm

yes
i mean 4.8.4 Q5
maybe we do not need to do it , is it?


by jbal034 (jbal034) on September 28, 2003, 8:03 pm

[quote:5b6816c46b] Im assuming we do, since the assignment specs say Sesction 4.8.4 (1-5) and not (1-4)




121. where should "!" be??


where should "!" be?? by pump (jbai034) on September 28, 2003, 7:41 pm

the last part of Q2 didnot mention the level of "!" related to other operators, who konws where it should be?


by The Fri (gmar086) on September 28, 2003, 8:47 pm

There was a previous post regarding this

[url] http://forums.cs.auckland.ac.nz:8181/viewtopic.php?t=7532[/url]




122. Q1 (e)


Q1 (e) by ceostin (mlee113) on September 28, 2003, 8:44 pm

anyone done 1. (e), could you gimme some ideas how to do it?
also stuck in (f) & (g). thanks


by The Fri (gmar086) on September 28, 2003, 8:51 pm

For Questions e and g, theres bits in the course book about these issues. Once you understand question e, I think u might get a better understanding of how to solve f.




123. pdf


pdf by jzho020 (jzho020) on September 29, 2003, 12:49 pm

can we find a scanner at Uni?? where??


by yren004 (yren004) on September 29, 2003, 1:25 pm

there're some in Tamaki lab.


by jbal034 (jbal034) on September 29, 2003, 2:14 pm

there are some scanners in the basement of the new computer science building..




124. For Question1.c)


For Question1.c) by inkeol83 (ikim008) on September 29, 2003, 1:52 pm

Do I lose marks for not putting transition table?


by fshe010 (fshe010) on September 29, 2003, 3:26 pm

no. as long as your minimized graph is right




125. anyone can give a hint for 4.8.4 Q5?


anyone can give a hint for 4.8.4 Q5? by hrh (rhua009) on September 29, 2003, 5:23 pm

anyone can give a hint for 4.8.4 Q5?
thanks




126. IPE and Latex


IPE and Latex by drflower (dflo006) on September 29, 2003, 8:05 pm

From the IPE homepage download section: "It includes everything you need to run and use Ipe on Windows"

They don't mention they you need Latex, and they don't mention that to use Latex you need Tex or something. Without this thing, it won't convert any text into the PDF files. Just lots of arrows and circles.

Anyone managed to get IPE to convert the text ? Anyone know how to actually download Latex, or what the problem is ?

?????




127. Leftover lecture and assignment handouts ....


Leftover lecture and assignment handouts .... by Burkhard (bwue001) on September 30, 2003, 7:37 pm

... can be found in the boxes in the staircase opposite to the resource centre (basement of the science centre).

If you didn't go to the lecture please pick up a copy of the handouts as soon as possible.

Note that I won't give handouts for the remaining lectures since the content is covered in the course book. However, the lectures might give additional examples and some other useful information so it's a good idea to come to the lectures and to read the handouts :-)
Copies of the lecture and assignment handouts can be found on the 220 web page.

Hope you enjoy this course :-)
Burkhard




128. Change of lecture theatres


Change of lecture theatres by Burkhard (bwue001) on September 30, 2003, 7:54 pm

Because of the Vice-Chancellor's Robb Lecture Series the COMPSCI 220 lecture moves on Tuesday the 14th October, Thursday the 16th October and Tuesday the 21st October (5-6pm) from LLT to PLT1.

Cheers,
Burkhard


by asheltie (ajoh064) on October 2, 2003, 8:11 pm

your lecture 2day was interesting.

just wondering about the ray-tracing

has any1 made algorithms so people with bad eyesight can see images on a PC screen clearly ??

does the idea sound possible at all?


by knack (pduf006) on October 3, 2003, 6:07 pm

.. how would you do that with raytracing? i missed the lecture (sorry) so perhaps i missed something interesting


by asheltie (ajoh064) on October 4, 2003, 12:34 am

he mentioned ray-tracing and how it resembles the way we see things in reality, but applied in reverse order.
Instead of the light reflecting off objects and into our eyes, ray-tracing sends a ray out to the object........

i just thought that if it resembles the way things are seen then surely sum1 has altered the algo's to resemble the shortcomings of people with sight problems.


by Burkhard (bwue001) on October 4, 2003, 1:35 pm

asheltie wrote:
  just wondering about the ray-tracing
has any1 made algorithms so people with bad eyesight can see images on a PC screen clearly ??

does the idea sound possible at all?


An interesting question :-)
I haven't seen any research papers about this topic. In principal it is possible but there are practical limitations.

For example, assume we have an observer with a lens distortion (e.g. short sightedness). For a given focal point, say the centre, of the image it is possible to trace the rays is such a way that the resulting (distorted) image compensates for the lens distortion of the observer. However, if the look-at point of the oberver changes, say he/she looks at a corner of the image, then this wouldn't be the case anymore. So what you really want to have is an image which dynamically distorts according to the look-at point of the observer.

The above described idea is however useful in another applications, i.e. the correction of images obtained with low quality cameras (such as web cams). Since the lenses of such cameras are usually of very low quality they produce a distorted image. Using a test scene it is possible to develop a transformation which corrects the web-cam image.
Sounds like a good stage 3 project :-)
(Actually there are many papers on this topic but it's a useful topic and has an acceptable difficulty)

Cheers,
Burkhard


by asheltie (ajoh064) on October 4, 2003, 6:33 pm

i'm doing a Logic and Computation degreee.
And hoping to do a Compsci honours.
If i do 372 and 375 perhaps i would be better equipped for this kind of project for 780? - does that sound feasible?????

I am already doing a 380 project this summer (converting CECIL into wap so students can use their phones to access grades etc.....:-)


by Burkhard (bwue001) on October 4, 2003, 8:37 pm

asheltie wrote:
  i'm doing a Logic and Computation degreee.
And hoping to do a Compsci honours.
If i do 372 and 375 perhaps i would be better equipped for this kind of project for 780? - does that sound feasible?????

In order to do a Computer Graphics project I usually expect that that a student has done 372 and passed with B+ or better (exceptions are possible). In some circumstances I allow students to do 372 and a 380/780 project at the same time but in general I recommend to do 372 first.
375 is not necessary to do a Graphics project but it is very useful if you want to do a project which involves both Computer Graphics and Computer Vision. I think Computer Graphics and image processing fit quite nicely into your degree so unless there are some regulations which prevent you from doing this I think it's a good idea to do these courses :-)

See you,
Burkhard




129. Big O (Tutor, please tell me)


Big O (Tutor, please tell me) by jzho020 (jzho020) on October 3, 2003, 1:27 pm

what's the big O for the following two loops?
[color=red:2a34bb6438] 1)[/color:2a34bb6438] for (int i = 0; i<1000;i++)
System.out.println("Kill me");

[color=red:2a34bb6438] 2)[/color:2a34bb6438] for (int i = 0; i< 1000; i++){
for(int j = 0; j< 1000; j++)
System.out.prinltn("Kill me");
}


by jwel027 (jwel027) on October 3, 2003, 2:24 pm

aren't they both O(1)?


by asheltie (ajoh064) on October 3, 2003, 2:25 pm

i'm not a tutor but these r too easy that the real tutor probably won't bother answering
O(1)
O(1)

altho the 2nd one will actually be O(0), unless u fix the error with your println() statement


by shurik (apry004) on October 3, 2003, 2:34 pm

why


by knack (pduf006) on October 3, 2003, 6:10 pm

i would have thought they were O(n) and O(n²)
assuming you meant that 1000 to represent n..


by jzho020 (jzho020) on October 4, 2003, 1:48 am

knack wrote:
  i would have thought they were O(n) and O(n²)
assuming you meant that 1000 to represent n..

One of my friends at other University said that he was told the big O for the previous questions are O(1) (bothof them) by his tutuor. I am a bit confused , that's why I asked such a simple question.


by Burkhard (bwue001) on October 4, 2003, 1:48 pm

jzho020 wrote:
   knack wrote:
  i would have thought they were O(n) and O(n²)
assuming you meant that 1000 to represent n..

One of my friends at other University said that he was told the big O for the previous questions are O(1) (bothof them) by his tutuor. I am a bit confused , that's why I asked such a simple question.


We will talk about the "Big-Oh" notation in the next lecture. If you have a look into the course book you will see that the "Big-Oh" notation captures the running time of an algorithm with respect to a constant factor, i.e. g(n)=O(f(n)) is there are two constants c and n0 such that g(n)<=c*f(n) for all n>n0.

If your loop takes one thousand steps then choose f(n)=1, n0=1 and c=1001 and you have t(n)<=c*f(n) for all n>n0. This means the loop is O(1).

Similarly you get the same result for the double loop above since both loops have a constant number of steps.

Of course if you change 1000 to n then you get indeed O(n) for the single loop and O(n^2) for the double loop.
You can verify very easily that O(1) doesn't work in that case: let's say the single loop has a running time of T(n)=c*n.
Then there are no constants c1 and n0 such that c*n<c1*1 for all n>n0.

In order to proof that the loop is O(n) you can choose c1=(c+1) and n0=1:
c*n<(c+1)*n for all n>1, i.e. a single loop with n steps and a constant number of steps in the loop body has the time complexity O(n).

Hope that helps,
Burkhard


by Cannabis (chua031) on October 12, 2003, 4:20 pm

how about n^-1
do we treat it as o(n) or o(n^-0.1)?

i know it trend to be a constant when n apporach to infinity
but when n is small its result is quite large.
By the way i think i did hear Burkhard said we treat it as n.
But i am not sure. Can anyone tell me?


by Burkhard (bwue001) on October 14, 2003, 7:39 pm

Cannabis wrote:
  how about n^-1
do we treat it as o(n) or o(n^-0.1)?

i know it trend to be a constant when n apporach to infinity
but when n is small its result is quite large.
By the way i think i did hear Burkhard said we treat it as n.
But i am not sure. Can anyone tell me?


n^-1 = O(1) since you can find a c, n0 such that n^-1<c*1 for all n>n0.
For example, choose c=1 and n0=1.
Note that the function n^-1 doesn't make sense as a running time since a computer program can't get infinitely fast for infinitely large data sets.

Cheers,
Burkhard




130. solution.....


solution..... by pump (jbai034) on October 3, 2003, 6:18 pm

Burkhard:
could u post the solution to exercises on the course page..........







cheers


Re: solution..... by Burkhard (bwue001) on October 4, 2003, 1:37 pm

pump wrote:
  Burkhard:
could u post the solution to exercises on the course page..........
cheers


Yes, I will post the solutions a couple of days after we talked about the topics in the lecturer. The reason for this is that I want to give everybody the opportunity to try the exercises without being "tempted" to look at the solution first.

Cheers,
Burkhard




131. The hint of A3:Question2 is useless if a>b>1 not b>


The hint of A3:Question2 is useless if a>b>1 not b> by ryan (rzha030) on October 5, 2003, 1:18 pm

Dear Burkhard, could please check it?


Re: The hint of A3:Question2 is useless if a>b>1 not b by Burkhard (bwue001) on October 5, 2003, 3:35 pm

ryan wrote:
  Dear Burkhard, could please check it?


The hint is correct. If you do telescoping and you have values q>1 in your sum then of course you can still solve the recurrence relation but you can't use the formula given in the hint and your solution is not as nice and elegant as the one suggested by giving you the hint.

If you have a close look at your telescoping sum you will recognise that you can rewrite the sum so that you have a different factor before the sum and values q<1 in the sum which allows you to use the formula in the hint.

Hope that helps,
Burkhard




132. Ass3 Extension? - Early Warning?


Ass3 Extension? - Early Warning? by al (amar135) on October 6, 2003, 3:03 pm

Hi Burkhard,

I am quite surprised to find that the assignment 3 will only be dealing with the (max) first 2 weeks of your lectures. I mean I didn't expect it to be due so soon.



I have CS335 5% and IS330 14% all due on the same day Monday 13th Oct, so if there is going to be another extension, would it be possible for you to let us know in advance?

I know it's all about student psychology - give an extension too early and people will still leave to the last minute. I'd just like to know whether I need to stay up all week or if i could schedule some zzz's for Sunday?

Alex


by Bigbear (hyan052) on October 6, 2003, 3:32 pm

Yes, I also hope there will be a extension.

I have two cs230 assignments, one cs210 (very hard one) and the cs220 assignment due in next week.

I am gonna die......

~_~'


by asheltie (ajoh064) on October 6, 2003, 4:17 pm

the 220 a3 is very easy if u take a good look at it.
i think that's why it's due early, most of it can be done already with knowledge taught in tutorials.
the rest of the answers are in the 220 book

hope this doesn't spoil your chances for extensions, but it's hardly worth one :-)


Re: Ass3 Extension? - Early Warning? by Burkhard (bwue001) on October 7, 2003, 8:45 am

al wrote:
  Hi Burkhard,

I am quite surprised to find that the assignment 3 will only be dealing with the (max) first 2 weeks of your lectures. I mean I didn't expect it to be due so soon.


The assignment 3 is very easy and you can answer most of the questions already now. Note that question 3 is not related to the analysis of sorting which we will do later in the lecture. You can solve the question without any knowledge of Computer Science just by thinking about it. We will talk about the big-Oh notation today in the lecture and then you will then be able to finish that question, too. A good student who understands everything in the lecture should be able to finish the assignment in 1-2 hours maximum!

I will hand out assignment 4 on Friday and that assignment will be a bit longer and will also contain some programming questions. Anyway, I better tell you now that I give extensions unless you have a doctor certificate or some very special circumstances arise.

If I would give an extension then:
1) you are likely to need another extension for the second assignment
2) you have less time to study for the exam
3) I can't publish the sample solutions until everybody hands in which might mean that you don't get the sample solutions before the exam.
4) the markers are even less likely to finish marking before the exam which certainly doesn't help you with the exam.

If you have too much work to do for other courses please feel free to ask the supervisors of these courses for an extension :-)
The workload for this course and for this assignment in particular is well within the usual limits and shouldn't cause you any problems.

Cheers,
Burkhard


by al (amar135) on October 7, 2003, 2:10 pm

Cool. Thanks for the reply. I didn't notice 25/6% = 4.16% and there's an assignment 4! Duh!




133. Solution to exercise sheet 1 is now online ...


Solution to exercise sheet 1 is now online ... by Burkhard (bwue001) on October 7, 2003, 8:50 am

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/Burkhard/220S2C_2003_Part3_Lec2_solutions.pdf[/url]

I also posted a preliminary version of the slides for the nest two lectures. This covers everything you need to know for the assignment. See "Section 3: Tools for Algorithm Analysis"

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/[/url]

Cheers,
Burkhard




134. The solution for the exercise sheet 2 is now online


The solution for the exercise sheet 2 is now online by Burkhard (bwue001) on October 8, 2003, 11:30 am

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/Burkhard/220S2C_2003_Part3_Lec3_solutions.pdf[/url]

Cheers,
Burkhard




135. question 2 - the solution :-)


question 2 - the solution :-) by asheltie (ajoh064) on October 9, 2003, 10:12 am

now that i have your attention,

question 2 of the assignment -

is it an error that b must be > 1 ???

worked it out several times and it seems wrong - if sum1 who has done it could confirm that i am wrong that would be appreciated *thnx*


by jwel027 (jwel027) on October 9, 2003, 4:51 pm

I don't think it matters because a>b, therefore the ratio you get at the end should mean that it fits nicely into one of the solutions on p42-43.


by asheltie (ajoh064) on October 9, 2003, 8:43 pm

sweeet

- burkhard explained it in the lecture 2day


by DannoNZ (dhaw022) on October 11, 2003, 10:19 am

I really still don't understand this question about how to sum the items left over up, and didn't follow what was explained in class about it. I don't understand how to use the knowledge that a<b<1 to in any way simplify the terms so they would fit into the hint given...


by asheltie (ajoh064) on October 11, 2003, 4:00 pm

it seems alot of people do not know about it.........i was able to ask sum1 from China, where they learn the formulas like this in high school maths.

maybe ask the tutor to explain...........or try it without using that formula???

sorry i'm no help but it's all i know


by fez (jbro179) on October 12, 2003, 6:54 pm

I dont know how to do this either, I understand Telescoping, but not with confusing-ass formulas like that.


by nlaw019 (nlaw019) on October 13, 2003, 12:32 am

a>b>1 is very useful, without this, you won't be able to use the hint given.........

a>b>1 has some other meanings. rearrange it into a simpler form, like x<y.

hope you guys understand^^




136. Staff/Student Meeting


Staff/Student Meeting by SamD (sdan017) on October 9, 2003, 2:41 pm

Hey guys,
Coming up on Monday is a meeting for CompSci reps. Please let me know asap if there is anything that you would like me to take to that meeting.
You can either post here, but better yet, email me:
sdan017@ec.auckland.ac.nz

Thanx
-SAM-




137. Test Mark


Test Mark by stsu010 (stsu010) on October 9, 2003, 8:55 pm

When will the test mark be out?? It's been quite a while since we did the test.


by asheltie (ajoh064) on October 10, 2003, 4:15 pm

have to agree,

where are they?


by twinkle_star (vsha026) on October 11, 2003, 4:35 pm

i had emailed Rakib and he replied saying that the test marks will be out by the end of next week.


by stsu010 (stsu010) on October 11, 2003, 6:24 pm

cool, thanks.




138. Assignment3 solution format


Assignment3 solution format by Felix (kcho089) on October 9, 2003, 9:23 pm

Can anyone tell me what the format of the assignment3 solution? At the end says put the answer into a .doc, does it mean just the final answer or include workings as well?Cheers


by cko011 (cko011) on October 9, 2003, 9:50 pm

I want to question it as well, seems many question can work out just the first eyesight, not really know how to show working on some of these questions.


by twirl (mlow026) on October 12, 2003, 1:43 pm

plus, can we handwrite then scan it?


Re: Assignment3 solution format by Burkhard (bwue001) on October 12, 2003, 2:49 pm

Felix wrote:
  Can anyone tell me what the format of the assignment3 solution? At the end says put the answer into a .doc, does it mean just the final answer or include workings as well?Cheers


For question (1) it's enough to give the solution - though if it's wrong you have automatically 0 marks, whereas if you show your working the markers might give you partial marks.

For question 2 and 3 you MUST show your working.

The solution should be in '.doc' or 'pdf' format. If you write the document by hadn and then scan it make sure that the images are compressed. It's probably best to first reduce the number of grayscale bits and then convert it into gif-format. Anyway, as long as the markers can read your document on their computers and it is not too big (< 1MByte) then it's fine.

Cheers,
Burkhard




139. Broken Links at the Lecture Slide


Broken Links at the Lecture Slide by gche043 (gche043) on October 10, 2003, 1:20 am

It seems that the lecture slides are no longer accessible through the compsci website... is it deliberate or is it being fixed?


Re: Broken Links at the Lecture Slide by Burkhard (bwue001) on October 12, 2003, 2:54 pm

gche043 wrote:
  It seems that the lecture slides are no longer accessible through the compsci website... is it deliberate or is it being fixed?


Works fine with me. Maybe the server was temporarily down - this has happened a couple of times lately. If you access the slides from home the chance that something doens't work is even higher since all connections outside the department are managed by ITSS.

Cheers,
Burkhard




140. study


study by jwel027 (jwel027) on October 10, 2003, 9:40 pm

in the answers to FIRST SEMESTER, 2002 exam, georgy has got in a table that a polynomial with leading term 100n^3 is O(n^4)(the table on page 2, 4th row). Is this a typo?


by asheltie (ajoh064) on October 11, 2003, 4:02 pm

without seeing the paper - it looks like a mistake '_,_'


by Mark Wilson (mwil211) on October 13, 2003, 2:24 pm

It doesn't look like a mistake to me. It seems true, though not as precise as it could be. Remember what the definition of big-O is: the key fact is that if f is O(g) and h is bigger than g then f is also O(h). It is only an inequality in the definition after all.

I haven't looke at the original either.


Re: study by christian (celv004) on October 13, 2003, 3:55 pm

jwel027 wrote:
  in the answers to FIRST SEMESTER, 2002 exam, georgy has got in a table that a polynomial with leading term 100n^3 is O(n^4)(the table on page 2, 4th row). Is this a typo?


It's not a typo, 100n^3 is O(n^4), but it's not the smallest O, called big Theta, which is what we really want....

Christian




141. Ass03 Question3


Ass03 Question3 by jrub001 (jrub001) on October 12, 2003, 11:55 am

Can someone please help me with Question 3, I must be missing something because I thought the quickest sorting algorithm available is something like O(n log n). So, how are we supposed to come up with a linear time algorithm?? I have read over the question a million times, but I still can't spot the catch(if any exists).

Thanks


by asheltie (ajoh064) on October 12, 2003, 1:19 pm

linear time means.....0(n)


by jrub001 (jrub001) on October 12, 2003, 2:28 pm

I know, isn't O(n log n) greater then O(n)


Re: Ass03 Question3 by Burkhard (bwue001) on October 12, 2003, 2:44 pm

jrub001 wrote:
  Can someone please help me with Question 3, I must be missing something because I thought the quickest sorting algorithm available is something like O(n log n). So, how are we supposed to come up with a linear time algorithm?? I have read over the question a million times, but I still can't spot the catch(if any exists).

Thanks


The fastest comparison based algorithm for sorting a collection of items with a total order but no other restrictions is indeed O(n log n)!

However, we do have some additional restrictions, e.g. we know that all items are within a certain range of numbers ... well, I can't say more than this without giving the solution away.
You might also want to think about whether you really need comparions for sorting the items. By the way, the solution has nothing to do with the sorting algorithms explained in the course book.

Cheers,
Burkhard


by jrub001 (jrub001) on October 12, 2003, 4:26 pm

Cheers




142. The solutions for the exercises to lecture 4 and 5 are ...


The solutions for the exercises to lecture 4 and 5 are ... by Burkhard (bwue001) on October 12, 2003, 2:39 pm

... now online :-)

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/Burkhard/220S2C_2003_Part3_Lec4_solutions.pdf[/url]

and

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/Burkhard/220S2C_2003_Part3_Lec5_solutions.pdf[/url]

Cheers,
Burkhard




143. Assignment 4 AND SOURCE CODE is now online ...


Assignment 4 AND SOURCE CODE is now online ... by Burkhard (bwue001) on October 12, 2003, 3:00 pm

The assignment was handed out on Friday. I put all left over copiesin the 220 box in the staircase opposite to the resource centre (basement of the science centre).

You can find an electronic copy on the 220 assignments web page:
[url] http://www.cs.auckland.ac.nz/compsci220s2c/assignments/assignment4.pdf[/url]

Have fun :-)

Burkhard


by Blah (zshi005) on October 14, 2003, 1:23 pm

I looked at the assignment web page but there is no such skeleton file methinoned in the handout avaliable. Is that because you haven't put it up or it resides somewhere else?


by Burkhard (bwue001) on October 14, 2003, 7:25 pm

Blah wrote:
  I looked at the assignment web page but there is no such skeleton file methinoned in the handout avaliable. Is that because you haven't put it up or it resides somewhere else?


Sorry, completely forgot!! :-(

I have put it now onto the web page. Thanks a lot :-)

See you,
Burkhard




144. a question?


a question? by fangwen27 (fliu028) on October 12, 2003, 5:24 pm

who tell me

if f(n) = n - n^2

what is the Big-Oh notation of the funtion

O(n) or O(n^2) which one


thanks


by The Fri (gmar086) on October 12, 2003, 5:43 pm

O(n^2)


by Jono (jteu004) on October 14, 2003, 8:36 am

Actually, when computing big-O we want the tightest upper bound. Any negative term does not increase the rate at which an algorithm slows with problem size.

Perhaps you can try finding a tighter upper bound on O(f(n)): see if you can find a c such that c.n < f(n) (i.e. f(n) is O(n)).
If that isn't enough fun, you could then try to find a c such that, c.1 < f(n) (i.e. f(n) is O(1)).
If you are STILL not sick of it, you could try to write a Java program that runs in time f(n).

Jono.


by Mark Wilson (mwil211) on October 15, 2003, 10:39 am

This whole thread doesn't make sense. The definition of big-O on p27 of coursebook only refers to functions that are (eventually) positive-valued, and n - n^2 certainly isn't.

The more general definition (which is standard but not needed in our book, since running times of algorithms are nonnegative) allows functions that have both positive and negative values. In this case the definition is that f(n) is in big-O of g(n) if there are c>0 and n_0 such that |g(n)| \leq c |f(n)| for n>=n_0.

Under this definition we have n - n^2 \in O(n^2) and that is as tight a bound as you can get.




145. Marks for assignment 2-Disappointing as hell


Marks for assignment 2-Disappointing as hell by mram021 (mram021) on October 12, 2003, 6:56 pm

Hey !
Just got the marks for Ass-02 . I got 0 cos my file couldnt be opened . After all the trouble i took writing it up , getting it scanned , then getting it converted to pdf format . it opened fine on my computer and the comp at uni .
And it takes over 3 weeks for them just to tell me that my file couldnt be opened . I'm halfway b/w upset n angry . I hope this can be sorted out in someway .
Anyone else havin trouble ?
take care
cheers
M


by Mark Wilson (mwil211) on October 13, 2003, 2:20 pm

I suggest you email the course administrator, whose job it is to consider such cases.




146. Big Os


Big Os by twirl (mlow026) on October 12, 2003, 9:37 pm

for decreasing functions like 4n^-3, do they have a lower computational complexity than constant time O(1)?


by VAhuja (vahu002) on October 13, 2003, 9:18 am

I think the functions wth negative powers will have lower Computational Complexity, as compared to 0(1). Reason, when n -> infinity, the function(s) will tend to zero.


Re: Big Os by christian (celv004) on October 13, 2003, 3:57 pm

twirl wrote:
  for decreasing functions like 4n^-3, do they have a lower computational complexity than constant time O(1)?


Functions with complexities like that are actually impossible I think, because it is impossible to increase the computing time by increasing the input data....

Christian


by Jono (jteu004) on October 14, 2003, 8:48 am

Now this is not definite, but in my view if we have a function f(n) = O(n^-1) for example, then the existance of hidden constants means that
f(n) = b.n^-1 + c
Now using rules for determining big-O of a function we have:
O(f(n)) = O(b.n^-1) + O(c) = max(O(n^-1) , O(1)) = O(1)

So in this case, the hidden constants are actually more significant than the n^-k term. Similarly, any function representing a real algorithm cannot be faster than O(1).

Jono.


Re: Big Os by Burkhard (bwue001) on October 14, 2003, 7:33 pm

christian wrote:
   twirl wrote:
  for decreasing functions like 4n^-3, do they have a lower computational complexity than constant time O(1)?


Functions with complexities like that are actually impossible I think, because it is impossible to increase the computing time by increasing the input data....

Christian


That's right, it doesn't really make sense to have a function with decreasing running time. But assumed you really want to have a Big-Oh notation then n^k (k<0) is O(1).

As far as I know O(0) is not defined - but even if it were, you can't say that n^k (k<0) is O(0) since n^k>0 (k<0) for all n. Hence you can't find constants c and n0 such that n^k < c*0 for all n>n0.

Hope that helps,
Burkhard




147. Big Oh for Log


Big Oh for Log by Felix (kcho089) on October 13, 2003, 12:33 pm

Can anyone tell me whats the Big Oh for "Log5n*Log5n"???

is it O(Logn)??


by jlin093 (jlin093) on October 13, 2003, 1:41 pm

It's (log5n)2 which is 25(logn)2. Thi big-oh is O((logn)2)


by Felix (kcho089) on October 13, 2003, 3:04 pm

Cheers!!




148. Announcement: test solutions


Announcement: test solutions by Mark Wilson (mwil211) on October 13, 2003, 3:18 pm

In case you don't read your email:

From: "Michael J. Dinneen" <mjd@cs.auckland.ac.nz>
Date: Mon Oct 13, 2003 11:07:56 Pacific/Auckland

Dear Class,

I've put the left-over printed solutions for CompSci 220 test in the
student resource centre handout box.

Michael


by zerodays (dlee064) on October 13, 2003, 5:12 pm

yo, i read my email every 5 min, never got a such mail..




149. About the assignment 2 mark


About the assignment 2 mark by Blah (zshi005) on October 14, 2003, 10:13 am

I am really confused about my assignment marking sheet. How much is this assignment marked out of? And how much mark is allocated for each section? It just indicates how much I got for each section but I cannot tell whether I was deducated any mark for that section without knowing the total!!! Plz give us clear feedback OK???


by mong (zmen001) on October 14, 2003, 10:22 am

agreeeeee...................


by zerodays (dlee064) on October 14, 2003, 12:11 pm

unhappy with the ass2 mark. i sent email request about marks to Rakib


by twinkle_star (vsha026) on October 14, 2003, 12:11 pm

i hvnt got my marks yet :-(


by christian (celv004) on October 14, 2003, 1:18 pm

twinkle_star wrote:
  i hvnt got my marks yet :-(


Good! Then I'm not the only one....

PS!

Has anyone received their test marks from that horrible test we had several weeks ago? Or are they still trying to figure out what to do since results were so poooooor....

Christian


by byan013 (byan013) on October 14, 2003, 3:08 pm

i do not have any test mark or assignment2 mark yet ~~~~


by stsu010 (stsu010) on October 14, 2003, 4:36 pm

i havent got my marks too, but my friends all got their marks back.


by cko011 (cko011) on October 14, 2003, 6:22 pm

I suggest that better not knowing the test marks, as heard the tutors said, most ppl in the class fail the test


by stsu010 (stsu010) on October 14, 2003, 8:25 pm

what???!!!! many ppl failed, omg. when will the result be out??


by asheltie (ajoh064) on October 14, 2003, 8:47 pm

still no marks,
2 people copied each other and got 10 mark differences - wats with that?


by stsu010 (stsu010) on October 14, 2003, 9:04 pm

i still got no marks for my assignment 2, what is going on??




150. ASG4 - Where are the skeleton files?


ASG4 - Where are the skeleton files? by christian (celv004) on October 14, 2003, 6:22 pm

The assignment description mentions some files that we can download from the assignment web page, but I can't find them....

Does anyone know where they can be found??

Christian


Re: ASG4 - Where are the skeleton files? by Burkhard (bwue001) on October 14, 2003, 7:28 pm

christian wrote:
  The assignment description mentions some files that we can download from the assignment web page, but I can't find them....

Does anyone know where they can be found??

Christian


Sorry, completely forgot. They are now on the assignements webpage [url] http://www.cs.auckland.ac.nz/compsci220s2c/assignments/[/url] .

Cheers,
Burkhard




151. Clarification to ASG4 Q1 a i please


Clarification to ASG4 Q1 a i please by christian (celv004) on October 14, 2003, 9:36 pm

1.

Why is there an example of n=8, when n should be a power of 4, n=4^m, and m should be an integer?

2.

When is your office hours?


Re: Clarification to ASG4 Q1 a i please by Burkhard (bwue001) on October 15, 2003, 4:55 pm

christian wrote:
  1. Why is there an example of n=8, when n should be a power of 4, n=4^m, and m should be an integer?


The algorithm works for any number of n. The assumption n=4^m was only added to make the analysis easier. An example with n=4 would have been trivial and an example with n=16 would have been to long.

[quote:f58f06ea9d]
2. When is your office hours?



Friday 8.30-10.30am.

Cheers,
Burkhard


152. Assignment 2 mark


Assignment 2 mark by byan013 (byan013) on October 15, 2003, 8:46 am

i spent some time to understand the marked sheet
maybe i got the idea : total mark is 59 , and part3 Q5 became the bonus mark , is that right ??


by fshe010 (fshe010) on October 15, 2003, 10:22 am

yes..i think it's right


Re: Assignment 2 mark by christian (celv004) on October 15, 2003, 10:22 am

byan013 wrote:
  i spent some time to understand the marked sheet
maybe i got the idea : total mark is 59 , and part3 Q5 became the bonus mark , is that right ??


Seems that way yes....finally got my mark today....not too good I'm afraid.

Christian


by asheltie (ajoh064) on October 15, 2003, 12:40 pm

how'd it go Christian?
i got 54, people who have the same answers as me (don;t know how ? :-D ) got less than 50......


by byan013 (byan013) on October 15, 2003, 1:10 pm

anyway , many people complain about the marking
and i think this assignment is too large and too complicated
such as to draw from NFA to DFA waste a lot of time
and hard to read byu the marker


by byan013 (byan013) on October 15, 2003, 1:11 pm

by the marker


by christian (celv004) on October 15, 2003, 1:35 pm

asheltie wrote:
  how'd it go Christian?
i got 54, people who have the same answers as me (don;t know how ? :-D ) got less than 50......


I got 49 so I guess it's not that bad, but I spent a whole week doing it so I was hoping to do better...but anyways, now it's assignment 4 that counts!

Cheers,
Christian


by zbao002 (zbao002) on October 17, 2003, 2:19 pm

I have received a mail from the marker which has nothing in the content at all!!! Quite worried about the mark...


by byan013 (byan013) on October 17, 2003, 2:30 pm

yes
some people also get the similar problem
the marker just said we can not open your pdf document
so the mark is zero


by The Fri (gmar086) on October 17, 2003, 9:11 pm

I ended up getting 58.5 / 59, and no I didnt do the bonus question, didnt know what was going on with that question.

Im still scratching my head in disbelief.......




153. Why out of memory in A4 Q1bii?


Why out of memory in A4 Q1bii? by ryan (rzha030) on October 16, 2003, 1:33 am

I didn't do insertionSort(n), but my program run out of memory. So what's the problem?


Re: Why out of memory in A4 Q1bii? by christian (celv004) on October 16, 2003, 1:47 am

ryan wrote:
  I didn't do insertionSort(n), but my program run out of memory. So what's the problem?


How big n did you use?

Christian


just the same as the assignment by ryan (rzha030) on October 16, 2003, 8:01 pm

it is 6553680


by mong (zmen001) on October 16, 2003, 9:24 pm

and it takes long time to get the value back..then we can draw the table..from the table that handout shown..the most one is almost 700000 milliseconds, which is 700 seconds, is nearly 10 mins to get answer..
just wondering..the marker are going to wait that long to see the output??????????


by DC (jli030) on October 17, 2003, 11:05 am

just wondering how I can make quickSort take 10s - 25s. Seems machines in the Uni's labs r too fast. When I tried to use a large value of n, it would raise outOfMemory exception..
Any ideas about this??

Cheers!


by DC (jli030) on October 17, 2003, 12:42 pm

mong wrote:
  and it takes long time to get the value back..then we can draw the table..from the table that handout shown..the most one is almost 700000 milliseconds, which is 700 seconds, is nearly 10 mins to get answer..
just wondering..the marker are going to wait that long to see the output??????????



That is just the average time it takes to sort 10 arrays. So after sorting each of those 10 arrays, it would end up 10*10 mins. then u can calculate the average is 10 mins. That means, we have to wait for 10*10 mins which is longer than one hour in order to get the final result..
Mad!!
Or I may be misunderstanding the meaning of the question..


by Burkhard (bwue001) on October 17, 2003, 12:58 pm

[quote:796aeee4d2] That is just the average time it takes to sort 10 arrays. So after sorting each of those 10 arrays, it would end up 10*10 mins. then u can calculate the average is 10 mins. That means, we have to wait for 10*10 mins which is longer than one hour in order to get the final result..
Mad!!
Or I may be misunderstanding the meaning of the question..



Please see the announcement I just posted. I assumed that most people work at home and it's not a problem to run the program over night in oreder to get the values. Of course if you work in the lab then you are not expected to compute the second to last value for the insertion sort.

Also it's possible that the ratio of memory to processor speed in the lab machines is so low that you run out of memory. In this case please use different time period to find the array size, eg. 5-12 seconds. Please add a comment to your program explaining the problem.

Cheers,
Burkhard

by pump (jbai034) on October 20, 2003, 12:46 pm

DC wrote:
  just wondering how I can make quickSort take 10s - 25s. Seems machines in the Uni's labs r too fast. When I tried to use a large value of n, it would raise outOfMemory exception..
Any ideas about this??

Cheers!


1.use "break" to jump out of the loop
2.n is an "int" not a "long", it cannot be too large


by yren004 (yren004) on October 20, 2003, 4:35 pm

don't even see, guys//
why can't 'n' be too large?
please give more explanation! thanks!


by pump (jbai034) on October 20, 2003, 5:55 pm

yren004 wrote:
  don't even see, guys//
why can't 'n' be too large?
please give more explanation! thanks!



as int < long, ok?
i guess int is only up to 2^31-1....~~~


by Burkhard (bwue001) on October 21, 2003, 7:11 pm

yren004 wrote:
  don't even see, guys//
why can't 'n' be too large?
please give more explanation! thanks!


It depends how you implement your algorithm.
Say n=6000000 and you have an array of integers. The size of an array is 4 bytes, i.e. the memory for that array is 24 MByte. The mergeSort requires a temporary array of size n to do the sort, ie. you need at least 48 MByte on main memory.
If you use an array of long than you will need even double as much (in C a long variable is 8 byte long - I can't remember how it's define din Java but I assume it's the same).

There are additional memory requirements for the recursive function calls which are put on the function stack. I didn't experience any problems but dependent on your set up you might also run out of stack space.

The whole think gets more interesting if you sort 10 arrays. If you use the same array for each sort and reinitialise it after each sort then the total memory requirement won't change.
If you allocate 10 arrays of this size then you need 10 times as much space, ie. 240 MByte for the 10 arrays and 24 MByte for the temporary array for mmergeSort. You can see that in this case you will almost certainly run out of memory.

In summary: On most machines memory shouldn't be an issue and the problems are almost certainly related to the way you have implemented your algorithm. It's best if you try to figure out the available memory fo your computer (use the task manager) and you estimate the memory your program is using.
As mentioned in the announcement you are allowed to change the time interval in (i) in order to get a smaller array.

Hope that helps,
Burkhard


by yren004 (yren004) on October 21, 2003, 7:58 pm

maybe u are right sir~




154. A4,1(b)


A4,1(b) by jzho020 (jzho020) on October 16, 2003, 9:52 am

How big is n? what do you guys get? I got 13107200 .
Do we mesure the total time quickSort() takes to sort 10 arrays or the average time it takes to sort one array? I think it should be the total time.
By the way, do we need to pass 10 different arrays or can we pass the same array 10 times? It is pretty much the same.

to print out the table, can we do something like:
System.out.println("======================");
System.out.println("* quicksort | 3 ms | 23 ms |")
System.out.println("======================");
rather than do it using loops? It is easier and faster without any loop.


by mong (zmen001) on October 16, 2003, 1:34 pm

I think u should also say how many time u go throught it..
because different time got different value sine it is between 10-25.
I got 20144 milliseconds and n is 3276800. it is upper 20 seconds.


by jzho020 (jzho020) on October 16, 2003, 2:06 pm

mong wrote:
  I think u should also say how many time u go throught it..
because different time got different value sine it is between 10-25.
I got 20144 milliseconds and n is 3276800. it is upper 20 seconds.


Ok, this time , I rum my program on a different computer. And I got 17236 milliseconds and n is 3276800. In this case I pass the same array to the quickSort() method.

If I passed 10 different arrays to quickSort(), I got 10075 milliseconds and n i 1638400. I guess you r doing it in this way. Can u see that, 3276800 is 2* 1638400, and 20144 is approximate 2*10075. Your program does not accept 10 seconds as result. What is the range of the result ? Is it 10s < result < 25s or 10s <= result < 25s ?


by mong (zmen001) on October 16, 2003, 3:44 pm

I donot know..becasue I changed my program to if the time over 10000 millisecond, then go out..but I got the same output as before.


by jzho020 (jzho020) on October 16, 2003, 3:58 pm

mong wrote:
  I donot know..becasue I changed my program to if the time over 10000 millisecond, then go out..but I got the same output as before.

I see. I tried my program on another computer, this time I got 20218 milliseconds with n is 3276800.


Re: A4,1(b) by Burkhard (bwue001) on October 17, 2003, 2:35 pm

jzho020 wrote:
  How big is n? what do you guys get? I got 13107200


You must have a pretty fast computer. In the stage 2/3 lab you will almost certainly get an array size of about 3,000,000 entries. In some circumstances you might get double that one and in some cases half that size.

My machine has a 1.4GHz processor which I believe is faster than the lab machines and I usually get arrays with abou 6,000,000 entries.
As mentioned in one of the other postings if you want to compare your results with those of other people in the lab it's a god idea to quote the time it took to sort that array.

For example, say it takes 9.9 seconds to sort 10 arrays of size 3,000,000 then the algorithm would double that size and you get 6,000,000 as a result. If you run the program again and you have a slightly higher system load because of some background processes it might take 10.1 seconds to sort an array of size 3,000,000 and hence you get this as a result.

Cheers,
Burkhard


Re: A4,1(b) by jzho020 (jzho020) on October 17, 2003, 2:54 pm

Burkhard wrote:
   jzho020 wrote:
  How big is n? what do you guys get? I got 13107200


You must have a pretty fast computer. In the stage 2/3 lab you will almost certainly get an array size of about 3,000,000 entries. In some circumstances you might get double that one and in extremely rare cases half that size.

My machine has a 1.4GHz processor which I believe is faster than the lab machines and I usually get arrays with abou 6,000,000 entries.
As mentioned in one of the other postings if you want to compare your results with those of other people in the lab it's a god idea to quote the time it took to sort that array.

For example, say it takes 9.9 seconds to sort 10 arrays of size 3,000,000 then the algorithm would double that size and you get 6,000,000 as a result. If you run the program again and you have a slightly higher system load because of some background processes it might take 10.1 seconds to sort an array of size 3,000,000 and hence you get this as a result.

Cheers,
Burkhard

I guess 13,107,200 is wrong, I think it should be 1,310,720 . I ran my program in the lab.
Ok, this time , I run my program on a machine which has a 0.885GHz processor . I got n is 1638400 and it takes 10.556 sec to sort 10 diffenent arrays with size 1,638,400 .And my final result is :

for size n
quickSort 1070 ms
heapSort 3351 ms
mergeSort 2596 ms
shellSort 2975 ms
Do you think the result is OK or not?
One more thing. If I run my program on a machine in the lab(those new Compaq computers) which has a 2.5GHz processor,then I got n is 6,553,600 and the time is 14.718sec , but it gives me OUT OF MEMORY EXCEPTION when my program try to mesure the run time of those algorithms.


by hotshotec (lchi026) on October 17, 2003, 5:02 pm

I've run mine in the new Compaq computers in the labs and for n i got 6553600 also, the time is 1100 ms [quicksort]
for size n i got
shellsort = 2493.6ms
mergesort= 3886ms
heapsort=4296ms

but i dunt get a out of memory exception though....


by asheltie (ajoh064) on October 17, 2003, 9:00 pm

i must have misunderstood the assignment question.
why is every1 quoting [quote:a8adac5492] 1100 ms [quicksort]


and [quote:a8adac5492]
quickSort 1070 ms

i thought it had to be at least 10 seconds and up to 25 seconds.

did we get told sumthing in the tutorial i MISSED ???

my method computes n to be 6,553,600 in 11735 m/secs

by christian (celv004) on October 18, 2003, 1:13 pm

asheltie wrote:
  i must have misunderstood the assignment question.
why is every1 quoting [quote:9fca9fc84e] 1100 ms [quicksort]

and [quote:9fca9fc84e]
quickSort 1070 ms


i thought it had to be at least 10 seconds and up to 25 seconds.

did we get told sumthing in the tutorial i MISSED ???

my method computes n to be 6,553,600 in 11735 m/secs

Hi.

I've wondered a bit about this my self. What I think happens, is that we use quicksort to sort 10 arrays when we're determining the size of n. Here I too get about 10000 ms.

Afterwards when we're comparing the sorting-algorithms, we're sorting 10 arrays with each algorithm, and dividing the total time for each algorithm by 10 to achieve the average time it takes to sort 1 array of size n with that algorithm. Here I get about 1000 ms using quicksort

Whether this is correct or not, I don't know. The way I interpret the assignment specs this is not right, since it says to calculate the average time to sort 10 arrays. The problem with that however, is that I don't know how many times to sort the 10 arrays with each algorithms to be able to say "this is the average time". Also, since the screen-shot on the assignment specs have about the same times as I get when I sort 10 arrays and divide the total time by 10, I have decided to leave it the way it is until someone clarifies this issue....maybe we should ask Burkhard about this???

Christian

by jbal034 (jbal034) on October 18, 2003, 2:39 pm

my 1.99 ghz with 528MB ram seems to be have some difficulties running these algorithms...


by christian (celv004) on October 18, 2003, 2:45 pm

jbal034 wrote:
  my 1.99 ghz with 528MB ram seems to be have some difficulties running these algorithms...


Sounds strange, I have 900mhz and 512 mb ram and I have no problems with this....

Christian


by asheltie (ajoh064) on October 18, 2003, 5:27 pm

i understand now,

they are not the times for sorting the entire 10 arrays, that was quest.b-i
their times r for b-ii LOL

everything's workin' - JBAL034 you can expect them to take along time so as long as it's not crashing (is it?) don;t worry

my box runs web, mail, ftp and 1 other server, I'm listening to music, surfing the 'net, and chatting while I'm trying this and it's working ok - it's just a 1.8 GHz with 512 RaM (minus 32 Mb for the on-board graphics)

peece


by frazzle (dazh001) on October 19, 2003, 11:43 pm

I have a pentium 4 1.5ghz with 128mb ram and i get n = 3276800 with the time taken being 11042msecs. I send a different array of size n each time i call quick sort.


by seraphgg (sgao003) on October 21, 2003, 3:05 pm

I working b(i) in the stage 2/3 lab, and I got array size 1,638,400 its took 11.297 sec. (PS)that result for the quick sort.
Dose anyone know this result looks like alright?


by The Fri (gmar086) on October 21, 2003, 3:14 pm

I have a Pentium 4 2.4C with 512 RAM

2 Situations

When I generate a new random Array and sort it 10 times
- I get a time of 15093ms n = 13107200

When I generate 10 new random Arrays and try sort each Array
- I get a java.lang.OutOfMemoryError

Hmm maybe I should look at investing in more ram :D

EDIT: 3rd Situation
When I sort 10 different arrays and generate a new array while Timing
- I get a time of 15250ms n = 3276800




155. Model answers for test?


Model answers for test? by A1kmm (amil082) on October 16, 2003, 12:47 pm

Are there any model answers for the terms test anywhere(I can't find them).

In particular, I would like to query how the Dijkstra's question is marked. I made one mistake late on in the question where I accidentally set the cost to Queenstown as 111 + 16 = 127 instead of 108 + 10, and even though I showed my working I lost 4 marks for this, which seems a bit unfair. Is there any standard way of deciding how many marks are lost for mistakes in this question?

Also, in question 2)a)i)
I had
Node 1 2 3 4 5 6 7
Seen 1 2 3 12 5 4 7
Done 14 11 10 13 6 9 8
Which seems to be correct but I only got 1.5 out of 2.

Also, in section B, question 5)b) I think my answer is correct, but I only got 3 out of 4 marks for it:
L = {(ab^n)aa | n>=0} union {(ba)^nb^m | n>=0, 1<=m<=2}
and in question 5)c) I again think my DFA is correct but I only got 2 out of 4 marks for it...
State = {{1,3},{2},{4},Trap,{5},{6}}
Accepting = {{4},{2}}
Transitions = {(({1,3}, a), {1}), (({1,3},b),{4}), (({2},a),Trap), (({2},b),Trap), ((Trap, a), Trap),
((Trap, b), Trap), (({4},a),{5}),(({4},b),Trap), (({5},a),Trap), (({5},b),{6}),
(({5},b),{6}), (({6},a),Trap), (({6},b),{4})}
(Drawn in a graphical form in the test but I converted to text to post to the forum).

Can anyone see anything wrong with these or explain why I lost marks for them? Of the 11.5 marks I lost, I only understand why I lost 4 of them(counting 1 off for my mistake in Dijstra's algorithm instead of 3, and all other ones that I know why I got wrong as the marks taken off)
Thanks


by fever691 (yyan050) on October 16, 2003, 1:15 pm

yep, there's answers under the test scripts...last time I check they were there and in the 220 box...


by asheltie (ajoh064) on October 16, 2003, 10:58 pm

this is consistent with "students marking assignments".
pity the lecturers r too busy slagging off the students (see 320 forum) [url] http://forums.cs.auckland.ac.nz:8181/viewtopic.php?t=7405[/url]
to mark them for us................apparantly it's Doctor Wilson - lol


by asheltie (ajoh064) on October 17, 2003, 9:22 pm

and dittto.........
"Juice" takes her assignment back to Mike Dineen and goes from 49 to 59 - hhmmm, maybe i can get 64 out of 59 if i take mine in.


by Mark Wilson (mwil211) on October 20, 2003, 12:38 pm

I find the first post by asheltie to be offensive. What is humorous or indeed wrong about my posts in the 320 forum? Come and say it face to face if you have a complaint. Don't waste our time otherwise.

I can comment on some of the test questions, those that I marked.

MANY people wrote that they were using Dijkstra's algorithm but gave insufficient working to be convincing. The errors in students' answers were very varied. It is not possible to have an algorithm for awarding marks. Many students got 3/10 for writing the answer with no working. Others seemed to be performing Dijkstra's algorithm but made subtle errors.

If you have a problem with test marking, take it to the appropriate lecturer. There have been problems with some questions owing to a misunderstanding when marking. It is not possible for us to mark 250 scripts in reasonable time with no errors. As course supervisor I take overall responsibility for errors in marking, but you should contact the appropriate lecturer first.

The model answers were distributed in the student resource centre box last week as far as I recall. Email should have been sent to all enrolled students about this.


by Mark Wilson (mwil211) on October 20, 2003, 12:44 pm

One more point: for 2(a) the numbering system starts at 0 not 1, hence the -0.5 marks. I know this is a bit trivial but (for the first time) this semester I have asked a few questions that see whether anyone is paying attention to what I say and write. It was consistently marked that way for everyone.




156. why doesn't insertion sort do..............


why doesn't insertion sort do.............. by asheltie (ajoh064) on October 16, 2003, 10:51 pm

why doesn't the insertion sort do a logarithmic check on the sorted side for a place to put the unsorted item? like divide the sorted in 2 and find if it needs to go in the left or the right side??
for small and big 'n' that's gotta be faster......doesn't it?


by Jono (jteu004) on October 17, 2003, 9:06 am

This is the exact example I did in tutorials this week - bet you wish you didn't skip them now, eh!


by asheltie (ajoh064) on October 17, 2003, 12:12 pm

hmmm,
miss 1 and your branded for life




157. A4 Q1(b) NOT SURE THE ANSWER


A4 Q1(b) NOT SURE THE ANSWER by jzho020 (jzho020) on October 17, 2003, 11:45 am

In Q1 (b), for n = 1638400 , I got the result as below:

quickSort 1297 ms
heapSort 4221 ms
mergeSort 3125 ms
shellSort 3628 ms
insertionSort 0 ms

I am not sure whether my result looks ok or not. Andy my program takes
220 s to give me the result. (not including mesuring insertionSort) How long does it take you guys to get the result?




158. test marks are out


test marks are out by byan013 (byan013) on October 17, 2003, 12:03 pm

hi everyone the test papers are in basement math/physics building now
how is your test going ??


by DC (jli030) on October 17, 2003, 12:36 pm

I failed..


by zbao002 (zbao002) on October 17, 2003, 2:17 pm

I got about half out of full marks...

Could lecturer or tutor post the average mark of the whole class?


by byan013 (byan013) on October 17, 2003, 2:32 pm

me too


by pump (jbai034) on October 17, 2003, 3:50 pm

anyway, i heard the average mark is around 29/60


by byan013 (byan013) on October 19, 2003, 8:21 pm

oh ~~~
that is very sad , before i enrolled this course , my friend said 220 is the most easiest paper in Compsci satge 2 , but i do not think so ...


by tmevo6 (cwon093) on October 21, 2003, 7:54 pm

[quote:ca0032d303]
oh ~~~
that is very sad , before i enrolled this course , my friend said 220 is the most easiest paper in Compsci satge 2 , but i do not think so ...



I think 280 is easier than 220

by zbao002 (zbao002) on October 21, 2003, 8:55 pm

tmevo6 wrote:
  [quote:3db07c282a]
oh ~~~
that is very sad , before i enrolled this course , my friend said 220 is the most easiest paper in Compsci satge 2 , but i do not think so ...


I think 280 is easier than 220



Is compsci 280 an interesting course? Comparing with 210,220,230?
havent decided whether or not to take it as a free paper...

by The Fri (gmar086) on October 21, 2003, 10:48 pm

I loved 280, it was a great paper, they offer prizes too, xbox was the top prize, I managed to get a wireless keyboard and mouse so im sweet :D

However its usually full cause its a commerce paper requirement for IS, so u might get stuck on a waiting list since we(I take IS too) get priorty.

Since you have prior programming knowledge it isnt very hard picking up VB.Net, and Visual Studio .Net makes it even easier to code.

As for the test papers, has anyone picked up mine by accident? I cant seem to find it down in the basement, my upi is gmar086....

Cheers




159. Question 1(b): Important note


Question 1(b): Important note by Burkhard (bwue001) on October 17, 2003, 12:52 pm

> For array size n/10, your program gives the result over 700 s for
> insertionSort, and that is the average time insertionSort() takes to sort an
> array with n/10 elements, right? We need to sort 10 arrays in order to get the
> average time. That means sorting 10 arrays would take approximate 10*700 s ,
> that's more than an hour. I am justing wondering whether we could omit the
> second last value for insertionSort as well as the last value? Woud the marker
>spend more than one hour on marking an assignment?

:-) ... highly unlikely :-)

The main reason for computing the second-to last value is to estimate the value for 10n in the following question.
If you work at home computing this value is not a problem, but if you work in the lab then I am happy if you don't do it. You are right that it's a good idea to .

Also it's possible that the ratio of memory to processor speed in the lab machines is so low that you run out of memory. In this case please use different time period to find the array size, eg. 5-12 seconds. Please add a comment to your program explaining the problem.

Cheers,
Burkhard




160. Ass3 sample solution and slides for section 4 ...


Ass3 sample solution and slides for section 4 ... by Burkhard (bwue001) on October 17, 2003, 9:17 pm

... are now online.

[url] http://www.cs.auckland.ac.nz/compsci220s2c/assignments/Assignment3SampleSolution.pdf[/url]

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/[/url] .

Also have a look at the attachment for slide 48 (proof for linear heap construction).

Cheers,
Burkhard




161. A4 Q. 1b (iii)


A4 Q. 1b (iii) by jrub001 (jrub001) on October 18, 2003, 10:03 am

Whats the story for differing values of n when running the algorithms and then working out the value for 10n. For example, when I time the algorithms at home (900 MHz processor) I get a value of n = 1638400, however Burkhard has said an n value of 1638400 would be rare so I doubt I will get this value if I ran my program in the labs. So would my calculations for 10n be incorrect if I used this value because they won't match up to times I would get on lab computers.

Cheers


Re: A4 Q. 1b (iii) by christian (celv004) on October 18, 2003, 2:47 pm

jrub001 wrote:
  Whats the story for differing values of n when running the algorithms and then working out the value for 10n. For example, when I time the algorithms at home (900 MHz processor) I get a value of n = 1638400, however Burkhard has said an n value of 1638400 would be rare so I doubt I will get this value if I ran my program in the labs. So would my calculations for 10n be incorrect if I used this value because they won't match up to times I would get on lab computers.

Cheers


Why don't you just calculate your 10n estimate based on the results your program gets whenever and wherever it is run?

Christian


Re: A4 Q. 1b (iii) by Burkhard (bwue001) on October 21, 2003, 6:51 pm

jrub001 wrote:
  Whats the story for differing values of n when running the algorithms and then working out the value for 10n. For example, when I time the algorithms at home (900 MHz processor) I get a value of n = 1638400, however Burkhard has said an n value of 1638400 would be rare so I doubt I will get this value if I ran my program in the labs. So would my calculations for 10n be incorrect if I used this value because they won't match up to times I would get on lab computers.

Cheers


The purpose of the exercise is that you demonstrate that you are able to estimate running times from a number of measurements. The markers will look at your measurements and will check whether your estimate makes sense. For example, if you estimated running times for 10n is similar to your measurement for n than it's obvious that you must have made a mistake in your calculation.

Cheers,
Burkhard


by chsi021 (chsi021) on October 21, 2003, 7:33 pm

So does that mean markers are actually going to run all of our programs to see our actual result then compare it to our estimate?

That would take a lonnnnnng time!!! 100+ mins for marking each assignment!!

Or should we also provide the actual result which we obtained in our own home/ labs???

Or maybe can we do the estimation for b(iii) based on the example given on the assignment handout?


by Burkhard (bwue001) on October 21, 2003, 7:36 pm

chsi021 wrote:
  So does that mean markers are actually going to run all of our programs to see our actual result then compare it to our estimate?

That would take a lonnnnnng time!!! 100+ mins for marking each assignment!!

Or should we also provide the actual result which we obtained in our own home/ labs???

Or maybe can we do the estimation for b(iii) based on the example given on the assignment handout?


If you do your estimation then you also have to show the values you used for the estimation. Otherwise the marker can't give you any points because it's not clear whether you invented or computed the values.

So you definitely have to put the values output by your programs nto your assignment answer.

Cheers,
Burkhard


by chsi021 (chsi021) on October 21, 2003, 7:39 pm

Now that makes perfect sense! :-)


by fez (jbro179) on October 22, 2003, 10:48 am

Im going to use the values you provided in the table on the assignment printout, ok Burkhard?


by Burkhard (bwue001) on October 22, 2003, 2:06 pm

fez wrote:
  Im going to use the values you provided in the table on the assignment printout, ok Burkhard?


Please use your own values - this will also help you to think about whether your measurements make sense.
The only exception I accept is the etimation for the insertion sort. If you have only values for n/1000 and n/100 then it's quite difficult to get a reliable result for 10n and you can use instead the 3 values shown in the handout.

Cheers,
Burkhard




162. the case comparison


the case comparison by cko011 (cko011) on October 18, 2003, 3:00 pm

hi Burkhard, can u please post the comparison of different sorting u've taught? the list that u wrote on the board that day, with average case, worst case, best case. Thanks


Re: the case comparison by Burkhard (bwue001) on October 21, 2003, 6:57 pm

cko011 wrote:
  hi Burkhard, can u please post the comparison of different sorting u've taught? the list that u wrote on the board that day, with average case, worst case, best case. Thanks


I'm pretty sure that all the information is contained in the course book - please have a careful look into the course book first ... that's also a great way to review the lecture :-)
I will probably mention these values again in my review lecture on Friday.

Cheers,
Burkhard




163. HeapSort Big O for n ?


HeapSort Big O for n ? by zerodays (dlee064) on October 18, 2003, 3:16 pm

in the ass4 Question 1B(ii), there was sample output of all the times.

Do you guys get the heapSort for n , the biggest in all n column ??

the sheet shows heap for n is 12989ms (the highest)

but i dont find that true when i ran it. heapSort wasnt the higest... like shown on the sheet.

rest of output seems ok.

anyone ?


Re: HeapSort Big O for n ? by christian (celv004) on October 18, 2003, 5:25 pm

zerodays wrote:
  in the ass4 Question 1B(ii), there was sample output of all the times.

Do you guys get the heapSort for n , the biggest in all n column ??

the sheet shows heap for n is 12989ms (the highest)

but i dont find that true when i ran it. heapSort wasnt the higest... like shown on the sheet.

rest of output seems ok.

anyone ?


I think it's going to vary as we're using random numbers....you might hit the worst case for one of the algorithms and your times will seem odd compared to others....

Christian


by zerodays (dlee064) on October 18, 2003, 5:38 pm

yes i know, but the thing is, the heap sort is always never too big compare with the sheet output.

i get pretty similar result with heap/merge/shellsort for n

so i suppose its ok ?


by asheltie (ajoh064) on October 18, 2003, 8:22 pm

This is assuming you're creating random arrays 10 times per sort, and neither of us has touched the sort() methods,
then no,
i think heapSort shoould be twice as slow as the others, not including insertionSort which is way out there

this is only based on the 20 or so times i've run my program 'tho and not on any mathematical reasoning.




164. insertionSort


insertionSort by pump (jbai034) on October 18, 2003, 4:43 pm

in the sample table, i realize that
n/1000 n/100
insertionSort 65 6686

however when n=n/10
t booms to 766994ms!
i donot know what the hell happens here, but my program still doing n=n/10 caculation for more than 2 mins (seems never end)

when n increases to n,
t even jumps down to 0ms!

what is the problem?


by asheltie (ajoh064) on October 18, 2003, 5:33 pm

the problem is.........
the 76000 ms time is for 1 sort only - your program has to do 10 of those and find the average time right? so you'll have to wait .....a long time
and the 0 ms is because you'll need to leave your program running overnight to get the answer - there's a note under the graph to tell you not to bother trying the last one


by pump (jbai034) on October 18, 2003, 7:03 pm

asheltie wrote:
  the problem is.........
the 76000 ms time is for 1 sort only - your program has to do 10 of those and find the average time right? so you'll have to wait .....


yup, finally at 6:59PM, i found my output - 671091ms came out with whole
table...
i don't know when exactly it came out.. but...
be patient, marker. leave the partial table alone untill final result created.
thank u


by asheltie (ajoh064) on October 18, 2003, 7:42 pm

the marker's will earn there $12 /hr with this assignment


by edward (iche030) on October 19, 2003, 1:10 pm

my insertion sort actually is the fastest of other 4 sorts, strange.


by yren004 (yren004) on October 20, 2003, 4:39 pm

thanks for ur question pump...


by pump (jbai034) on October 20, 2003, 5:53 pm

yren004 wrote:
  thanks for ur question pump...


wait!..
go to read Announcement: Question 1(b): Important note:


note that last results should be omitted


by ysakaed (yhsi014) on October 20, 2003, 6:22 pm

edward wrote:
  my insertion sort actually is the fastest of other 4 sorts, strange.


I got the same results too...
insertion sort is somehow faster...
anybody know why? :s


by asheltie (ajoh064) on October 20, 2003, 6:29 pm

r u randomising every time
- so that's 10 randomising things every sort???


by ysakaed (yhsi014) on October 20, 2003, 6:32 pm

asheltie wrote:
  r u randomising every time
- so that's 10 randomising things every sort???

yes..
10 of my arrays are randomly produced in the loop
and somehow, at n/100, my insertion sort only runs 4 ms on average..
:S ???


by asheltie (ajoh064) on October 20, 2003, 8:00 pm

your "n" may be much smaller than it should be?
is your time a total of all 10 arrays?


by ysakaed (yhsi014) on October 20, 2003, 8:11 pm

asheltie wrote:
  your "n" may be much smaller than it should be?
is your time a total of all 10 arrays?

my n is 6553600...
while others work fine except insertion sort..
this is weird..
=_=


by Burkhard (bwue001) on October 21, 2003, 7:13 pm

ysakaed wrote:
   edward wrote:
  my insertion sort actually is the fastest of other 4 sorts, strange.


I got the same results too...
insertion sort is somehow faster...
anybody know why? :s


I suspect that you use a random array in the beginning but that you don't reinitialise it before running each sorting algorithm. In this case it would be sorted after performing Quicksort and insertion sort would run in O(n) rather than O(n^2). Please have another look at your code.

Cheers,
Burkhard


by edward (iche030) on October 22, 2003, 9:49 am

reinitialise?
is that mean doing array = new int[...] again?


by edward (iche030) on October 22, 2003, 9:51 am

i doing array = new int[...] again.
Still the insertion sort is the fastest.


by knack (pduf006) on October 22, 2003, 12:43 pm

you don't have to do new int[..] again
just refill the array with random numbers again before you sort it


by asheltie (ajoh064) on October 22, 2003, 3:05 pm

ysakaed wrote:
   asheltie wrote:
  r u randomising every time
- so that's 10 randomising things every sort???

yes..
10 of my arrays are randomly produced in the loop
and somehow, at n/100, my insertion sort only runs 4 ms on average..
:S ???


he/she is already doing that, at least i thought the above reply meant that??

i think you do have to say new int[] ........, at least for every new sorting algo you use - else the array will be n size even when you only fill it with n/1000 numbers ???

there's sumthing really wrong -
did you play with the sorting code at all ??


by edward (iche030) on October 22, 2003, 8:49 pm

i know what went wrong

after i initialise a = new int[...] , i have to add for loop

for (int i...) {
a[i..] = a.length - 1 - i
}
to reverse the order of array a.

now my insertion sort is the slowest now.


by knack (pduf006) on October 22, 2003, 10:41 pm

uhm.. i thought the array was supposed to be random, not reverse order
[code:1:4b927fde27] for (int i...) {
a[i] = random_integer();
}[/code:1:4b927fde27]

ps. good point asheltie :)




165. Q1.b.i


Q1.b.i by twirl (mlow026) on October 18, 2003, 5:55 pm

On the handout it doesn't say what the arrays should contain.
Should they have random values in them or just be empty?


by asheltie (ajoh064) on October 18, 2003, 7:44 pm

well sumwhere i read that we should fill the array with random numbers from 1 to the size of n
and in the assignment sheet it gives the Math.random() code to do that

it's just after the picture showing the output they want for question b ii.




166. Question 1(b)


Question 1(b) by jjin008 (jjin008) on October 19, 2003, 3:36 pm

In handout said ,finds a value n for the array size so tha sorting 10 arrays of this size........, what's the 10 arrays mean?? In one array there is 10 number, or there is ten arrays to be sorting. and How can find the value n?? what is the n meaning??


by asheltie (ajoh064) on October 19, 2003, 8:58 pm

it means...........
your method should find a number - lets call the number "n"
which is the "size" (length) of an array, such that when you sort this size of array 10 times, it takes between 10 - 25 seconds to do it.


by cko011 (cko011) on October 20, 2003, 2:59 pm

do u mean we need to write a new method to declare the 10 arrays testing in this program?


by asheltie (ajoh064) on October 20, 2003, 6:19 pm

not xactly, how u do it is up to u.
i meant this.................

you cannot just choose a size of 'n' that you think will take 10-25seconds to sort 10 arrays.
You have to write a short method that finds that out for itself.

why not start with the basics.......

write the code that creates a random array of size "n"..........(they've provided this on page 2 of the assignment)
then put that code inside a loop that goes from 1 to 10......(it really is that simple - lol)
now put some timing code above and below that.........(geeez this'll get edited for sure)
put that code inside a loop that breaks when the time is over 10 seconds, else it doubles the size of "n" and repeats.


by The Fri (gmar086) on October 21, 2003, 2:52 pm

Hmm when we time it, I thought we are timing the time it takes to "sort" 10 arrays, not the time it takes to "generate and sort" 10 arrays, although will there be much of a time difference?

Also, can we sort the same array 10 times (for a given size n)?
ie Generate Array, Start Timing, Sort 10x, Stop Timing

Or do we have to sort 10 different arrays (for a given size n)
ie Generate 10 Arrays, Start Timing, Sort Arrays, Stop Timing

Any official word on this?


by The Fri (gmar086) on October 21, 2003, 3:23 pm

Upon closer inspection, it looks like we have to measure the time it takes to "generate and sort" 10 DIFFERENT arrays.

Reasoning:
As SamD said in another thread, it sorts the array, so you need 10 different arrays

As I found out a few minutes ago, you run into an java.lang.OutOfMemoryError Exception if you try to generate 10 arrays of size n before starting timing and sorting em.




167. help with Q1b(i)


help with Q1b(i) by jlin093 (jlin093) on October 19, 2003, 6:33 pm

My application is something like:

startTime = System.currentTimeMillis();
quickSort(a);
endTime = System.currentTimeMillis();
time = endTime - startTime;
System.out.println(time);

the result is time = 0??????????????????????

cn someone help me?[/code]


by asheltie (ajoh064) on October 19, 2003, 8:54 pm

that's about right !!

which is why we have to run it 10 times to get any milliseconds at all.
if u r already doing that then that's ok - 0 ms is possible for small




168. Q2.a.i. Intertwined?


Q2.a.i. Intertwined? by twirl (mlow026) on October 19, 2003, 9:35 pm

"performing binary partition steps and interpolation steps"

what does this mean?


by pump (jbai034) on October 20, 2003, 12:37 pm

it can choose to use whether binary or interpolation search according to how good the array distributed.


by Blah (zshi005) on October 20, 2003, 11:23 pm

Is there any critiria on how good the array is distributed?


by Burkhard (bwue001) on October 21, 2003, 7:19 pm

pump wrote:
  it can choose to use whether binary or interpolation search according to how good the array distributed.


No, it means you use alternately binary steps and interpolation steps. Say you start with a binary step, ie. in the first iteration the array will halve. In the next iteration you will use an interpolation step. In the next iteration again a binary step and so on.

The reason for doing this is that the interpolation search can be O(n) in the worst case. The interwined search doesn't halve this disadvantage since every second step is a binary step the - i.e. array will at least halve in every second step ... anyway, you get the idea and I don't want to tell you the whole solution for part (iii) of the question :-)

Cheers,
Burkhard




169. table format


table format by cko011 (cko011) on October 19, 2003, 11:31 pm

is there anyone know how to make the table format more general? coz I was so annoyed of the format of the table changed while cahnging different n to test.....


by jbal034 (jbal034) on October 20, 2003, 10:54 am

after playing around for a while with the methods given and System.out.println() 's i got the table.

i added s.o.p so that the printing line will be the next line..


by chsi021 (chsi021) on October 20, 2003, 9:05 pm

I found the methods provided in the source code quite useful for populating tables... ( those printLine, or printString whatever can't recall now).




170. QUESTION FROM 1 B (I)


QUESTION FROM 1 B (I) by jlin093 (jlin093) on October 20, 2003, 2:47 pm

Can someone tell me what the excat size of n?
If the size of is getting bigger and bigger till reach the request time, why do we need to pass 10 arrays? ONLY one array is enough, because the n tends to bigger and bigger.

I m really confused!!!!


Re: QUESTION FROM 1 B (I) by pump (jbai034) on October 20, 2003, 3:51 pm

jlin093 wrote:
  
I m really confused!!!!


not have to be that bad, the size n is already in the sample table in assignment sheet


[quote:cde6173d12] why do we need to pass 10 arrays? ONLY one array is enough,



you r right, the question just wants u to be confused

by yren004 (yren004) on October 20, 2003, 4:29 pm

are u really a SB(short for something)?
are u really a real human?
u need to have a check!!!!
i'm so sad for u!!!!


by jlin093 (jlin093) on October 21, 2003, 10:07 am

yren004 wrote:
  are u really a SB(short for something)?
are u really a real human?
u need to have a check!!!!
i'm so sad for u!!!!


I m happy to receive any suggestions and help from ur guys.
BUT I do not want to hear something that makes me unhappy from someone how is obersivously sexually frustrated and gets comfort from spreading bad comments on this forum.
For those people who do really want to show their intelligence up and do not want to share or distribute any things with other people at this forum.
Please do not be intimidated by a smart ass.


by SamD (sdan017) on October 21, 2003, 1:19 pm

Hey - did you actually sort out your confusion? Let me know if you want me to try and clarify it all for you - but I wont do that if you're all sorted :P


by jlin093 (jlin093) on October 21, 2003, 2:50 pm

not yet. give me some suggestions, plz.


by SamD (sdan017) on October 21, 2003, 3:05 pm

Okay, firstly there is no exact size of n.
In question 1b (i) you have to create a method that returns a suitable value of n so that when you run quicksort on an array of size n 10 times it will take between 10 and 25 seconds to complete.
This means that you create 10 arrays of size n and run quicksort on each new array. Make sure that you are not using the same array each time that you run quicksort, or after the first time the array will be sorted and there will be no point to running quick sort on it.
Why there is no exactly value for n is because on different computers or at different times quicksort may run faster or slower. Therefore, each time you run your program you need to calculate n in case you are on a system that will run quicksort faster or slower than "normal" - whatever normal actually is.

You use 10 arrays so that you can find the average. Say you run it using just 1 array and your computer is suddenly having a major fit and is running 10 different programs in the background you will get a very slow result. But, if you use 10 arrays then you can take an average (result/10).

I hope that helps...
If you're still confused can you give me specific questions :)


by pump (jbai034) on October 21, 2003, 3:48 pm

SamD wrote:
  

You use 10 arrays so that you can find the average. Say you run it using just 1 array and your computer is suddenly having a major fit and is running 10 different programs in the background you will get a very slow result. But, if you use 10 arrays then you can take an average (result/10).



i argue the point of above paragraph

the average time is not (result/10), however, it opposes "best" and "worst"
case of 5 sorting algorithms, say average case of quick sort is O(nlogn),
but the worst is O(n^2)


am i right?


by SamD (sdan017) on October 21, 2003, 3:55 pm

Well, you are meant to get "the average time it takes to sort 10 arrays of random integers". I put all my times altogether into result and then divide that by 10 to get the average. If you have another way of working out the average time, thats cool. But yeah, that was just my plan of attack.


by pump (jbai034) on October 21, 2003, 4:05 pm

maybe u r right...
mmm..now i am confused


by seraphgg (sgao003) on October 21, 2003, 4:12 pm

SamD wrote:
  
Why there is no exactly value for n is because on different computers or at different times quicksort may run faster or slower. Therefore, each ............................
I hope that helps...
If you're still confused can you give me specific questions :)


If there has no exactly value of n, as your says we should still got the same n if we working at same computer,I was wandering anyone working on the compsci lab 2/3 stage has n equal 1.638.400 ??


by Burkhard (bwue001) on October 21, 2003, 7:29 pm

yren004 wrote:
  are u really a SB(short for something)?
are u really a real human?
u need to have a check!!!!
i'm so sad for u!!!!


Any demeaning comments in this forum are regarded as offensive and are unacceptable. I recommend you to apologise. Otherwise we might have to withdraw your email and access privileges.

Cheers,
Burkhard


by yren004 (yren004) on October 21, 2003, 7:56 pm

Sorry about what i said.
i really apologised that~
sorry for making everyone uncomfortable.


by christian (celv004) on October 21, 2003, 11:06 pm

SamD wrote:
  Well, you are meant to get "the average time it takes to sort 10 arrays of random integers". I put all my times altogether into result and then divide that by 10 to get the average. If you have another way of working out the average time, thats cool. But yeah, that was just my plan of attack.

Hi Sam!

I did it the same way as you're describing here, but I think maybe it's a bit wrong as we according to the asg are supposed to find the average time it takes to sort 10 arrays of size n, and by this method you and I are using we're actually calculating the average time to sort one array of size n.....

Do you have any comment on this, I'd like to hear it.

Christian


by pump (jbai034) on October 22, 2003, 1:09 pm

christian wrote:
   SamD wrote:
  Well, you are meant to get "the average time it takes to sort 10 arrays of random integers". I put all my times altogether into result and then divide that by 10 to get the average. If you have another way of working out the average time, thats cool. But yeah, that was just my plan of attack.

Hi Sam!

I did it the same way as you're describing here, but I think maybe it's a bit wrong as we according to the asg are supposed to find the average time it takes to sort 10 arrays of size n, and by this method you and I are using we're actually calculating the average time to sort one array of size n.....

Do you have any comment on this, I'd like to hear it.

Christian




i think sam is right...
actually if u did 10 array rather than 1, u will find the average time is around 10~25 second, really different from the figures in sample table.

isn't it~~~~~


by Burkhard (bwue001) on October 22, 2003, 2:15 pm

SamD wrote:
  Well, you are meant to get "the average time it takes to sort 10 arrays of random integers". I put all my times altogether into result and then divide that by 10 to get the average.


Yes, that's exactly what you should do. There is no point to worry about the worst case since the chance to get a random array with O(n^2) complexity is microscopic small. For an array of size n there are n! permutations, i.e for n=1000000 there are 1000000! differently ordered arrays - so you can see that the chance to get and array where the pivot is always the smallest or the largest element is close to zero.

Cheers,
Burkhard


by The Fri (gmar086) on October 22, 2003, 3:28 pm

Err.....Are we talking about b) i) or b) ii) here?

I thought we only average on ii) not i)


by Burkhard (bwue001) on October 23, 2003, 1:47 pm

[quote:248ffef7c6="The Fri"] Err.....Are we talking about b) i) or b) ii) here?

I thought we only average on ii) not i)



That's right. In 1(b) (i) the total time for sorting 10 arrays should be 10-25 seconds. This is the same as saying the average time of sorting 10 arrays should be 1-2.5 seconds.

In 1(b) (ii) you then output the average time for sorting 10 arrays with the different sorting algorithms.

As you can see from the assignment handout I get for the QuickSort an average time of 2.047 second which means that the total time for 10 arrays was 20.47 seconds which is exactly what we wanted.

Hope that this sorts out any remaining confusion :-)

Cheers,
Burkhard


171. server is down


server is down by david_auckla (jche131) on October 20, 2003, 6:03 pm

i cant download source code from compsci220 website. who knows whats goning on there? also compsci210 is down as well


sorry by david_auckla (jche131) on October 20, 2003, 6:03 pm

cant* :P


by zbao002 (zbao002) on October 20, 2003, 8:12 pm

It doesnt work even in the lab !!!


by byan013 (byan013) on October 20, 2003, 8:29 pm

i hate this situation...


by pump (jbai034) on October 20, 2003, 8:37 pm

not only 220 or 210

ALL the stuff on cs web page!!!

@@ @@ @@ @@ @@

once again i think some superman did it

and followed by complaint, assignment extension blah blah blah




172. About interpolation search...


About interpolation search... by Blah (zshi005) on October 21, 2003, 12:35 am

My interpolation search consumes greater time than binary search for both evenly and badly distributed array in most cases. But it should outperform binary search for evenly distributed array right? Just wondering anyone has the same problem. I think I implements the algorithm properly and they both gives the correct answer.


by mong (zmen001) on October 21, 2003, 10:27 am

hoho..the same thing here...I think because the computation of Next value is quite complex, and it takes more time than binary.But it makes interpolation useless, right?? can some one give some ideas??


Re: About interpolation search... by jzho020 (jzho020) on October 21, 2003, 10:34 am

Blah wrote:
  My interpolation search consumes greater time than binary search for both evenly and badly distributed array in most cases. But it should outperform binary search for evenly distributed array right? Just wondering anyone has the same problem. I think I implements the algorithm properly and they both gives the correct answer.

Where did you get the algorithm of interpolation search? Is it in the book or ...? I can't find it. I don' t know what the algorithm is , so how can I implement it?


by Jono (jteu004) on October 21, 2003, 12:11 pm

mong wrote:
  
hoho..the same thing here...I think because the computation of Next value is quite complex, and it takes more time than binary.But it makes interpolation useless, right?? can some one give some ideas??

If the objects you are sorting are not easily comparable, then the time for the 'next' computation can become insignificant. I can't think of a good example off the top of my head, but I know this occurs in practice.

Jono.


Re: About interpolation search... by SamD (sdan017) on October 21, 2003, 1:16 pm

jzho020 wrote:
  
Where did you get the algorithm of interpolation search? Is it in the book or ...? I can't find it. I don' t know what the algorithm is , so how can I implement it?


Have a look in the green book - in the section about Binary Search. There's definitely a section in there called Interpolation Search - near page 85 or something like that...


by Blah (zshi005) on October 21, 2003, 4:23 pm

Oh I have figured out the problem. It is because my calculation rounded up with the int part, not the actually value. Like (8/9)*9 gives me 0 instead of 8. How silly...


by Burkhard (bwue001) on October 21, 2003, 7:34 pm

mong wrote:
  hoho..the same thing here...I think because the computation of Next value is quite complex, and it takes more time than binary.But it makes interpolation useless, right?? can some one give some ideas??


What array size do you take? Try something reasonable big (but not too big since otherwise n^2 might fall outside the range of valud integers).
On my old computer (600 MHz) interpolation search is faster for n>100 and evenly distributed values.

Cheers,
Burkhard


by christian (celv004) on October 21, 2003, 11:14 pm

Burkhard wrote:
   mong wrote:
  hoho..the same thing here...I think because the computation of Next value is quite complex, and it takes more time than binary.But it makes interpolation useless, right?? can some one give some ideas??


What array size do you take? Try something reasonable big (but not too big since otherwise n^2 might fall outside the range of valud integers).
On my old computer (600 MHz) interpolation search is faster for n>100 and evenly distributed values.

Cheers,
Burkhard


I experience this same problem for all n from 10 to 1000 (have not tried higher), and I'd like some hints of how to solve the problem. I saw one person wrote something about divisions rounding to zero and that causing extra time. Is that something I have to consider?

Christian


by Blah (zshi005) on October 21, 2003, 11:43 pm

For instance, (8/9)*9 gives you 0 instead of 8. So you ended up with low + 0 which starts with the very first element, not the desired 8th element. So it will be even slower than binary search. I hope your problem is caused by that. My one works fine now...


by fshe010 (fshe010) on October 21, 2003, 11:55 pm

hi guys..i got same problem eveni tried n <100 liks lecture said..but my interpolation still take much long time than binary sorting..
pleas tell me why if u know . thanks


by christian (celv004) on October 22, 2003, 1:32 pm

Blah wrote:
  For instance, (8/9)*9 gives you 0 instead of 8. So you ended up with low + 0 which starts with the very first element, not the desired 8th element. So it will be even slower than binary search. I hope your problem is caused by that. My one works fine now...


Ok, I think this is my problem too. But how did you make sure it doesn't round down any more?

Christian


by Blah (zshi005) on October 22, 2003, 2:12 pm

You do the multiply first, then do the divide secondly.
Like 8*9/9, not the other way around :-)


by Burkhard (bwue001) on October 22, 2003, 2:24 pm

christian wrote:
  I experience this same problem for all n from 10 to 1000 (have not tried higher), and I'd like some hints of how to solve the problem. I saw one person wrote something about divisions rounding to zero and that causing extra time. Is that something I have to consider?

Christian


If you don't use the ceiling function (round to the next highest integer)used in the lecture handout than your algorithm might take forever.

The ceiling function is indicated by "square brackets with the bottom bit missing" and is defined as
__.....__
|..........|
|....A....| = the smallest integer greater or equal to A

[Please ignore the dots in the expression above. They were necessary to format the expression]

In Java you can write this expression as

(int) Math.ceil(A);

Please have a look in the java API for more info :-)

[url] http://www.cs.auckland.ac.nz/JavaCache/java1.3/api/[/url]

Cheers,
Burkhard


by asheltie (ajoh064) on October 22, 2003, 8:40 pm

weird -
mine works sweetly, so i thought i'd printout what this dividing by an int thing was doin' as mentioned prev post.
i get a neverending loop of numbers (the right one as it happens) but it never stops!!!!!!!!
so i remove the System.out.pr...... and it works fine
put it back - never-ending loop
take it out - works fine
..........
any1 exper. this???


by knack (pduf006) on October 22, 2003, 10:43 pm

maybe it just seems to never stop b/c printing all those numbers takes a long time.. try it with a really small value of n and see if it stops


by christian (celv004) on October 23, 2003, 12:27 am

asheltie wrote:
  weird -
mine works sweetly, so i thought i'd printout what this dividing by an int thing was doin' as mentioned prev post.
i get a neverending loop of numbers (the right one as it happens) but it never stops!!!!!!!!
so i remove the System.out.pr...... and it works fine
put it back - never-ending loop
take it out - works fine
..........
any1 exper. this???


I think it's because the interpolation method is called 1000,000 times:
[code:1:41c237df88] for(int j=0;j<k;j++){
try{
interpolationSearch(a,key);
} catch (ItemNotFoundException e){
System.out.println("Key not found");
}[/code:1:41c237df88]
as k=1000,000

and since you System.out.println() every time, it takes a long long time....if you don't s.o.p it goes a lot faster....

And about that Math.ceil - I already tried that and it doesn't seem to help...it still takes a lot more time than the binary search...

Christian


by asheltie (ajoh064) on October 23, 2003, 8:58 am

i understand why now
thnx guys/gals,
so it can do thousands of loops even tho n is only very small,
sounds like a very specialised alogorithm

i wonder about using it for non-linear stuff,
students marks, which normally form a bell curve
could you write a "polynomial function" for the interpolation search, instead of the linear function we're looking at???


by Burkhard (bwue001) on October 23, 2003, 1:38 pm

christian wrote:
  
I think it's because the interpolation method is called 1000,000 times:
[code:1:a554734fd0] for(int j=0;j<k;j++){
try{
interpolationSearch(a,key);
} catch (ItemNotFoundException e){
System.out.println("Key not found");
}[/code:1:a554734fd0]
as k=1000,000


This was necessary since the algorithm is so fast hat we don't get any reliable measurements for searching an array only once.

[quote:a554734fd0] [...] I tried this already but it still doesn't work [...]



One student wrote
> The only difference between my interpolation from my binary is this line of code
> mid = low + (int)(Math.ceil(((key - a[low] )*(high-low))/(a[high] - a[low] )));

This is not quite the same as in the lecture notes since you use an integer division rather than a floating point division.
For example, assume
(key-a[low] )=1
high-low=12
a[high] -a[low] =10

Then in your case 1*12/10=1 (integer division) and ceil(1)=1
whereas the correct formula gives 1*12/10=1.2 (floating point division)and ceil(1.2)=2

In general you can expect that binary search is faster for small values of n since the computation of the next value is easier.
In our example, I use an evenly distributed array and the time to find the key should therefore be independent from the size of the array (exactly one step - see exercises).
Binary search has a complexity of O(log n) and therefore will eventually take longer.

Hope that helps,
Burkhard


173. Q2b graph table


Q2b graph table by shurik (apry004) on October 21, 2003, 10:39 am

Do we need to draw a table while it executes allalgoritms or when it would finish executing them all


by The Fri (gmar086) on October 21, 2003, 4:59 pm

Does it really matter? as long as it pops out a table that looks "reasonable" I think it should be fine.

I dont think the markers are going to mark you down if you do it either way.




174. Interpolation search silde error?


Interpolation search silde error? by cko011 (cko011) on October 22, 2003, 1:08 pm

is the lecture slide page 18, which about Interpolation search, got some error? the formula in slide 16 suppose is next = low + .....
but the slide 18, the second step formula is next = 1+ .......
the "1" is a[low] , but not "low", so which one is right then?


Re: Interpolation search silde error? by Burkhard (bwue001) on October 22, 2003, 2:09 pm

cko011 wrote:
  is the lecture slide page 18, which about Interpolation search, got some error? the formula in slide 16 suppose is next = low + .....
but the slide 18, the second step formula is next = 1+ .......
the "1" is a[low] , but not "low", so which one is right then?


There were unfortunately a couple of errors on the initial version of the slides. Please see the lecture web page for a listing of the errors and the corrected slides.

[url] http://www.cs.auckland.ac.nz/compsci220s2c/lectures/[/url]

Cheers,
Burkhard




175. Additional office hours


Additional office hours by Burkhard (bwue001) on October 22, 2003, 2:26 pm

I will have additional office hours on:
12-2pm Thursday the 30th October
12-2pm Tuesday the 4th November
12-2pm Thursday the 6th November

Cheers,
Burkhard

Michael Dinneen will have the following office hours:

2-4pm Friday Oct 31st.
2-4pm Wednesday Nov 5th.
2-4pm Monday Nov 10th (after exam).




176. Just a question on Q1)b)iii)


Just a question on Q1)b)iii) by stsu010 (stsu010) on October 22, 2003, 3:49 pm

Is the value for n random?? And do we create the elements for a[] random as well and how many elements do we need to create??
Thank you for your help.


by asheltie (ajoh064) on October 23, 2003, 10:14 am

do u mean Quest. 1-b-ii ????

if u do - no, is not a random number,

only the values in the array are randomised before calling the sort routine/s

u need 2 make the array[ is the size of the array)




177. long


long by kahn003 (kahn003) on October 22, 2003, 7:55 pm

i wrote:

long ms;
difference = endTime - startTime;
ms = ms + difference; // I want to add them through the loop so I can calculate ms/10...
System.out.println("ms " = ms);

when execute this, I always get ms without plussing 'difference'..

are we not suppose to add long to long??

im not sure..

not enough knowledge

thanks in advance


by asheltie (ajoh064) on October 22, 2003, 8:31 pm

it seems like you could be re-initialising the ms variable @ every loop
move it to the top of the method() and try it?




178. format for Q1 b iii)?


format for Q1 b iii)? by hrh (rhua009) on October 23, 2003, 2:21 pm

do we need to produce the detail calculations?
or we just simply say
the estimated running time for quicksort is xxxxxx
heapsort isxxxxxx
.......


Re: format for Q1 b iii)? by Burkhard (bwue001) on October 23, 2003, 3:13 pm

hrh wrote:
  do we need to produce the detail calculations?
or we just simply say
the estimated running time for quicksort is xxxxxx
heapsort isxxxxxx
.......


You should show your calculation and explain how you derived your estimation.

Cheers,
Burkhard




179. Interpolation-Binary-Intertwined -weirdo values!


Interpolation-Binary-Intertwined -weirdo values! by mram021 (mram021) on October 23, 2003, 2:55 pm

Hey!
I am getting reasonable values for binary and interpolation search . For numbers above 7,interpolationis faster than binary . But my biggest problem (other than the space baron this keyboard being completely useless) is that the intertwined search is greater than both these vales by quite a bit (a 100 for smaller values and by a factor of 10 for larger values ).
My implementation is simple .Within a whileloop i have binary and interpol running alternatively . Anybody with a similar situation or with a solution/idea to solve for this problem , do reply asap .
thanx
M


by mram021 (mram021) on October 23, 2003, 3:06 pm

Also forgot that my interpolation runs better for badly arranged values than uniform values . Gofigure!
M


Re: Interpolation-Binary-Intertwined -weirdo values! by Burkhard (bwue001) on October 23, 2003, 3:21 pm

mram021 wrote:
  Hey!
I am getting reasonable values for binary and interpolation search . For numbers above 7,interpolationis faster than binary . But my biggest problem (other than the space baron this keyboard being completely useless) is that the intertwined search is greater than both these vales by quite a bit (a 100 for smaller values and by a factor of 10 for larger values ).
My implementation is simple .Within a whileloop i have binary and interpol running alternatively . Anybody with a similar situation or with a solution/idea to solve for this problem , do reply asap .
thanx
M


You should do alternately binary STEPS and interpolation STEPS, i.e. you compute the next point alternately by using an interpolation and by just taking the midpoint. Since every second step is a binary step you at least halve the array every two steps and you therefore avoid the worst case of the interpolation search.

Sorry, sounds like there is something wrong with your implementation.

Hope that helps,
Burkhard


by cko011 (cko011) on October 23, 2003, 3:50 pm

is the InterwinedSearch suppose to be faster or slower than the interpolationSearch? coz my one is, Interpolation Search is faster than binary, and Interwine faster than both 2 of them, is it normal or wrong?


by mram021 (mram021) on October 23, 2003, 4:10 pm

it finally works .
On this comp for values of n > 75 i get suitable values but while answering Q 2(a) (ii) , are we expected to give an example to demonstrate our reasoning ? It would be helpful wouldnt it ?
thanx
M


by Burkhard (bwue001) on October 24, 2003, 10:21 am

mram021 wrote:
  it finally works .
On this comp for values of n > 75 i get suitable values but while answering Q 2(a) (ii) , are we expected to give an example to demonstrate our reasoning ? It would be helpful wouldnt it ?
thanx
M


Sure, you are supposed to explain how you estimated the average and worst case time complexity. If you don't show your measuremenst then the marker can't verify your explanation and then the marker can't give you any marks which would be a pity. Of course you can also explain your estimation using mathematical arguments.

Cheers,
Burkhard


2a by VAhuja (vahu002) on October 24, 2003, 4:17 pm

For evenly distributed values:-

Interpolation < Intertwined < Binary

For badly distributed values:-

Interpolation > Intertwined > Binary


Just want to confirm if the above behaviour is as expected...

Thanks..




180. About Q1b(iii)


About Q1b(iii) by Blah (zshi005) on October 23, 2003, 4:07 pm

Anyone knows how to use the results from (ii) to estimate the time it would take to perform the five sorting algorithm? It cannot be like simply multipling the result by some constant right?




181. Questions about memory


Questions about memory by Cannabis (chua031) on October 23, 2003, 4:09 pm

well i am doing question2 in the lab
the first aprt i already run out of memory
my n is 819200
just wondering if the number in the array will occupy more memory than i expect because me random number is Math.random()*n+1
os when the n is bigger so each number is bigger

but i think the numbers will occupied same amount of memory even if i change the n to a constant number coz after all each number is an int

Am i right about this??


by knack (pduf006) on October 23, 2003, 5:58 pm

well my random numbers are Math.random()*Integer.MAXVALUE
so its not that
anyway, they all take up the same amount of space

are you generating all 10 arrays first before you sort them?
you should generate an array then sort it, then regenerate, then sort etc


by Cannabis (chua031) on October 23, 2003, 8:04 pm

i just think of my code n i found that
maybe i have generate too many arrays
so for every n i will have 10 arrays
so if n*2^8 then i will have 80 arrays?
just wondering if that's right but maybe i should try
what u said~




182. Q2b


Q2b by kahn003 (kahn003) on October 23, 2003, 5:20 pm

value of S??
Am I supposed to make my own S? if so, how?
Or
Am I not understanding the spec of the question??
please help!
Kenny


Re: Q2b by Burkhard (bwue001) on October 24, 2003, 10:25 am

kahn003 wrote:
  value of S??
Am I supposed to make my own S? if so, how?
Or
Am I not understanding the spec of the question??
please help!
Kenny


The user will input an arbitrary integer S and the algorithm will determine whether there are two numbers in the array such that their sum is S.
You should analyse the algorithm (without implementing it) - the value of S is not important for the analysis of the time complexity (average and worst case).

Cheers,
Burkhard




183. Q1(ii)


Q1(ii) by snow (jpan022) on October 23, 2003, 6:42 pm

Do we have to use n exactly eauals 6553600 to do this question?Can I use smaller one? Caz when I use 6553600 the window will suddently disappear after about 20 minutes ,but if I use smaller n it will show the table . So can I use smaller n for this question?


Re: Q1(ii) by pump (jbai034) on October 23, 2003, 6:47 pm

snow wrote:
  Do we have to use n exactly eauals 6553600 to do this question?Can I use smaller one? Caz when I use 6553600 the window will suddently disappear after about 20 minutes ,but if I use smaller n it will show the table . So can I use smaller n for this question?


do it in the lab on the ground level, you can get exact 6553600.





+^%!@#$%^&*


Re: Q1(ii) by snow (jpan022) on October 23, 2003, 6:52 pm

So,do you know the reason why the dos window disappear?
I am so confused,thank you !
pump wrote:
   snow wrote:
  Do we have to use n exactly eauals 6553600 to do this question?Can I use smaller one? Caz when I use 6553600 the window will suddently disappear after about 20 minutes ,but if I use smaller n it will show the table . So can I use smaller n for this question?


do it in the lab on the ground level, you can get exact 6553600.





+^%!@#$%^&*


by pump (jbai034) on October 23, 2003, 6:58 pm

easy... run it in the lab on ground floor your dos window will not close because of n=6553600


Re: Q1(ii) by Burkhard (bwue001) on October 24, 2003, 10:28 am

snow wrote:
  Do we have to use n exactly eauals 6553600 to do this question?Can I use smaller one? Caz when I use 6553600 the window will suddently disappear after about 20 minutes ,but if I use smaller n it will show the table . So can I use smaller n for this question?


The value you get for n will depend on the speed of your computer. Please see my previous comments in the forum for a detailed discussion of this issue.

Cheers,
Burkhard




184. really strange thing happen~~~


really strange thing happen~~~ by hrh (rhua009) on October 23, 2003, 7:24 pm

int high=a.length-1;
int next;

while(low<high){
System.out.println("high is a.length-1 "+high);
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


this is part of my interpolation code,
when the array length is even, everything is fine
however, when the length is odd, say, 3, the while loop goes forever.
so i run a system.out.println
guess what~~~it gives the high is 1,not 2~~~but 3-1 is 2, isn't it?

i'm totally lost now~~i don't know what's going on~~~
anyone give a help??/




185. question 2, asst 4


question 2, asst 4 by Boris (bmeg002) on October 23, 2003, 7:47 pm

Hi, I was just wondering what the return value in each of the methods we are writing should be... I know it's an int, but does it want the position the key was found at, or the key itself, to double check it was there or does it want the number of comparisons it took to find the key.

When the search methods are called, they don't even care about the return value int, so what is the point of having it?

Thanks to any help

Bruce


by pump (jbai034) on October 23, 2003, 8:08 pm

return anything u like, but ensure the key is really found(or throw exception), then you can time the search procedure(only)










_____________________
lalala


by The Fri (gmar086) on October 23, 2003, 9:13 pm

To be "Politically Correct" I think you should be returning the index of where the key resides.

But yeah it doesnt really matter, as long as the key is found




186. exception question


exception question by david_auckla (jche131) on October 23, 2003, 8:19 pm

how to throw a exception when key has not been found.

thanks


by The Fri (gmar086) on October 23, 2003, 9:11 pm

If you have a look at the comments, your answer is right there.

actually, have a closer look at your question...


*cough* throw new ItemNotFoundException("key not found!"); *cough*


by david_auckla (jche131) on October 23, 2003, 11:50 pm

thax 4 ur reply, i knew wat u mean , but my question is , the sorting mothed atually return an int. but how to return a exception which need int value.


by david_auckla (jche131) on October 24, 2003, 12:18 am

how stupid i am. haha, i got it now :P


by david (jyue005) on October 24, 2003, 1:16 am

how?
I have the same question...
plz help...


by knack (pduf006) on October 24, 2003, 6:54 am

you don't *return* an exception, you just throw it




187. Solutions for the exercise sheets 7,8,10 and 11 ...


Solutions for the exercise sheets 7,8,10 and 11 ... by Burkhard (bwue001) on October 24, 2003, 10:15 am

... are now online.

[url] http://www.cs.auckland.ac.nz/~burkhard/Lectures/220S2C_2003/index.html[/url]

Note that I will hand out the exercise sheet for lecture 11 today - please try to find the solutions yourself before you look them up.

Cheers,
Burkhard




188. Q2 b)


Q2 b) by hrh (rhua009) on October 24, 2003, 12:26 pm

anyone know that whether we need to give the time complexity of all cases? or we just give the average case time complexity?



also, "the first index k on the right of i" does it includes i itself?

thanks~~


Re: Q2 b) by Burkhard (bwue001) on October 24, 2003, 1:17 pm

hrh wrote:
  anyone know that whether we need to give the time complexity of all cases? or we just give the average case time complexity?


If it only says "time complexity" then this means the time complexity (upper bound) for all executions of the algorithm which is the complexity for the worst case.

By the way, the worst case time complexity is the same as for the average case.


[quote:c6faba7960] also, "the first index k on the right of i" does it includes i itself?

thanks~~



Yes.

Cheers,
Burkhard


189. Interwined search cheacking


Interwined search cheacking by Felix (kcho089) on October 24, 2003, 12:29 pm

Can anyone tell me if this is normal...

when i put a S.O.P("Interpolation") in the interpolation step and S.O.P("Binary") in binarysearch step, each of these r executed at a time in the while loop. I am getting a long println with just "Interpolation"

e.g
Interpolation
Interpolation
Interpolation
Interpolation
Interpolation
Interpolation
.
.
.
.and so on

but never see Binary appear. is this normal?? The purpose i m doing this is to check if interwined r functioning properly (Interpolation then Binary).
Logically it should print "Interpolation" then "Binary" right? Any clue??

Cheers!!


by knack (pduf006) on October 24, 2003, 2:52 pm

well yeah it should.. sounds like its not doing any binary
check it :)




190. Q2(b)(iii) -together or separately


Q2(b)(iii) -together or separately by mram021 (mram021) on October 24, 2003, 3:08 pm

Hi!
For the question Q2(b)(iii) do we have to find the time for all alggorithms put together or each of them separately ?
thanx
M


Re: Q2(b)(iii) -together or separately by Burkhard (bwue001) on October 24, 2003, 4:11 pm

mram021 wrote:
  Hi!
For the question Q2(b)(iii) do we have to find the time for all alggorithms put together or each of them separately ?
thanx
M


Please estimate the time for each algorithm, i.e. your answers should have 5 estimates, one for each of the 5 sorting algorithms.

Cheers,
Burkhard




191. Q2a


Q2a by VAhuja (vahu002) on October 24, 2003, 4:23 pm

For evenly distributed values:-

Interpolation < Intertwined < Binary

For badly distributed values:-

Interpolation > Intertwined > Binary


Just want to confirm if the above behaviour is as expected...

Thanks..


by GonePostal (ssto040) on October 25, 2003, 12:08 am

Thats what I got, but that doesn't necessarily make it right...




192. drop box is down!!!!


drop box is down!!!! by yche276 (yche276) on October 24, 2003, 5:49 pm

someone help!!!!!!!!!!!!!


by yche276 (yche276) on October 24, 2003, 5:54 pm

it works now!




193. slide removed?


slide removed? by cko011 (cko011) on October 27, 2003, 11:21 am

hi Burkard, can u upload the slide of Section 4 -Efficiency Sorting, on the site again? coz it seems removed when clicking in


Re: slide removed? by Burkhard (bwue001) on October 29, 2003, 3:30 pm

cko011 wrote:
  hi Burkard, can u upload the slide of Section 4 -Efficiency Sorting, on the site again? coz it seems removed when clicking in


I can't find anything wrong with it. Please try to refresh the page - I changed some of the link previously and maybe there is an old version of the web page in your cache.

Cheers,
Burkhard


by cko011 (cko011) on October 30, 2003, 3:20 pm

I can open the slide since I wait 3 miutes on it, thanks




194. ass04 ?


ass04 ? by fshe010 (fshe010) on October 27, 2003, 8:14 pm

does everyone got the assi04 mark?

i havn't got yet.


by byan013 (byan013) on October 27, 2003, 8:33 pm

no i do not have A4 mark and i still do not have A3 mark , what about you??


by Bigbear (hyan052) on October 28, 2003, 4:28 pm

I don't have the A3 mark back either :-(


by zerodays (dlee064) on October 28, 2003, 5:04 pm

same i didnt even get ass3 mark back


by shurik (apry004) on October 28, 2003, 5:13 pm

I got it today i think ass3 b back by end of this week.
As for ass4 i think it would take couple of weeks due to exams


by christian (celv004) on October 28, 2003, 11:18 pm

byan013 wrote:
  no i do not have A4 mark and i still do not have A3 mark , what about you??


I got my ass3 mark today....

Christian




195. Assignment 4 sample solution ...


Assignment 4 sample solution ... by Burkhard (bwue001) on October 30, 2003, 1:09 pm

is now online:

[url] http://www.cs.auckland.ac.nz/compsci220s2c/assignments/Assignment4SampleSolution.pdf[/url]

Cheers,
Burkhard




196. ass03 marking


ass03 marking by jbal034 (jbal034) on October 30, 2003, 3:53 pm

i think i got marks got deducted for doing things like this:[quote:16afbc7fa1] result must be written in the simplest representation
O((n-logn)(2^n-10) instead of O(n2^n)gives only 1 mark

but i did show my working i hope i got marks for that because that particular marker isnt specific what i got wrong. i would really appreciate it if the marker did specify what exactly i got wrong..


197. Where can I find exam answers?


Where can I find exam answers? by twirl (mlow026) on November 3, 2003, 4:32 pm

Where can I find answers to the 2001,2002SC and 2003FT exams?


Re: Where can I find exam answers? by kieron (sjun012) on November 5, 2003, 12:03 pm

oh my mistake haha




198. help me


help me by fangwen27 (fliu028) on November 4, 2003, 10:43 am

hello,
i have a question about this semester test Section A question 2 (ii)
this question is list all tree arcs , forward arcs, back arcs, cross arcs.

i don't still understand why in the solution the forward arcs only are (1,3)
(3,7) back arcs only are (5,6)()6,2) cross arcs are (4,5).

please tell me the reason. i think the forward arcs should be (1,3)(1,6)(1,5)
(1,5)(2,6)(2,5)(3,5)(1,7)(2,7)(3,7)
and back arcs(5,6)(5,3)(5,2)(5,1)(6,3)(6,2)(6,1)(3,2)(3,1)(4,1)(7,6)(7,3)(7,2)
(7,1)
cross arcs (4,2)(4,3)(4,6)(4,5)(4,7)(5,7)

but i got 0 mark, please tell me why? thanks


by asheltie (ajoh064) on November 5, 2003, 9:11 am

go and see a tutor - quick !
there is no way you can have back arcs when there isn;t an arc from 1 node to another. i think you do not understand the concept yet.

go and find a tutor or a friend who does know, is my only advice.




199. Exam Information


Exam Information by stsu010 (stsu010) on November 4, 2003, 3:58 pm

Does anyone know how many marks is for each part of the exam??
eg: Graph, Algorithm, Automotous................
Thanks.


by chsi021 (chsi021) on November 4, 2003, 5:26 pm

all the information is given in the last section of the handouts..




200. code in final exam ??


code in final exam ?? by byan013 (byan013) on November 5, 2003, 12:50 pm

does the final exam have code for us to write ??




201. Coursebook page 127


Coursebook page 127 by The Fri (gmar086) on November 5, 2003, 6:25 pm

on the bottom table, where it says 5n + 8n^2 + 100n^3 = O(n^4) I thought this was wrong, and should be O(n^3) and Mark responded with the following:

[quote:cd6f820016] Not an error. Read the definition again. It is in O(n^4) definitely. It
is not in Omega(n^4). It is in both O and Omega of n^3.



Could someone please explain this to me?

Re: Coursebook page 127 by christian (celv004) on November 5, 2003, 7:30 pm

[quote:39adfacef1="The Fri"] on the bottom table, where it says 5n + 8n^2 + 100n^3 = O(n^4) I thought this was wrong, and should be O(n^3) and Mark responded with the following:

[quote:39adfacef1] Not an error. Read the definition again. It is in O(n^4) definitely. It
is not in Omega(n^4). It is in both O and Omega of n^3.



Could someone please explain this to me?


n^3 is an element in O(n^4). n^3 is Big Theta... Hope this helps you to understand.

Cheers,
EILEN and christian


202. Passs Exams solutions


Passs Exams solutions by Felix (kcho089) on November 5, 2003, 6:33 pm

Can anyone tell me where to get solutions for pass yr? The pdf they got on the site r very limited and some of them don't even have any solutions. Anyone? Lecturers?? Tutors??

Regards
Felix


Re: Passs Exams solutions by christian (celv004) on November 5, 2003, 7:26 pm

Felix wrote:
  Can anyone tell me where to get solutions for pass yr? The pdf they got on the site r very limited and some of them don't even have any solutions. Anyone? Lecturers?? Tutors??

Regards
Felix


We also would like these...in particular city 2002 and tamaki 2003 exams...

EILEN and christian




203. 2003SC Mid-term Test


2003SC Mid-term Test by zbao002 (zbao002) on November 5, 2003, 9:08 pm

The last question says:

[quote:19fad426e8] For the following DFA find a string of minimum length that distinguishes each pair of states s1 and s2(just those pairs listed in the table). If no such string exists write N/A in the blank.



What does it mean Thanks!

by asheltie (ajoh064) on November 6, 2003, 9:10 am

good questions

never found a single person who knew the answer or understood the question.

can any tutor or lecturer help here?


by jwel027 (jwel027) on November 6, 2003, 10:50 am

I think this question is about equivalence classes.[quote:bf2e164612="the book"] For a DFA and any q in Q define the DFA M(q) = (Q, sigma, delta, s, F), that is, s is replaced with q in M(q). We say that two states p and q etc...

Sorry I couldn't be bothered typing it all out, but the basic idea is this: Take our machine m, make two new machines M(s1) and M(s2), where the only thing different about these two machines from M is that, in each new machine, the state we are considering is the start state of this new machine (if s1 or s2 is the start state, then it would be the same as M). Now what we do is find an input string (minimum length, in our case) whereby that one input string, when fed into both NEW machines (important!) yields different results (i.e. one accepts and the other doesn't).


204. Assignment answers...


Assignment answers... by zbao002 (zbao002) on November 5, 2003, 9:50 pm

Where can I find the answers to the assignment 1&2? Thanks!




205. not sure about DECISION TREE


not sure about DECISION TREE by lance (yhua059) on November 6, 2003, 12:38 am

could anyone make sure:
are there anything related to "decision tree" in exam?
It seems that it is not mentioned in the last lecture's handout.




206. Convert NFA to DFA


Convert NFA to DFA by jzho020 (jzho020) on November 6, 2003, 12:35 pm

when we convert NFA to DFA , do we always need to show the dead state or not? coz I saw some of them do , some of them don't. Getting confused.


by asheltie (ajoh064) on November 6, 2003, 1:32 pm

-let's assume the alphabet is {0,1} for any DFA
if you only have a 0 coming out of a node, you will need a dead-state to send the 1 to.

take a look at the DFA's and if there is no dead-state, maybe there is no need because all the symbols in the alphabet have nodes to go to.

i think,
sometimes i do anyway.


by jzho020 (jzho020) on November 6, 2003, 2:21 pm

asheltie wrote:
  -let's assume the alphabet is {0,1} for any DFA
if you only have a 0 coming out of a node, you will need a dead-state to send the 1 to.

take a look at the DFA's and if there is no dead-state, maybe there is no need because all the symbols in the alphabet have nodes to go to.

i think,
sometimes i do anyway.

I don't think so. Please check 2003 midterm test Question 5 (c) and (d)


by SamD (sdan017) on November 6, 2003, 3:12 pm

If I were u I'd cover my ass and put it in if there is a place that it fits (which would only be if there's a state that doesn't have one of the inputs coming out of it).
So, if there's a situation like that I'm putting a dead state in - unless, of course, the question states otherwise.
I did notice that some of them in the book did not have one, but I'm not gonna worry about the difference between the two and just include a dead state if the situation calls for it.


by jzho020 (jzho020) on November 6, 2003, 3:23 pm

SamD wrote:
  If I were u I'd cover my ass and put it in if there is a place that it fits (which would only be if there's a state that doesn't have one of the inputs coming out of it).
So, if there's a situation like that I'm putting a dead state in - unless, of course, the question states otherwise.
I did notice that some of them in the book did not have one, but I'm not gonna worry about the difference between the two and just include a dead state if the situation calls for it.

cheers.
One more stupid question. How could I change my name which appears on the forum? My current name is jzho020, I would like to change it into say "blabla" whatever, how could I do that? I tried to change it in profile. But it doesn't work (I think it should work), dont know why


by SamD (sdan017) on November 6, 2003, 3:29 pm

Hi
Well, I didn't try and change mine - but head to your profile and you should be able to change your username there. I dunno, but you might have to logged into netlogin to do it - give that a try.
But, yeah, I'm not too sure - I just set mine to SamD at the beginning of the year - and that was SO long ago :)

Good luck for the exam - howz the study going?
I just wish the lecturers would pay a little more attention to the forum... oh well...
Ciao


by jzho020 (jzho020) on November 6, 2003, 3:37 pm

SamD wrote:
  Hi
Well, I didn't try and change mine - but head to your profile and you should be able to change your username there. I dunno, but you might have to logged into netlogin to do it - give that a try.
But, yeah, I'm not too sure - I just set mine to SamD at the beginning of the year - and that was SO long ago :)

Good luck for the exam - howz the study going?
I just wish the lecturers would pay a little more attention to the forum... oh well...
Ciao

I did have netlogin running, still doesnt work. Probably it's too late to do it. I don't know.

Good luck, Guys!


by asheltie (ajoh064) on November 6, 2003, 10:37 pm

i've taken a look at the mid-term test

and what i just said got me the marks

- maybe i didn't make it clear?


holler if u haven;t figured it out?

DFA's NEED all the symbols in the alphabet going somewhere - if they ALL have somewere to go then fine, else you'll need a DEAD state


by asheltie (ajoh064) on November 6, 2003, 10:40 pm

forums on the blink again




207. do we need to write java code in the exam ?


do we need to write java code in the exam ? by YA (syan029) on November 6, 2003, 5:06 pm

as title ...
THANKS




208. FT2002 Q4e


FT2002 Q4e by pete (pmir001) on November 6, 2003, 5:38 pm

Why does it say NONE? wouldn't for example 5->3 be a cross arc, since seen(5) & fin(5) are greater than seen(3) & fin(3) ?


by jbal034 (jbal034) on November 7, 2003, 4:49 am

this reminded me of tutorial 3 and the EXACT same question is done there. so go have a look in that but yes you are right (5,3) is a cross arc.




209. Formulas?


Formulas? by gche043 (gche043) on November 6, 2003, 5:56 pm

will we be given formulas that we might need?
ie like sum(1-n) = n(n-1)/2 and sum(1squared - nsquared) = n(n+1)(n+2)/6 etc?


Re: Formulas? by shurik (apry004) on November 6, 2003, 6:13 pm

dont think so


by gche043 (gche043) on November 6, 2003, 6:53 pm

dang....


by fez (jbro179) on November 6, 2003, 9:13 pm

Anyone else screwed for Burkhards part of the exam?

*raises arm*


by stsu010 (stsu010) on November 7, 2003, 12:46 am

YES, ME.




210. Is this a complete tree? help plz


Is this a complete tree? help plz by david (jyue005) on November 6, 2003, 6:04 pm

Is this a complete tree?

O
/
O
/
O
/
O

thx :-)


Re: Is this a complete tree? help plz by shurik (apry004) on November 6, 2003, 6:16 pm

i'm not really sure but here it goes

It depends if its 1 mary tree then its complete but if its binary tree or n mary tree its not.

Complete tree each parent should have n number of children. The heights both trees should be the same. n depends what number u put before mary

I hope it helps


by david (jyue005) on November 6, 2003, 6:32 pm

Still confused... -_-;
What's the mary tree ?


by gche043 (gche043) on November 6, 2003, 6:58 pm

i think wat he/she is trying to say is that n-ary tree, which n = max no. of children a tree can have.
if its a unary tree yes its complete else it isnt.
from memory a complete binary tree is when the left tree is complete and right tree is also(recurrence is fun isnt it? :p), node must be removed from the right child then the left child...
its hard to explain, but i m sure that its in the text book or slides or somthing


by Robert (rfra047) on November 6, 2003, 7:00 pm

no it is not a complete tree. A complete tree is filled from left to right so that there has to be a left child of a node before there is a right and the height of the left subtree is either equal to or only 1 greater than the right sub tree.


so
0
/ \
0 0
/ \
0 0
is a complete tree.

but
0
/ \
0 0
... / \
.. 0 0
is not because hieght of left subtree is not 1 greater or equal to the right subtree

hope that helps




211. Exam....Where??


Exam....Where?? by kahn003 (kahn003) on November 7, 2003, 8:22 am

could not go to the last lecture, so can anyone give which class I should go to???

Cheers


Re: Exam....Where?? by christian (celv004) on November 7, 2003, 9:46 am

kahn003 wrote:
  could not go to the last lecture, so can anyone give which class I should go to???

Cheers


The exam room locations are posted on the window to the general library, and some other places on campus.




212. LIGHTS OFF PLT1


LIGHTS OFF PLT1 by zerodays (dlee064) on November 7, 2003, 5:50 pm

more than 3 times ? lights WENT OFF,

WE DIDNT HAVE EXTENTION TIME

TIME WAS SHORT at least for me.

WE went into PLT1 Later than MLT1, went OUT earlier than MLT1,

What sort of rule is this ??

classic CS rule ?


by The Fri (gmar086) on November 7, 2003, 6:47 pm

Hmm, I dont know if it was more than 3 times, but yea they did go off.

I have yet to master the art of writing in the dark. :(

What did u guys think of the exam?


by zerodays (dlee064) on November 7, 2003, 7:05 pm

im gotta say that, this exam was Extremly HARD

hardest paper in 2nd stage.

i hope they do massive scaling.. please !


by cko011 (cko011) on November 7, 2003, 7:29 pm

I think Automata part is the easiest, it's nearly, and totally copy and paste question from the term test, but the exam is actually quite hard, especially Burkard's part, alot Telescoping inside. Mark's part is fair, some kind of revision stuff...but mostly wanna complained the time wasted on the light off, it's very annoyed, I hope it won't be happened in another room later again.coz it's very stupid! When I did that Floyd's question, nearly ruined by the light off as I forgot the step where I was in.


by pump (jbai034) on November 10, 2003, 10:20 am

ss




213. VOTE for exam scaling people


VOTE for exam scaling people by Felix (kcho089) on November 7, 2003, 7:47 pm

Anyone who think the exam was unfair and extremely hard?? I m the first one who raise the hand. I hope we will get scale up for the exam...... Can we actually make a poll or vote and forward to the course administrator so that we can scale up? We have no help from any of the Lecturers and tutors outside the class time and no lecturers and tutors reply to any of the students post at the forum which is unfair.... i have never felt like this before on any of my past papers, COMPSCI220 this semester was awful and unorganise. SO I SUGGEST ANYONE WHO FEEL THE SAME AS ME PLEASE MAKE A VOTE OR POLL TO THE COURSE ADMINISTRATOR TO SCALE OUR GRADE.......


by zerodays (dlee064) on November 7, 2003, 7:56 pm

I MUST AGREE WITH YOU FELIX.

EXAM WAS EXTREMLY HARD.

HARDEST/WEIRDEST EVER IN COMPSCI....

I am sure LOTS of people will fail without scaling...


by fanta (jcho073) on November 7, 2003, 8:12 pm

I 100% AGREE.....

I ve never seen like this.

This exam was not only hard but also wired............

I do not want to seat this paper again.

I do not want to see exam like this.

I do not want to enroll algorithm paper even STAGE 3.

NEVER AGAIN ...


Re: VOTE for exam scaling people by jackhill (xhua040) on November 7, 2003, 8:18 pm

Felix wrote:
  I totally agree this, actually I only left 30 mins when I start last part. this exam is too difficult and less time to finish all. it's necessary to ask scaling.


by DC (jli030) on November 7, 2003, 8:58 pm

The exam was really hard.. And, I was so shocked that many marks were allocated to Telescoping!!!
From the exam imformation given in the final lecture, it said recursive was gonna to be 11 marks. But other stuffs like search and sorting all turned up in the form of telescoping today. And no knowleges based on trees were examed.
Another thing is the questions were so confused.. Remember the question worth ten mark from part one, find the least weight btw 2 cities with political troubles added. It was so hard to understand!!
The conclusion is that the exam was too hard. Scaling is desired..


by Bigfoot (ache079) on November 7, 2003, 11:26 pm

100% Agree. It's really hard.


compsci is running out of resource by ryan (rzha030) on November 7, 2003, 11:37 pm

There are so many students per course. The lectures are noisy. The labs are crowded. The lecturers can't response so many students very well.


by recah (ichi007) on November 7, 2003, 11:50 pm

ABSOLUTLY!!!! we all demand a scale up!!!!


by mong (zmen001) on November 8, 2003, 3:34 pm

agree......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......scale up......


by VVTL-i (ocho004) on November 8, 2003, 5:42 pm

I guess the somewhat unusual or biased arrangement of examined materials, and as has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing knowledge with telescoping, are all related to the sudden change of our intended lecturer for that section (c).

As far as I know, Georgy has been the the established lecturer for Algorithm Analysis section for quite some years. His sudden and unfortunate accident late last semester, has forced the department to find a quick replacement, which has consequently led to a possibly one-off change to the questioning style for that section of our exam this semester.

It also doesn't help that, for the same reason, what was originally section A - Algorithm Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our final exam this semester. Traditionally the final topic holds the greatest weighting of marks, since none of its materials could be presented in our mid-term test.

Certainly the coming of both abrupt changes - in terms of exam/questioning styles, and for the fact Algorithm Analysis section has now become the majority point holder, could not come at a worse time.

Whether or not we would get scaled up, I'm sure it'll depend upon our average results later on. But quietly I, as a victim of the telescoping preference... would surely hope they lower the passing mark for this exam.


by Felix (kcho089) on November 8, 2003, 8:22 pm

But what can we do at this stage?? Wait for the results or forward this feedback to the co-ordinator??


by Felix (kcho089) on November 8, 2003, 8:23 pm

What we going to do? are we gonna sit n wait for the results or forward this feed back to the co-ordinator??


by Felix (kcho089) on November 8, 2003, 8:30 pm

What we going to do? are we gonna sit n wait for the results or forward this feed back to the co-ordinator??


Re: VOTE for exam scaling people by Burkhard (bwue001) on November 10, 2003, 5:05 pm

Felix wrote:
  Anyone who think the exam was unfair and extremely hard??


Hard yes, unfair no. For my part most of the question were similar to one of my exam in a previous year and

students did very well in that year.

[quote:87c6c0b3b4] Can we actually make a poll or vote and forward to the course administrator so that we can scale up?



The course administrator is only administrating the results and doesn't decide the grades. The lecturers decide

the pass boundaries.

[quote:87c6c0b3b4] We have no help from any of the Lecturers and tutors outside the class time and no lecturers and

tutors reply to any of the students post at the forum which is unfair....

If you had bothered reading the forum you would have seen that I read and answered all forum questions

during the semester. I also answered all emails. I also was always available after the lectures and had 2 office

hours a week and 6 (!!) extra office hours before the exam.

[quote:87c6c0b3b4] SO I SUGGEST ANYONE WHO FEEL THE SAME AS ME PLEASE MAKE A VOTE OR POLL TO THE

COURSE ADMINISTRATOR TO SCALE OUR GRADE.......

Grades are not determined by vote but by academic merit. Otherweise you might as well start determining

grades by throwing a dice.


jackhill wrote:
   Felix wrote:
  I totally agree this, actually I only left 30 mins when I start last part. this exam is

too difficult and less time to finish all. it's necessary to ask scaling.


In the last lecture I talked about the exam and I strongly advised you to do the easy questions first and that

there are always a few hard questions which only very few students can answer.

DC wrote:
  The exam was really hard..


It was hard and every exam should be hard since otherwise it is impossible to differentiate between excellent,

good and not-so-good students. Note that it makes no difference whether an exam is hard or easy. If it's easy

the marking is stricter and the grade boundaries are higher. In fact, hard exams are much fairer because that

way you can make a silly mistake and still get a good grade.

Similarly there is no point asking for a scaling of the exam, because it has he same effect as choosing lower

grade boundaries and as mentioned previously the grade boundaries take into account the difficulty of the

exam.

DC wrote:
  And, I was so shocked that many marks were allocated to Telescoping!!!
From the exam imformation given in the final lecture, it said recursive was gonna to be 11 marks. But other

stuffs like search and sorting all turned up in the form of telescoping today.


I said there are 10 points about solving recurrence relations (i.e. telescoping) and there were 10 points about

telescoping. Question 6,7,9,11 didn't require telescoping, for question 12 you only had to determine the

recurrence formulas WITHOUT solving them via telescoping.
Also, if you visited the lectures you should have noticed that the analysis of just about all recursive algorithms

leads to recurrence relations which of course are solved in this lecture via telescoping. And I even said in the

last lecture that questions about sorting and searching might intersect with some of the other topics (e.g. b"big

-Oh" notation).

DC wrote:
  And no knowleges based on trees were examed.


It's impossible to test everything unless we extend the exam from 2 to 4-5 hours. I also mentioned many many

times that you should study everything we did in the lecture. If you "gamble" and you decide to concentrate on

some topics then this is your responsibility and you should not blame the lecturers.

[quote:87c6c0b3b4="VVTL-i"] I guess the somewhat unusual or biased arrangement of examined materials, and as DC[/

i]
has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing

knowledge with telescoping


We talked about telescoping extensively during the lecture, I gave plenty of exercises with sample solutions,

telescoping was done in the tutorials and the course book is full of examples. Also the analysis of just about all

recursive algorithms we talked about resulted in recurrence relations which I almost always solved on the

blackboard using telescoping.
In addition I had two office hours each week and you could have come and asked questions!


[quote:87c6c0b3b4="VVTL-i"] ... are all related to the sudden change of our intended lecturer for that section (c).

?? There hasn't been any change at all. I was scheduled to do that lecture since last year. Also I was teaching

this part in some of the previous years. The question style is also similar to previous years - in fact, you are

very lucky since at least one lecturer in previous years used slightly different definitions of time and space

complexity which can result in answers different from those in the course book.


[quote:87c6c0b3b4="VVTL-i"] It also doesn't help that, for the same reason, what was originally section A - Algorithm

Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our

final exam this semester.

The overall weighting of the three parts is the same as always.

Cheers,
Burkhard

by Sha (srah005) on November 9, 2003, 11:10 am

I agree with u Guys!

Definitely need a scaleup!

------------------------------
Anyway:( Enjoy the holiday Guys!


by pump (jbai034) on November 10, 2003, 10:12 am

the following post is quoted from a 210 thread("DNS"):

[quote:0d109523c4]
Hesky



Posted: Wed Nov 05, 2003 10:36 am Post subject:

--------------------------------------------------------------------------------

Random Guy:
Assignments are not that bad as you said. Many ppl get full marks on their assignment. You did bad is not saying everybody is doing bad. you can not do it, does not mean eveyone cannot do it! You think who are you? Bruce do give us very good organized course. If you don't believe you can talk about course organization with those guys doing 220 this semester, let them tell you what the hell is the organization of 220. I think the Unix assignement and Assembly Assigmts are real funs. Actually you can even did better, if you would study slightly harder and have less complaining.
_________________
Cheers

Hesky




so famous...

by pump (jbai034) on November 10, 2003, 10:13 am

apiapiapi


Agree. by navyboy (tson003) on November 10, 2003, 5:14 pm

Of course 100% Agree. It's really hard.!!!! TOO Too hard!!!!


by Burkhard (bwue001) on November 10, 2003, 5:17 pm

Felix wrote:
  Anyone who think the exam was unfair and extremely hard??


Hard yes, unfair no. For my part most of the question were similar to one of my exam in a previous year and students did very well in that year.

[quote:62acd10eab] Can we actually make a poll or vote and forward to the course administrator so that we can scale up?



The course administrator is only administrating the results and doesn't decide the grades. The lecturers decide the pass boundaries.

[quote:62acd10eab] We have no help from any of the Lecturers and tutors outside the class time and no lecturers and tutors reply to any of the students post at the forum which is unfair....

If you had bothered reading the forum you would have seen that I read and answered all forum questions during the semester. I also answered all emails. I also was always available after the lectures and had 2 office hours a week and 6 (!!) extra office hours before the exam.

[quote:62acd10eab] SO I SUGGEST ANYONE WHO FEEL THE SAME AS ME PLEASE MAKE A VOTE OR POLL TO THE COURSE ADMINISTRATOR TO SCALE OUR GRADE.......

Grades are not determined by vote but by academic merit. Otherweise you might as well start determining grades by throwing a dice.


jackhill wrote:
   Felix wrote:
  I totally agree this, actually I only left 30 mins when I start last part. this exam is too difficult and less time to finish all. it's necessary to ask scaling.


In the last lecture I talked about the exam and I strongly advised you to do the easy questions first and that there are always a few hard questions which only very few students can answer.

DC wrote:
  The exam was really hard..


It was hard and every exam should be hard since otherwise it is impossible to differentiate between excellent, good and not-so-good students. Note that it makes no difference whether an exam is hard or easy. If it's easy the marking is stricter and the grade boundaries are higher. In fact, hard exams are much fairer because that way you can make a silly mistake and still get a good grade.

Similarly there is no point asking for a scaling of the exam, because it has he same effect as choosing lower grade boundaries and as mentioned previously the grade boundaries take into account the difficulty of the exam.

DC wrote:
  And, I was so shocked that many marks were allocated to Telescoping!!!
From the exam imformation given in the final lecture, it said recursive was gonna to be 11 marks. But other stuffs like search and sorting all turned up in the form of telescoping today.


I said there are 10 points about solving recurrence relations (i.e. telescoping) and there were 10 points about telescoping. Question 6,7,9,11 didn't require telescoping, for question 12 you only had to determine the recurrence formulas WITHOUT solving them via telescoping.
Also, if you visited the lectures you should have noticed that the analysis of just about all recursive algorithms leads to recurrence relations which of course are solved in this lecture via telescoping. And I even said in the last lecture that questions about sorting and searching might intersect with some of the other topics (e.g. b"big-Oh" notation).

DC wrote:
  And no knowleges based on trees were examed.


It's impossible to test everything unless we extend the exam from 2 to 4-5 hours. I also mentioned many many times that you should study everything we did in the lecture. If you "gamble" and you decide to concentrate on some topics then this is your responsibility and you should not blame the lecturers.

[quote:62acd10eab="VVTL-i"] I guess the somewhat unusual or biased arrangement of examined materials, and as has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing knowledge with telescoping


We talked about telescoping extensively during the lecture, I gave plenty of exercises with sample solutions, telescoping was done in the tutorials and the course book is full of examples. Also the analysis of just about all recursive algorithms we talked about resulted in recurrence relations which I almost always solved on the blackboard using telescoping.
In addition I had two office hours each week and you could have come and asked questions!


[quote:62acd10eab="VVTL-i"] ... are all related to the sudden change of our intended lecturer for that section (c).

?? There hasn't been any change at all. I was scheduled to do that lecture since last year. Also I was teaching this part in some of the previous years. The question style is also similar to previous years - in fact, you are very lucky since at least one lecturer in previous years used slightly different definitions of time and space complexity which can result in answers different from those in the course book.


[quote:62acd10eab="VVTL-i"] It also doesn't help that, for the same reason, what was originally section A - Algorithm Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our final exam this semester.

The overall weighting of the three parts is the same as always.

Cheers,
Burkhard

by Felix (kcho089) on November 10, 2003, 11:15 am

Then come on guys lets do the vote...


by Burkhard (bwue001) on November 10, 2003, 12:42 pm

[quote:69565007e9="VVTL-i"] I guess the somewhat unusual or biased arrangement of examined materials, and as has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing knowledge with telescoping



We talked a lot about telescoping in the lecture. In fact, the analysis of just about every recursive algorithms in the lecture (MergeSort, QuickSort, BinarySearch, ...) etc. made use of telescoping. I did the analysis on the blackboard, I provided exercises with samplesolution, the tutors talked about it and the courses book is full of examples. It is absolutely beyond me how you can claim that telescoping favoured people with preexisting knowledg.

[quote:69565007e9] are all related to the sudden change of our intended lecturer for that section (c).

??? I was scheduled since more than a year to teach this part of 220! I also taught this part before in previous years. The only thing which changed is that the part about algorithm was moved from the beginning to the end because I was overseas at the start of the semester.

The questions in my part had exactly the same style as the ones in previous years - have a look at the 2001 test and exam!

[quote:69565007e9] It also doesn't help that, for the same reason, what was originally section A - Algorithm Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our final exam this semester.

The overall weighting of each part is the same as in previous years. I talked about this in the lecture and I start wondering whether you have ever been to one of my lectures.

[quote:69565007e9] [..] I hope the exam gets scaled up [...]

I can assure you that exam won't be scaled up just because people are complaining. Apart from this scaling has no effect at all because X% scaling is equivalent to lowering the pass mark by Y%. When deciding the pass mark we look at the level of knowledge displayed by a student and from that decide whether it's appropriate to pass him/her. In fact, it doesn't even matter whether an exam is easy of difficult because easy exams have a higher pass mark and are marked more strictly. Personally I believe that hard exams are fairer because that way you can still get a good mark even if you make a silly mistake.

[quote:69565007e9] [Some other student claimed that lecturers were not available outside the lectures]
I had two office hours per week and I was always available after the lectures. Before the exam I had 6 extra office hours. I also always talked to students who came outside the office hour apart from two times when I had meetings. I also answered all emails and during the semester regularly checked the forums and answered questions.

In fact, I spent more than double as much time on the 220 course than I should have spent on it (according to the official time allocation) and together with my other responsibilities it's not unusual that I work 70-80 hours/week. I don't know what you expect us to do but it seems your expectations are extremely unrealistic - universities are not schools and in order to be successful you must show some initiative (come to the office hours, organise study groups, read books, ...). How many of these things did you do??

Cheers,
Burkhard

by pump (jbai034) on November 10, 2003, 12:57 pm

dear me


SCALE UP by kelkel (kyeu018) on November 10, 2003, 4:13 pm

ABSOLUTLY AGREE


Re: VOTE for exam scaling people by Burkhard (bwue001) on November 10, 2003, 4:54 pm

Felix wrote:
  Anyone who think the exam was unfair and extremely hard??


Hard yes, unfair no. For my part most of the question were similar to one of my exam in a previous year and students did very well in that year.

[quote:d9bb2d38f2] Can we actually make a poll or vote and forward to the course administrator so that we can scale up?



The course administrator is only administrating the results and doesn't decide the grades. The lecturers decide the pass boundaries.

[quote:d9bb2d38f2] We have no help from any of the Lecturers and tutors outside the class time and no lecturers and tutors reply to any of the students post at the forum which is unfair....

If you had bothered reading the forum you would have seen that I read and answered all forum questions during the semester. I also answered all emails. I also was always available after the lectures and had 2 office hours a week and 6 (!!) extra office hours before the exam.

[quote:d9bb2d38f2] SO I SUGGEST ANYONE WHO FEEL THE SAME AS ME PLEASE MAKE A VOTE OR POLL TO THE COURSE ADMINISTRATOR TO SCALE OUR GRADE.......

Grades are not determined by vote but by academic merit. Otherweise you might as well start determining grades by throwing a dice.


jackhill wrote:
   Felix wrote:
  I totally agree this, actually I only left 30 mins when I start last part. this exam is too difficult and less time to finish all. it's necessary to ask scaling.


In the last lecture I talked about the exam and I strongly advised you to do the easy questions first and that there are always a few hard questions which only very few students can answer.

DC wrote:
  The exam was really hard..


It was hard and every exam should be hard since otherwise it is impossible to differentiate between excellent, good and not-so-good students. Note that it makes no difference whether an exam is hard or easy. If it's easy the marking is stricter and the grade boundaries are higher. In fact, hard exams are much fairer because that way you can make a silly mistake and still get a good grade.

Similarly there is no point asking for a scaling of the exam, because it has he same effect as choosing lower grade boundaries and as mentioned previously the grade boundaries take into account the difficulty of the exam.

DC wrote:
  And, I was so shocked that many marks were allocated to Telescoping!!!
From the exam imformation given in the final lecture, it said recursive was gonna to be 11 marks. But other stuffs like search and sorting all turned up in the form of telescoping today.


I said there are 10 points about solving recurrence relations (i.e. telescoping) and there were 10 points about telescoping. Question 6,7,9,11 didn't require telescoping, for question 12 you only had to determine the recurrence formulas WITHOUT solving them via telescoping.
Also, if you visited the lectures you should have noticed that the analysis of just about all recursive algorithms leads to recurrence relations which of course are solved in this lecture via telescoping. And I even said in the last lecture that questions about sorting and searching might intersect with some of the other topics (e.g. b"big-Oh" notation).

DC wrote:
  And no knowleges based on trees were examed.


It's impossible to test everything unless we extend the exam from 2 to 4-5 hours. I also mentioned many many times that you should study everything we did in the lecture. If you "gamble" and you decide to concentrate on some topics then this is your responsibility and you should not blame the lecturers.

[quote:d9bb2d38f2="VVTL-i"] I guess the somewhat unusual or biased arrangement of examined materials, and as has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing knowledge with telescoping


We talked about telescoping extensively during the lecture, I gave plenty of exercises with sample solutions, telescoping was done in the tutorials and the course book is full of examples. Also the analysis of just about all recursive algorithms we talked about resulted in recurrence relations which I almost always solved on the blackboard using telescoping.
In addition I had two office hours each week and you could have come and asked questions!


[quote:d9bb2d38f2="VVTL-i"] ... are all related to the sudden change of our intended lecturer for that section (c).

?? There hasn't been any change at all. I was scheduled to do that lecture since last year. Also I was teaching this part in some of the previous years. The question style is also similar to previous years - in fact, you are very lucky since at least one lecturer in previous years used slightly different definitions of time and space complexity which can result in answers different from those in the course book.


[quote:d9bb2d38f2="VVTL-i"] It also doesn't help that, for the same reason, what was originally section A - Algorithm Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our final exam this semester.

The overall weighting of the three parts is the same as always.

Cheers,
Burkhard

Reply to complaints by Burkhard (bwue001) on November 10, 2003, 5:16 pm

Felix wrote:
  Anyone who think the exam was unfair and extremely hard??


Hard yes, unfair no. For my part most of the question were similar to one of my exam in a previous year and students did very well in that year.

[quote:e1d199614d] Can we actually make a poll or vote and forward to the course administrator so that we can scale up?



The course administrator is only administrating the results and doesn't decide the grades. The lecturers decide the pass boundaries.

[quote:e1d199614d] We have no help from any of the Lecturers and tutors outside the class time and no lecturers and tutors reply to any of the students post at the forum which is unfair....

If you had bothered reading the forum you would have seen that I read and answered all forum questions during the semester. I also answered all emails. I also was always available after the lectures and had 2 office hours a week and 6 (!!) extra office hours before the exam.

[quote:e1d199614d] SO I SUGGEST ANYONE WHO FEEL THE SAME AS ME PLEASE MAKE A VOTE OR POLL TO THE COURSE ADMINISTRATOR TO SCALE OUR GRADE.......

Grades are not determined by vote but by academic merit. Otherweise you might as well start determining grades by throwing a dice.


jackhill wrote:
   Felix wrote:
  I totally agree this, actually I only left 30 mins when I start last part. this exam is too difficult and less time to finish all. it's necessary to ask scaling.


In the last lecture I talked about the exam and I strongly advised you to do the easy questions first and that there are always a few hard questions which only very few students can answer.

DC wrote:
  The exam was really hard..


It was hard and every exam should be hard since otherwise it is impossible to differentiate between excellent, good and not-so-good students. Note that it makes no difference whether an exam is hard or easy. If it's easy the marking is stricter and the grade boundaries are higher. In fact, hard exams are much fairer because that way you can make a silly mistake and still get a good grade.

Similarly there is no point asking for a scaling of the exam, because it has he same effect as choosing lower grade boundaries and as mentioned previously the grade boundaries take into account the difficulty of the exam.

DC wrote:
  And, I was so shocked that many marks were allocated to Telescoping!!!
From the exam imformation given in the final lecture, it said recursive was gonna to be 11 marks. But other stuffs like search and sorting all turned up in the form of telescoping today.


I said there are 10 points about solving recurrence relations (i.e. telescoping) and there were 10 points about telescoping. Question 6,7,9,11 didn't require telescoping, for question 12 you only had to determine the recurrence formulas WITHOUT solving them via telescoping.
Also, if you visited the lectures you should have noticed that the analysis of just about all recursive algorithms leads to recurrence relations which of course are solved in this lecture via telescoping. And I even said in the last lecture that questions about sorting and searching might intersect with some of the other topics (e.g. b"big-Oh" notation).

DC wrote:
  And no knowleges based on trees were examed.


It's impossible to test everything unless we extend the exam from 2 to 4-5 hours. I also mentioned many many times that you should study everything we did in the lecture. If you "gamble" and you decide to concentrate on some topics then this is your responsibility and you should not blame the lecturers.

[quote:e1d199614d="VVTL-i"] I guess the somewhat unusual or biased arrangement of examined materials, and as has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing knowledge with telescoping


We talked about telescoping extensively during the lecture, I gave plenty of exercises with sample solutions, telescoping was done in the tutorials and the course book is full of examples. Also the analysis of just about all recursive algorithms we talked about resulted in recurrence relations which I almost always solved on the blackboard using telescoping.
In addition I had two office hours each week and you could have come and asked questions!


[quote:e1d199614d="VVTL-i"] ... are all related to the sudden change of our intended lecturer for that section (c).

?? There hasn't been any change at all. I was scheduled to do that lecture since last year. Also I was teaching this part in some of the previous years. The question style is also similar to previous years - in fact, you are very lucky since at least one lecturer in previous years used slightly different definitions of time and space complexity which can result in answers different from those in the course book.


[quote:e1d199614d="VVTL-i"] It also doesn't help that, for the same reason, what was originally section A - Algorithm Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our final exam this semester.

The overall weighting of the three parts is the same as always.

Cheers,
Burkhard

vote for scale up by kelkel (kyeu018) on November 10, 2003, 6:13 pm

ABSOLUTLY AGREE


by lz14 (zliu030) on November 11, 2003, 12:16 am

The exam is not neccaceryly hard, but I think it's too long. Personally I spent a lot time in the graph part, they are not hard but it took a lot of time, and when time ran short I paniced a bit rest of the way. It would be fairer if this is a three hour exam.
OK I know if you are really good it won't take that long, but I really think it was a bit long.


by VVTL-i (ocho004) on November 13, 2003, 11:44 pm

Burkhard wrote:
  We talked a lot about telescoping in the lecture. In fact, the analysis of just about every recursive algorithms in the lecture (MergeSort, QuickSort, BinarySearch, ...) etc. made use of telescoping. I did the analysis on the blackboard, I provided exercises with samplesolution, the tutors talked about it and the courses book is full of examples. It is absolutely beyond me how you can claim that telescoping favoured people with preexisting knowledg.


Forgive me if my wording was ambiguous. I meant preexisting knowledge, as in if we studied well and have gone to see the lecturers and/or tutors when we need additoinal, we would be able to do very well in most of the Algorithm questions, as it is my opinion that a number questions of that section are linked or referenced to the process of recurrence and telescoping, and our well understanding of that part has therefore become even more crucial.

I too agree that telescoping had been well covered during lectures and perhaps in tutorials (you may experience differently in different tutorial streams). I rate both you and Georgy as very good lecturers, so I hope you have not gotten the wrong message. I very much look forward to be lectured by either of you again in my forthcoming CompSci papers, or be it 220 if fate decides I have not done enough.

On a side note, do you have news for the well-being of Georgy? Do you know if he has plans to return to lecturing students?


Burkhard wrote:
  ??? I was scheduled since more than a year to teach this part of 220! I also taught this part before in previous years. The only thing which changed is that the part about algorithm was moved from the beginning to the end because I was overseas at the start of the semester.

The questions in my part had exactly the same style as the ones in previous years - have a look at the 2001 test and exam!


My sincere apologies. Thinking back I should have done a little more research before making a statement as such. And while I did consult the past year papers of 2002 to 2003, I haven't looked at those of 2001. My apologies again to for not looking more in-depth before making such deductions.


Burkhard wrote:
  The overall weighting of each part is the same as in previous years. I talked about this in the lecture and I start wondering whether you have ever been to one of my lectures.


While I do not dispute the weighting of each section remained the same as in the past, what I was meaning to say is that due to the change of orders in covering the three topics, Algorithm Analysys had become the final topic of our paper. I believe it has traditionally been so, that the last taught, or third topic (regardless of its content), carries the most weighting in exams, due to the fact that none of topic 3 would have had the chance to be tested with the students before the exams. (However, section 1 and part of section 2 can be and have been covered in the mid-term test.)

I am assuming that the weighting for each section is different (i.e. not 33.3% for each of the 3 topics). I have based this on the information provided on the opening few slides of our last set of lecture slides, that was designed to help us revise and recapture on what we have learnt on AA.

Looking at it again, it says topic of Graph Algorithm, Automata Theory, and Analysis of Algorthms, are allocated with 30, 40, and 50 marks respectively.

I am beginning to wonder, if perhaps your implication of " ", actually includes the weighting/percentage covered by the mid-term test too. If it is indeed so, it is a major oversight of mine (in terms of seeing the big picture), and I hope you can excuse me for such a mistake.

I agree with most of what you've mentioned in your post, especially the clarification of scaling and passing-mark. I have no doubt that the marking system of the department is fair enough to accomodate for any unexpected distribution of marks, within reasonable grounds. We therefore cannot and should not form any movements to try to convince the department of what to do. The department has vast experience and history dealing with this paper (as well as for every other established paper of Compsci), whereas we are mostly only first timers of this paper. The wisdom of where to place the pass-mark should therefore best not be placed upon us.


Sincerely yours,

VVTL-i




214. Vote for scaliing people cont'd


Vote for scaliing people cont'd by Felix (kcho089) on November 10, 2003, 11:53 am

Lets vote guys.....should we do something?? The previous post has a fault so i assume they lock it.....


Re: Vote for scaliing people cont'd by Burkhard (bwue001) on November 10, 2003, 6:49 pm

Felix wrote:
  Lets vote guys.....should we do something??


Let me ask you something: If you own a company and you want to employ new people, do you choose the ones which have suitable qualifications or do you let the applicants vote whether they get employed or not?
So how do you think we determine grades?

If we would give grades according to student votes than your degree would have no more value than toilet paper. Luckily for you we still have some minimum standards and as a result many of our students get scholarships with top overseas universities.

Felix wrote:
  The previous post has a fault so i assume they lock it.....


Wrong assumption - though I think we have currently some server problems.

Felix wrote:
  Anyone who think the exam was unfair and extremely hard??


Hard yes, unfair no. For my part most of the question were similar to one of my exams in a previous year and students did very well in that year.

[quote:8d2315f6fa] Can we actually make a poll or vote and forward to the course administrator so that we can scale up?



The course administrator is only administrating the results and doesn't decide the grades. The lecturers decide the pass boundaries.

[quote:8d2315f6fa] We have no help from any of the Lecturers and tutors outside the class time and no lecturers and tutors reply to any of the students post at the forum which is unfair....

If you had bothered reading the forum you would have seen that I answered most forum questions during the semester. I also answered all emails. I also was always available after the lectures and had 2 office hours a week and 6 (!!) extra office hours before the exam.

[quote:8d2315f6fa] SO I SUGGEST ANYONE WHO FEEL THE SAME AS ME PLEASE MAKE A VOTE OR POLL TO THE COURSE ADMINISTRATOR TO SCALE OUR GRADE.......

Grades are not determined by vote but by academic merit. Otherweise you might as well start determining grades by throwing a dice.

jackhill wrote:
   Felix wrote:
  I totally agree this, actually I only left 30 mins when I start last part. this exam is too difficult and less time to finish all. it's necessary to ask scaling.


In the last lecture I talked about the exam and I strongly advised you to do the easy questions first and that there are always a few hard questions which only very few students can answer.

DC wrote:
  The exam was really hard..


It was hard and every exam should be hard since otherwise it is impossible to differentiate between excellent, good, not-so-good and bad students. Note that it makes no difference whether an exam is hard or easy. If it's easy the marking is stricter and the grade boundaries are higher. In fact, hard exams are much fairer because that way you can make a silly mistake and still get a good grade.

Similarly there is no point asking for a scaling of the exam, because it has he same effect as choosing lower grade boundaries and as mentioned previously the grade boundaries take into account the difficulty of the exam.

DC wrote:
  And, I was so shocked that many marks were allocated to Telescoping!!!
From the exam imformation given in the final lecture, it said recursive was gonna to be 11 marks. But other stuffs like search and sorting all turned up in the form of telescoping today.


I said there are 10 points about solving recurrence relations (i.e. telescoping) and there were 10 points about telescoping. Question 6,7,9,11 didn't require telescoping, for question 12 you only had to determine the recurrence formulas WITHOUT solving them via telescoping.
Also, if you visited the lectures you should have noticed that the analysis of just about all recursive algorithms leads to recurrence relations which of course are solved in this lecture via telescoping. And I even said in the last lecture that questions about sorting and searching might intersect with some of the other topics (e.g. "big-Oh" notation).

DC wrote:
  And no knowleges based on trees were examed.


It's impossible to test everything unless we extend the exam from 2 to 4-5 hours. I also mentioned many many times that you should study everything we did in the lecture. If you "gamble" and you decide to concentrate on some topics then this is your responsibility and you should not blame the lecturers.

[quote:8d2315f6fa="VVTL-i"] I guess the somewhat unusual or biased arrangement of examined materials, and as DC[/

i]
has said - the fact that many of the algorithm analysis questions favoured heavily upon pre-existing knowledge with telescoping


We talked about telescoping extensively during the lecture, I gave plenty of exercises with sample solutions, telescoping was done in the tutorials and the course book is full of examples. Also the analysis of just about all
recursive algorithms we talked about resulted in recurrence relations which I almost always solved on the blackboard using telescoping.
In addition I had two office hours each week and you could have come and asked questions!


[quote:8d2315f6fa="VVTL-i"] ... are all related to the sudden change of our intended lecturer for that section (c).

?? There hasn't been any change at all. I was scheduled to do that lecture since last year. Also I was teaching this part in some of the previous years. The question style is also similar to previous years - in fact, you are very lucky since at least one lecturer in previous years used slightly different definitions of time and space complexity which can result in answers different from those in the course book.

[quote:8d2315f6fa="VVTL-i"] It also doesn't help that, for the same reason, what was originally section A - Algorithm Analysis, has become our section C. And consequently yet again, it has become our 'majority topic' for our final exam this semester.

The overall weighting of the three parts is the same as always.

Cheers,
Burkhard

by knack (pduf006) on November 11, 2003, 10:48 am

[quote:8bc1323274] I can assure you that exam won't be scaled up just because people are complaining.



I should certainly hope not. Quit your belly-achin' everyone, and take some responsibility for yourselves.

PS. I don't expect to pass myself, but that's my own stupid fault.

by VVTL-i (ocho004) on November 14, 2003, 1:58 pm

Something was not working with the other thread.. I've reposted here instead, hope its okay cross posting :P

Burkhard wrote:
  
We talked a lot about telescoping in the lecture. In fact, the analysis of just about every recursive algorithms in the lecture (MergeSort, QuickSort, BinarySearch, ...) etc. made use of telescoping. I did the analysis on the blackboard, I provided exercises with samplesolution, the tutors talked about it and the courses book is full of examples. It is absolutely beyond me how you can claim that telescoping favoured people with preexisting knowledg.


Forgive me if my wording was ambiguous. I meant preexisting knowledge, as in if we studied well and have gone to see the lecturers and/or tutors when we need additoinal, we would be able to do very well in most of the Algorithm questions, as it is my opinion that a number questions of that section are linked or referenced to the process of recurrence and telescoping, and our well understanding of that part has therefore become even more crucial.

I too agree that telescoping had been well covered during lectures and perhaps in tutorials (you may experience differently in different tutorial streams). I rate both you and Georgy as very good lecturers, so I hope I have not conveyed the wrong message. I very much look forward to be lectured by either of you again in my forthcoming CompSci papers, or be it 220 if the real world decides I have not done enough :-/


Burkhard wrote:
  ??? I was scheduled since more than a year to teach this part of 220! I also taught this part before in previous years. The only thing which changed is that the part about algorithm was moved from the beginning to the end because I was overseas at the start of the semester.

The questions in my part had exactly the same style as the ones in previous years - have a look at the 2001 test and exam!


My sincere apologies. Thinking back I should have done a little more research before making a statement as such. And while I did consult the past year papers of 2002 to 2003, I haven't looked at those of 2001. My apologies again to for not looking more in-depth before making such deductions.


Burkhard wrote:
  The overall weighting of each part is the same as in previous years. I talked about this in the lecture and I start wondering whether you have ever been to one of my lectures.


While I do not dispute the weighting of each section remained the same as in the past, what I was meaning to say is that due to the change of orders in covering the three topics, Algorithm Analysys had become the final topic of our paper. I believe it has traditionally been so, that the last taught, or third topic (regardless of its content), carries the most weighting in exams, due to the fact that none of topic 3 would have had the chance to be tested with the students before the exams. (However, section 1 and part of section 2 can be and have been covered in the mid-term test.)

I am assuming that the weighting for each section is different (i.e. not 33.3% for each of the 3 topics). I have based this on the information provided on the opening few slides of our last set of lecture slides, that was designed to help us revise and recapture on what we have learnt on AA.

Looking at it again, it says topic of Graph Algorithm, Automata Theory, and Analysis of Algorthms, are allocated with 30, 40, and 50 marks respectively.

I am beginning to wonder, if perhaps your implication of "The overall weighting of each part is the same as in previous years.", actually includes the weighting/percentage covered by the mid-term test too. If it is indeed so, it is a major oversight of mine (in terms of seeing the big picture), and I hope you can excuse me for such a mistake.

I agree with most of what you've mentioned in your post, especially the clarification of scaling and passing-mark. I have no doubt that the marking system of the department is fair enough to accomodate for any unexpected distribution of marks, within reasonable grounds. We therefore cannot and should not form any movements to try to convince the department of what to do. The department has vast experience and history dealing with this paper (as well as for every other established paper of Compsci), whereas we are mostly only first timers of this paper. The wisdom of where to place the pass-mark should therefore best not be placed upon us.




215. Agree.


Agree. by navyboy (tson003) on November 10, 2003, 5:09 pm

Of course 100% Agree. It's really hard.!!!! TOO Too hard!!!!!!




216. exam results out!!!


exam results out!!! by frazzle (dazh001) on November 24, 2003, 6:35 pm

Woo hoo the exam results are out!!!!!!!


by fez (jbro179) on November 24, 2003, 9:46 pm

Man Im so glad I passed, it was the only result I was worried about


by zerodays (dlee064) on November 25, 2003, 12:33 am

see, i knew theres going to be a scale up (or the pass mark 50% has been lowered)

theres no F way that id pass the exam.(also failed the test well below the average mark) but still managed to pass the paper.

ROFLAMO,


Re: exam results out!!! by christian (celv004) on November 25, 2003, 3:41 am

frazzle wrote:
  Woo hoo the exam results are out!!!!!!!


I know! Passed and am very very very happy with that!

Now I don't have to worry any more and can just enjoy my vacation and Christmas back in Old Norway (brr....gonna be cold alrite :-)

See you guys next semester, or maybe even at summer school!