• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Puzzle for JavaProgrammers

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this a homework assignment or rent-a-coder task or something?
 
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We would be glad to help you.

What do you have (ie: what have you done) so far?
 
C.R.Muthukumar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"C.R.Muthukumar",
Please check your private messages regarding an important administrative matter.
-Ben
 
C.R.Muthukumar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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


 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
C.R.Muthukumar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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.
reply
    Bookmark Topic Watch Topic
  • New Topic