Hi i am a newbie learning java.. Well i am currently practicing from the book " A Concise and Practical introduction to programming algorithms in java".. So far now i have covered the basics upto arrays.. I have not yet reached object, strings classes and so on.. the problem i am stuck with is from the chapter on arrays on these 2 problems

A d-dimensional symmetric matrix M is such that Mi,j = Mj,i for all
1 ≤ i, j ≤ d. That is, matrix M equals its transpose matrix: MT = M.
Consider storing only the elements Mi,j with d ≥ i ≥ j ≥ 1 into a ragged
array: double [] [] symMatrix=new double [d][];. Write the array
allocation instructions that create a 1D array of length i for each row of
the symMatrix. Provides a static function that allows one to multiply two
such symmetric matrices stored in “triangular” bi-dimensional ragged
arrays.

Consider that an image with grey level ranging in [0, 255] has been
created and stored in the regular bi-dimensional data-structure byte
[] [] img;. How do we retrieve the image dimensions (width and
height) from this array? Give a procedure that calculates the histogram
distribution of the image. (Hint: Do not forget to perform the histogram
normalization so that the cumulative distribution of grey colors sums up
to 1.)

I dont want any code for these as i want to try and code it myself.. I just dont understand the problems.. Can anyone explain it to me as to what the problems are all about???

About the histogram do i need to display the width as 0 and height as 255 using a function prototype say like DisplayDimensions(byte img[][])???.. I dont think the problem is that simple
I really dont get how do i normalize the histogram and with what data?? And what is histogram distribution??..

+1; focus either on Java, or algorithms. If you're learning Java, an algorithms book isn't the best place to start.

Even if you're familiar with other programming languages, a book focusing on algorithms isn't necessarily going to teach you how to think in Java.

ashwin vis
Greenhorn

Joined: Sep 29, 2009
Posts: 17

posted

0

Yup i am familiar with that.. I know the basics of java and i am just trying to improve my problem solving capacity.. I am using the book to help me think in a way to solve problems!!!.. I just want to be able to solve problems.. So can you please help me with what the problem states???

In the ragged matrix problem.. Do i need to create two matrices say a[5][] and b[5][] and write a function to multiply these two matrices??? get the reason why they given the conditions of matrix transpose??

In the histogram problem i do not know with what data do i calculate the histogram distribution and what is meant by normalization?? And how do i get the values of gray color?? I don't think i can do that with the given 9 and 255

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38793

23

posted

0

You have two questions; you would have done better to start two threads.

Until you understand what matrix transformation means, you will not understand our replies.

ashwin vis
Greenhorn

Joined: Sep 29, 2009
Posts: 17

posted

0

Okay i think I'll first learn what is matrix transformation then i'll ask my doubts... Do i need to know anything about the histogram??

It's critically important to understand the algorithm before trying to implement it, otherwise you have no mental picture of what you're trying to do.

If this is the kind of problems you're interested in trying to solve, no worries, but if you're interested in more typical problems I don't think an algorithm book is a great place for this.

ashwin vis
Greenhorn

Joined: Sep 29, 2009
Posts: 17

posted

0

well i am trying to solve these problems so that i could solve the ones that are in sites like spoj and codechef... SO please can you explain what the problem states???

But if I tell you what the problem states you're not really solving the problem, are you--*I* am!

I'd recommend either breaking it down piece-by-piece, or starting with something easier. I'm not really prepared to explain linear algebra etc. in the Java forum ;)

ashwin vis
Greenhorn

Joined: Sep 29, 2009
Posts: 17

posted

0

hey i know linear algebra, calculus even matrix transformations like scaling rotation and all stuffs... All i asked was what the problem states you need not explain to me what i should do in the problem.. Just tell me what the problem says?? I think i am asking for too much. Thanks anyways for all your help..