|
|
1. It depends on the data type. If ASCII, a 6 would become 00100100; if straight binary, 6 = 00000110. It might also be that the entire number is one encoded value, which a straight decimal to binary converter will give you. That's why I say the problem is not well enough defined to solve easily. If the source is text data, the ASCII format is likely, if it's a simple device using an 8-bit processor that is producing this data, the 8-bit straight binary is possible. If it's something else, like stolen launch codes for Italy's secret intercontinental wine bottle launch system, then the whole number might be a single value that needs to be converted. There's no way to tell from the question.
2. If I knew how to do that I'd be making a whole lot more money cracking financial data streams for the IRS. Read a book on encrytion/decrytion methods and pick one. Bruce Schneier's Applied Cryptography is a good introduction.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hello
is any one knows if there is a library in the .net deals with "math union and intersection"
and thanks for all
|
|
|
|
|
Theres a bunch of extension methods on Hashset (framework 3+) that do this. Nice for smaller things, probably not overly optimised for larger sets.
|
|
|
|
|
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
x-1 .... 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:
(x-6)(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 camera-table.
It's quite easy to build a list ofunique combinations of participant-pairs.
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
P1-P2 P2-P3 etc..
P3-P5 P1-P6
P4-P6 P5-P4
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 digital-camera table.
At each round, prefer assigning a combination to the digital-camera table where neither participant in that combination has been to the digital-camera 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
P2-P1,P3-P1,P4-P1,P5-P1,P6-P1,P5-P3,P6-P3
P4-P3,P4-P2,P3-P2,P6-P2,P5-P2,P6-P4,P5-P4
P6-P5
Though, it can be doen in 5 rounds:
R1____R2____R3____R4____R5___R6____R7
P2-P1,P5-P1,P3-P1,P4-P1,P1-P6,-----,-----
P4-P3,P4-P2,P5-P2,P2-P6,P2-P3,-----,-----
P6-P5,P3-P6,P4-P6,P3-P5,P4-P5,-----,-----
(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 table-number to pairs.
Do you have an anwser for step #1?
Again, thanks for your help!
P.S. Sorry for the poorly drawn grid-mockup, 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 1-3, participants with the same hair-color have to meet. If there's no match assign random participant.
Round 4-6, participants with the same eye-color have to meet. If there's no match assign random participant.
I can fill in round 1-3... it's still a struggle though. For each matching hair-type I've created a 'rolling-table' and on the empty places I assign a random participant (from collection of non-matches). After all the rollingtables have finished, I make a rolling-table of the left-overs (non-match collection) and process them as well.
The problem is that I don't know how to continue. Some particpants could have matching hair-color as well as eye color. How do avoid fall-out because of double matching?
When P1 and P2 have brown hair and grey eyes, the could have met during round 1-3, If they did they should not meet again. But there're other Participants with grey-eyes 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 'rolling-table'. 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 eye-color, 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 re-sorted. Doing that will override the roilling-table 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 eye-color matching rounds.
Even if the eye-color 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 same-color 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
|
|
|
|
|