Optimal Seat Allocation Algorithm [closed] - algorithm

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am looking for an optimal seat allocation algorithm, such that for example, if i have a cinema with capacity 100, and n groups of people, i want to choose the right groups that will fill in as maximum seats as possible.
The only thing that will work is brute force, but I'm sure there must be cleverer ways to do that. Any ideas?

This is a special case of the Knapsack problem known as the Subset Sum problem. There is a lot of work already done on this so the wiki article is a good jumping off point discussing many possible algorithms. The correct choice in algorithm will depend on the sort of data you’re operating on.

Related

n balls and n cups algorithm design [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
You are given n balls and n cups. Each cup holds a particular weight, and once a ball is placed in it tells you whether the ball is too heavy or light or just right. You can’t compare the weight of the balls directly. A perfect pairing between balls and cups exist. Design an expected nlogn algorithm to find the pairing. Hint: modify quicksort.
I’ve thought about this problem for a long time with no leads.
Is there a efficient way to compare the weight of two balls, or am I thinking about this wrong? Can someone please give a hint?
If you compare all balls with a single randomly picked cup, you will find the matching ball, and the other balls will be partitioned into those higher and those lower. You can use the matching ball to also partition the cups in a similar way. Then you have essentially randomized quicksort.

Need help finding a linear sorting algorithm [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Given a machine that can compute the kth smallest item of an Array A in 𝑂(√𝑛) time. Find a recursive function that can sort A in linear time corresponding to n which is the length of A.
First I tried to optimize some of the sorting algorithms I knew using this new property but the best I could do was O(n^3/2) and currently I'm wondering whether if it is possible or not.

EV function for 2048 video game [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What is the best admissible heuristic function for 2048 video game? Please give example of initial state and next state and how to compute the value of the evaluation function?
It is hard (if not impossible) to label an heuristic as "best".
One idea I have in mind is evaluate the heuristic for the current state as the maximum value of all the tiles at this state. And then, that with the higher value is supposed to be better ("closer") to the goal.
And it is admissible because it is never would be lower than the real value (that would mean that the current maximum is not the maximum, and that is not possible).
Probably, you can expand this heuristic with something as: given the current maximum position, is one of its (up to) 4 neighbours of the same value so they can sum up? But that requires a bit more of sophistication in order to keep it admissible.

Maximum number of clues in a Sudoku game that does not produce a unique solution [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
You may have heard that last year it was proven that the smallest number of starting clues for a Sudoku game, guaranteeing a unique solution, is 17.
An example is shown below.
I am interested in the opposite:
What is the largest number of starting clues for a Sudoku game that does not guarantee a unique solution?
I have a lower bound of 63. This is if you take a solved Sudoku and delete every instance of two numbers (i.e., delete all the 1s and 2s). Alternatively, you could delete the top two rows, again yielding two different solutions for 63 starting clues.
Can you do better than 63, or is 63 is the highest?

Find number of integral solution of 1/x+1/y=1/Nfactorial [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
This question is a practice problem on interviewstreet.com.
Find number of integral solution of 1/x+1/y=1/N! for a given N
For N=1 answer is 1.
I tried to solve this questions , but cant predict from where to start. I am not from math background.
I am looking for the approach , how should I proceed towards the solution.
Is there any direct formula for this?
Try to solve it as a iterative problem. All the solutions of N-1 are also valid for N. The only uncovered solutions are where x and y are both not divisible by N, which should be easier to count.

Resources