Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-14-2002, 12:14 PM   PM User | #1
katja
New to the CF scene

 
Join Date: Oct 2002
Location: Gothnburg, Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
katja is an unknown quantity at this point
Unhappy Java:

Hello! This is a little task I have below. Can anyone help me? It should be written in Java.


Background
Suppose that you have n^2 football teams, there n is an arbitrarily integer bigger than
or equally with 2.
Divide these teams in groups with n teams in each. IN example below is n=3
and teams are called A, B, C, ... Order between groups and
order between teams within groups plays none role:
A B C D E F G H I
Now let your teams meet within its respective groups. When this is done
you make a new division off teams in groups with n teams in each. There are some terms: Team that earlier has been in same group mustn't
land up in same group again! We can for ex do following division:
A D G B E H C F I
Now we repeat this n+1 times totally, all along with a rule that two teams
that already have been in same group cannot land up in group with each other
again.
After n+1 rounds have each team encountered just n^2-1 teams.
Question is: " Can you find such an arrangement so that each
team encounters each other team exactly once?"


Here is example for n=2 , there a feasible solution would be:
A B C D
A C B D
A D B C
There are several feasible solutions, but the important is just that you have
changed order of rounds and/or order of groups and/or order
of teams within groups comparing with the solution above.
The task.
The task is to write a program that takes in a rate on and
tests if it goes to do a correct arrangement for this.
You can for ex let the program test all feasible
combinations in order to see if they fulfil the term.

For a given n there are two feasible results:
1 Either the program finds a solution. Then the program should print
the found the solution on screen. However it is enough the program finds
one solution, it doesn’t have to look for several.

2 Or the program tests all possibilities and comes to a conclusion that there is no solution. If so, this should be printed out.
The problems with this the task is that for a little bigger n it takes so
long time to test all combinations.
Then can you find and implement some optimisations that do that
the program not acquires testing just all possibilities, for ex through
utilising symmetry. But you should motivate why the optimisation you did were ok and you won't miss any solutions because of them.
The point with the task is to make the program manage the solution
(i.e. come to either cases 1 or cases 2 above) in a reasonable time, there reasonable
time can be maximum a day.
katja is offline   Reply With Quote
Old 11-14-2002, 04:47 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,225
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
This sounds much like a school homework assignment. We will not do your homework for you.

If while doing your homework assignment you have specific questions on java syntax and concepts we can answer those questions.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 11-14-2002, 06:00 PM   PM User | #3
katja
New to the CF scene

 
Join Date: Oct 2002
Location: Gothnburg, Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
katja is an unknown quantity at this point
well guess what.... that is not a school assignment!... And yiou you don't wanna hel you can just keep it to yourself!
katja is offline   Reply With Quote
Old 11-14-2002, 06:18 PM   PM User | #4
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,225
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Yeah right. I guess it's just a coincidence that you are listed as a college student in your profile.

Looks just like the kind of programming assignment a computer science instructor would give.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 11-18-2002, 04:52 AM   PM User | #5
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:33 AM.


Advertisement
Log in to turn off these ads.