# check identity matrix

Page 1 of 1

## 1 Replies - 5846 Views - Last Post: 22 July 2008 - 11:06 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=58314&amp;s=9380f9887f8ebdd071ac6d77a910e7be&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 maxtin11

• New D.I.C Head

Reputation: 0
• Posts: 1
• Joined: 22-July 08

# check identity matrix

Posted 22 July 2008 - 10:22 AM

hi,
i have this topic for my practicals. can anybody help me to write Java program for checking identity matrix?
Is This A Good Question/Topic? 0

## Replies To: check identity matrix

### #2 Programmist

• Refactorer in Chief

Reputation: 254
• Posts: 1,841
• Joined: 02-January 06

## Re: check identity matrix

Posted 22 July 2008 - 11:06 AM

If someone drew several matrices on the whiteboard, would you be able to tell which (if any) of them were and NxN identity matrix? Obviously you would, if they lined up the indices nicely. But, you need to think about how you would do it programatically. Forget Java and just think about the algorithm you would use (in pseudo-code). Go row by row and think about how row N relates to row(N-1) and row(N+1) in an identity matrix. Don't forget about you base case as well (I1).
Was This Post Helpful? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }