| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|
#1 (permalink) |
|
Super Moderator
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,332
Thanks: 115 Thanked 227 Times in 187 Posts Thanks: 115
Thanked 227 Times in 187 Posts
Blog Entries: 2
Rep Power: 50
|
Puzzle asked in Oracle : What is the number?
There are 5 digits (XXXXX) in a number and each digit of the number has a specific meaning.
1 st digit -> represents number of 0's in the number 2 nd digit -> represents number of 1's in the number 3 rd digit -> represents number of 2's in the number 4 th digit -> represents number of 3's in the number 5 th digit -> represents number of 4's in the number What is the number? Also explain your approach to solution if there is any logical approach. Thanks, Krishna
__________________
Give 1 cup rice to a hungry Indian just by a mouse click. No money, no form filling, no hassle... Click here for the donation. |
|
|
|
|
|
#3 (permalink) |
|
Super Moderator
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,332
Thanks: 115 Thanked 227 Times in 187 Posts Thanks: 115
Thanked 227 Times in 187 Posts
Blog Entries: 2
Rep Power: 50
|
Re: Puzzle asked in Oracle : What is the number?
You are correct romeovictor. It is the only possible number.
Is there any logical approach for this? If you can explain how you scoped the number of possibilities to 1 would be of very useful to us. Thanks, Krishna
__________________
Give 1 cup rice to a hungry Indian just by a mouse click. No money, no form filling, no hassle... Click here for the donation. |
|
|
|
|
|
#4 (permalink) |
|
Super Moderator
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,332
Thanks: 115 Thanked 227 Times in 187 Posts Thanks: 115
Thanked 227 Times in 187 Posts
Blog Entries: 2
Rep Power: 50
|
Re: Puzzle asked in Oracle : What is the number?
Here is the java program which does the same....
/* **************************************************** */ /* here is the puzzle for which the code finds solution.*/ /* */ /* There are 5 digits (XXXXX) in a number and each digit*/ /* of the number has a specific meaning. */ /* */ /* 1 st digit -> represents number of 0's in the number */ /* 2 nd digit -> represents number of 1's in the number */ /* 3 rd digit -> represents number of 2's in the number */ /* 4 th digit -> represents number of 3's in the number */ /* 5 th digit -> represents number of 4's in the number */ /* */ /* What is the number? */ /* **************************************************** */ public class puzzle { static int a[]=new int[5]; static int getNumberCount(int searchnumber) { int count=0; for(int i=0;i<5;i++) { if(a[i]==searchnumber) count++; } return count; } public static void main(String args[]) { for(a[0]=1;a[0]<=4;a[0]++) for(a[1]=0;a[1]<=4;a[1]++) for(a[2]=0;a[2]<=4;a[2]++) for(a[3]=0;a[3]<=4;a[3]++) for(a[4]=0;a[4]<=4;a[4]++) { if(a[0]==getNumberCount(0) && a[1]==getNumberCount(1) &&a[2]==getNumberCount(2) &&a[3]==getNumberCount(3) &&a[4]==getNumberCount(4)) System.out.println("Number : "+a[0]+a[1]+a[2]+a[3]+a[4]); } } }
__________________
Give 1 cup rice to a hungry Indian just by a mouse click. No money, no form filling, no hassle... Click here for the donation. |
|
|
|
|
|
#5 (permalink) |
|
Member
Join Date: Jun 2007
Location: kochi, kerala, india
Age: 27
Posts: 31
Thanks: 1 Thanked 0 Times in 0 Posts Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 2
|
Re: Puzzle asked in Oracle : What is the number?
the only possible logical solution is elimination.
i started with the first number and eliminated all other numbers except 1 & 2 if i give 1 then the second number will be 2 or 3 and the third number will be either 2 or 3 then it wont be possible to solve the equation thei i put 2 in the first place and in the third place i had only one place left and that could be only the first place and the number could be only 1. thats all RV Last edited by romeovictor04; 20-08-07 at 09:44 PM. |
|
|
|
|
|
#7 (permalink) |
|
Junior Member
Join Date: Feb 2008
Age: 24
Posts: 4
Thanks: 1 Thanked 0 Times in 0 Posts Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 1
|
21200
31000 40000 are the possible solution (there might be few more ).Logic is just arrangement and 0 plays great deal of role in it . |
|
|
|
|
|
#9 (permalink) | |
|
Junior Member
Join Date: Apr 2008
Posts: 1
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: Puzzle asked in Oracle : What is the number?
Quote:
In "31000" u used number 3, then u should specify the number of 3's in the 4th digit. Similarly in "40000" u used 4 in the first digit but should specify number of 4's in the 5th digit. |
|
|
|
|
|
|
#10 (permalink) |
|
Junior Member
Join Date: Apr 2008
Age: 25
Posts: 1
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: Puzzle asked in Oracle : What is the number?
Hi Kireeti.
Could you please explain me clearly i am confused !!!!!!!!!! please explain me the method how you selected those numbers only adn how you concluded ..... Please do reply |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| must read all UG students!!!!!!!!!!!!! | sanjay | Other Queries | 15 | 04-09-08 03:10 PM |
| ORACLE India - Walk-In For BSc and BCA freshers of 2005 & 2006 (0-2 yrs.) | sridhar | Walk-ins | 2 | 04-08-08 10:49 PM |
| tips for interview | ozobalu | HR Questions | 6 | 07-02-08 01:14 PM |
| Oracle Apps Functional H1b Visa 2007 | sridhar | EXPERIENCED JOBS | 0 | 04-03-07 01:12 PM |
| TCS PAPER & INTERVIEW - 23 JUN 2006 | sridhar | TCS Placement Papers | 0 | 12-02-07 04:01 PM |