File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes Puzzle for JavaProgrammers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Puzzle for JavaProgrammers" Watch "Puzzle for JavaProgrammers" New topic
Author

Puzzle for JavaProgrammers

C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59

Hello Java Programmers/Friends
Please help me to make a Java Program for the above mentioned Mathematical Puzzle The details of the same is given in an html/txt.(you may open the html file for the same)
Thanks and best wishes for the new year too.
As Always
C.R.Muthukumar



David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Is this a homework assignment or rent-a-coder task or something?
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 562
    
    7

We would be glad to help you.

What do you have (ie: what have you done) so far?
C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Originally posted by David O'Meara:
Is this a homework assignment or rent-a-coder task or something?


This puzzle is really not getting any response though the same thing was first tried by myself ,mannualy making the answers from the clues given in the puzzle(pl ref the comments in the codes).,though the use of doublearray( matrix) as per the following java codes is rather not forth coming without an appropriate method in the place of average finding method(corretmetod) . So I once again bring this to fetch the correct codes for the puzzle.Probably the matrix elements have to be assigned as i have done mannually by way of numbering 1 for the correct logic and zero for wrong ones .Can any one try now.
Thanks
AsAlways
C.R.Muthukumar

Vlado Zajac
Ranch Hand

Joined: Aug 03, 2004
Posts: 245
Logical programming (I have used GNU Prolog and its constraint solver for very similar problem) seems to be more suitable than procedural programming (Java, C, ...) for this kind of puzzles.
C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Originally posted by Vlado Zajac:
Logical programming (I have used GNU Prolog and its constraint solver for very similar problem) seems to be more suitable than procedural programming (Java, C, ...) for this kind of puzzles.


Thanks.Can any body fetch the solution...
As Always
C.R.Muthukumar
[ March 11, 2007: Message edited by: David O'Meara ]
C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Originally posted by Vlado Zajac:
Logical programming (I have used GNU Prolog and its constraint solver for very similar problem) seems to be more suitable than procedural programming (Java, C, ...) for this kind of puzzles.
It is possible to translate this problem into a the notation of symbolic logic and solve it by appropriate method ,but this seems to be cumber some. On the other hand ,it is difficult to grasp the problem's logical structure without some sort of notational aid. The most convenient device to use is a matrix with vacant cells for all possible pairings of the elements in each set. In this case there are two sets. Hence two such matrices are required. Each cell is to be marked with "1" to indicate that combination is valid, or "0" to indicate that it is ruled out by the premises. As for example The last premise obviously eliminates the possibilty that Smith is the fireman so, place a ''0" in the upper right corner cell of the matrix at left.
(pl note that use truthtable doesn't solve th problem either.

Though basically this problem may be solved under prolog, the same can be tried by using two matrices and try to do the placing task in the respective cells in the matrix as indicated above. That is why a Java coded
Program viz doublearray. java has been given for a modification that calls for a method replacing
the aveg find method (in the prog shown) in order to get the solution for the problem.
It is here that gave me a scope to pose it especially those who are familiar with the creating
Matrix methods. as also we are within our limits if we solve the same with through java language since
We are in Java Lobby Forem and so the uses of JavaLang .
Thanks.Can any body fetch the solution...
As Always
C.R.Muthukumar
C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Originally posted by David O'Meara:
Is this a homework assignment or rent-a-coder task or something?

Hello Java knowledgers
It is better that the task or an assignment once appended
shall be tried for a succesfull finish as this seems to be
rather unfinshed though it is obvious that this program can be really made (treating it as Ranchers Assignment)as also mannual /proportion of the solutions are alrady narrated
Please try once again as per the below norms from c++ to Java

Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"C.R.Muthukumar",
Please check your private messages regarding an important administrative matter.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Originally posted by Steve Fahlbusch:
We would be glad to help you.

What do you have (ie: what have you done) so far?



This Java Program (Puzzler)making is not that easy as it looks so ,because none has come out with succesful completion.Obviously whatever has been done from my end is veryclear from the above post and lucid enough for an easy grasp.However let me give another try for coding the above puzzle which more or less more amounts for a closer approach to matrix making than earlier one.

Hello JavaKnowlegers,Makers
please convince yoursef that this puzzle can be coded in java but requiers only efforts after all,
"The secret of Success is constancy of Efforts"
Bye for now.

Ps: The above codes will enable you two make two matrices as per the two sets discussed earlier,but if modified would fetch the solution iteslf please try in Java from the cpluspluss



Thanking you


Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18765
    
  40

Hello JavaKnowlegers,Makers
please convince yoursef that this puzzle can be coded in java but requiers only efforts after all,
"The secret of Success is constancy of Efforts"
Bye for now.


What is so special about this C++ code that it can't be translated to Java? Heck, it is not even using pointers. And even if it was, it is only a dozen lines long. I doubt any C++/Java programmer, worth his/her salt, would need to convince ones self that this translations requires any effort.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
C.R.Muthukumar
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Originally posted by Henry Wong:


What is so special about this C++ code that it can't be translated to Java? Heck, it is not even using pointers. And even if it was, it is only a dozen lines long. I doubt any C++/Java programmer, worth his/her salt, would need to convince ones self that this translations requires any effort.

Henry


Bye for now
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

"C.R.Muthukumar", having ignored five (5!) requests for you to change your display name to adhere to JavaRanch standards your account has been closed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Puzzle for JavaProgrammers