

As the other poster says these are available in .NET 3.5. If you're still on .NET 2.0/3.0 then try the PowerCollections[^] library.
Kevin





I know that setting the denominators to zero will give me critical numbers, but from there on out I'm confused how to find anymore
equation given is:
3x ......... x
 <=  + 3
x1 .... x+4
now I know that my two critcal numbers are 1 and 4, so my intervals right now are from (infinity, 4] U [4, 1), but after putting in any number [6, inifinity) the statement holds true. How is 6 a critical number?
Thanks in advance.
modified on Thursday, October 9, 2008 11:09 AM





The critical number is just a point (not an interval), in this case 6 isn't a critical point...
Aside from the critical points, it's not clear what you are trying to find. Are you trying to find the intervals on which the function is differentiable?
“It is better to fail in originality than to succeed in imitation.”





73Zeppelin wrote: Aside from the critical points, it's not clear what you are trying to find.
No, it is not clear.
"The clue train passed his station without stopping."  John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks"  Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago."  Rob Graham





yeah, i'm looking for the intervals
the intervals i got were (infinity, 4)U(4, 2)U[6,infinity)
correct?





Why 6?
“It is better to fail in originality than to succeed in imitation.”





I wonder that as well. When x is greater than or equal to 6, the inequality does hold true. Not sure if the OP is aware of this or what. There is only two critical values, the two zeroes ( x=4, x =1 )...
"The clue train passed his station without stopping."  John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks"  Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago."  Rob Graham





Paul Conrad wrote: I wonder that as well. When x is greater than or equal to 6, the inequality does hold true. Not sure if the OP is aware of this or what. There is only two critical values, the two zeroes ( x=4, x =1 )...
Yeah, I'm just trying to get an idea about what exactly he wants to know!
But yes, there's only two critical points.
The whole expression factors down to:
(x6)(x+2) >= 0
So that's where the 6 comes from. Looks like he's right with the intervals (if that's what he's looking for...)
“It is better to fail in originality than to succeed in imitation.”
modified on Friday, October 10, 2008 5:27 AM





I don't know what your exact definition of critical number is, but the key breakpoints for this function are the two poles x=1 and x=4, and the two solutions of the equality which are x=2 and x=6.
As the inequality is true for very large positive and negative x, it is true for
(inf, 4]
[2, 1]
[6, inf)
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."






Cool.
Kevin





Hi,
I have a variable amount of participants.
Each participant needs to talk to another participant in a minimal amount of total rounds.
Of all the tables (2 seats per table) there's 1 with a digital camera, which records the conversation (educational purposes).
Every participant must be placed (at least once) at the cameratable.
It's quite easy to build a list ofunique combinations of participantpairs.
But how do I continue?. Because of my lack of knowledge I can't seem to solve this puzzle.
Do I need some sort of algorithm for this? If so, can you point me in the right direction?
Participants:
P1,P2,P3,P4,P5,P6
Round1 Round2 Round3 Round4 Round5
P1P2 P2P3 etc..
P3P5 P1P6
P4P6 P5P4
Help appreciated.
modified on Monday, October 6, 2008 2:07 PM





Take your list of unique combinations, and assign one combination each round to the digitalcamera table.
At each round, prefer assigning a combination to the digitalcamera table where neither participant in that combination has been to the digitalcamera table yet.





Thanks for sharing your thoughts wit me on this.
Apart from the fact that pairs have to sit at 'camera'position at least once, I already run into problems with the arrangement of pairs in general. This is what happens when I let the 'normal' logic do it's job with (only) 6 participants:
NOTE. Not taking in account the digital camera position.
Generated:
R1____R2____R3____R4____R5___R6____R7
P2P1,P3P1,P4P1,P5P1,P6P1,P5P3,P6P3
P4P3,P4P2,P3P2,P6P2,P5P2,P6P4,P5P4
P6P5
Though, it can be doen in 5 rounds:
R1____R2____R3____R4____R5___R6____R7
P2P1,P5P1,P3P1,P4P1,P1P6,,
P4P3,P4P2,P5P2,P2P6,P2P3,,
P6P5,P3P6,P4P6,P3P5,P4P5,,
(Rx = Round, Px = Participant)
I have no idea how to translate the logic of the bottom grid. For participants < 10 I can probable find a (workaround) way, but the software is intended for larger groups (up to 50).
The steps I think I have to make:
1. Create general arrangement for pairs per round. But how do I arrange them in a minimal amount of total rounds??
2. Assign tablenumber to pairs.
Do you have an anwser for step #1?
Again, thanks for your help!
P.S. Sorry for the poorly drawn gridmockup, I hope it clarifies my problem.





1. Arrange the tables in a row
2. One participant stays fixed at an end table
3. For each round, every participant except the fixed one rotates position around the tables.
For 4 participants:
2 3 => 3 4 => 4 2
1 4 1 2 1 3
For 6 participants:
2 3 5 => 3 5 6 => 5 6 4 => 6 4 2 => 4 2 3
1 4 6 1 2 4 1 3 2 1 5 3 1 6 5





