Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

1. ## 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 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.

• 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.

• well guess what.... that is not a school assignment!... And yiou you don't wanna hel you can just keep it to yourself!

• 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.

•

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•