Wow, that certainly looks like a solution what might do the trick.
I have no clue for now, how to implement this in c#, but it's certainly worthwhile investigating.
Excellent help. Thanks!!





Help, I'm stuck again.
Your solution works like a charm. I've written a custom class with 2 Arrays and a rotate function. The rotate function shifts the value positions within the Arrays, except for position 1 in Array 1.
I'm walking into problems when I have certain criteria conditions per round(s).
For example:
Round 13, participants with the same haircolor have to meet. If there's no match assign random participant.
Round 46, participants with the same eyecolor have to meet. If there's no match assign random participant.
I can fill in round 13... it's still a struggle though. For each matching hairtype I've created a 'rollingtable' and on the empty places I assign a random participant (from collection of nonmatches). After all the rollingtables have finished, I make a rollingtable of the leftovers (nonmatch collection) and process them as well.
The problem is that I don't know how to continue. Some particpants could have matching haircolor as well as eye color. How do avoid fallout because of double matching?
When P1 and P2 have brown hair and grey eyes, the could have met during round 13, If they did they should not meet again. But there're other Participants with greyeyes that will have to meet with P1 and P2....
I'm thinking about this for the last couple of days and can't solve this. Much respect rewarded for solving this.
Thanks!





It seems like your additional constraints can be met by setting the initial ordering so that participants with the same hair/eye color will meet in the appropriate rounds. Then just follow the same matching process.





That's what crossed my mind as well... but I think that method can't be combined with the 'rollingtable'. Beneath my interpretation of your idea.
The initial setup could be a full match, like so:
Hair color
Brown Blond
1 2 3 7 8 9
4 5 6 10 11 12
1,2,3,4,5,6 = brown hair
7,8,9,10,11,12 = blond hair
Rotate()
Hair color
Brown Blond
1 3 7 8 9 12
2 4 5 6 10 11
As soon as the table rotates it's values, 7 and 6 start matching with incorrect participants. The number of faulty matches will increase with each rotate.
And how do I match participants on eyecolor, as I have already sorted them on hair color.

Currently I've assigned a rolling table to each hair color
After the rotate(s), everything looks fine.
Hair color
Brown Blond
1 3 6 8 9 12
2 4 5 7 10 11
Brown = rotating table
Blond = rotating table
This method works for the first couple of rounds. Until the participants have to be resorted. Doing that will override the roillingtable logic and participants will meet eachother twice, never or none (empty place)
Eye color
Brown Blue
4 6 7 1 2 3
8 10 12 5 9 11
1,2,3 and 5 have already met during the haircolor match. They will meet eachother again during the eyecolor matching rounds.
Even if the eyecolor match would work.
Last rounds everybody should meet eachother who have not seen the other yet.
** it's making me nuts! **
*sigh*
P.S. I REALLY appreciate your input!
modified on Thursday, October 16, 2008 10:04 AM





The problem is starting to get interesting. For some participant sets there may be no perfect solution.
A characteristic of this problem is that good solutions to the whole problem will tend to be composed of good solutions to subproblems (e.g. with samecolor participants matched during certain rounds). This characteristic suggests two promising approaches: 1. Dynamic Programming and 2. Genetic Algorithms.
Dynamic Programming builds up optimal solutions for small numbers of participants, combining them to construct optimal solutions for greater numbers of participants. Genetic Algorithms take a set of complete solutions, rank them, and combine the best ones to (hopefully) make better ones.
A third approach (which may be best if you can figure out how to implement it) is to take a decent solution, then transform it one step at a time to progressively better solutions. For example, order the participants so that matching colors mostly meet during the appropriate rounds. Then for the particpants that DON'T match during these rounds, swap partners so that they DO match. The challenge here is to make other corrections to compensate for this disruption to the paring system.





Where can I find sample codes showing implementation of Monte Carlo rabin_karp search.
Thanks





From this website[^].
Algorithm 9.2.8 Monte Carlo RabinKarp Search
This algorithm searches for occurrences of a pattern p in a text t. It prints out a list of indexes such that with high probability t[i..i +m− 1] = p for every index i on the list.
Input Parameters: p, t
Output Parameters: None
mc_rabin_karp_search(p, t)
{
m = p.length
n = t.length
q = randomly chosen prime number less than mn2
r = 2m−1 mod q
f[0] = 0
pfinger = 0
for j = 0 to m1
{
f[0] = 2 * f[0] + t[j] mod q
pfinger = 2 * pfinger + p[j] mod q
}
i = 0
while (i + m ≤ n)
{
if (f[i] == pfinger)
prinln(“Match at position” + i)
f[i + 1] = 2 * (f[i] r * t[i]) + t[i + m] mod q
i = i + 1
}
}





Thanks, but am after a working example not just a pseudocode.





Angelinna wrote: but am after a working example not just a pseudocode
plz gimme codez (urgent?)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
 Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
 Iain Clarke
[My articles]





Angelinna wrote: am after a working example not just a pseudocode
Why can't you take the pseudo code and implement it in what ever language you are programming in?
"The clue train passed his station without stopping."  John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks"  Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago."  Rob Graham




