set-theory

Logic to select a specific set from Cartesian set

二次信任 提交于 2019-12-20 04:12:10
问题 I'm making a password brute forcing tool as a learning exercise, and I want it to be resumable. So, what I want is to be able to say, this is the set of possible characters, if I computed the Cartesian set of every possible combination of this set up to length n, what is the set at point x? However, I want to do this without computing the entire set. I've seen similar logic in one place online but I was unable to generalise this to fit. Any help would be fantastic, thanks! I'm fluent in C# if

Logic to select a specific set from Cartesian set

雨燕双飞 提交于 2019-12-20 04:12:04
问题 I'm making a password brute forcing tool as a learning exercise, and I want it to be resumable. So, what I want is to be able to say, this is the set of possible characters, if I computed the Cartesian set of every possible combination of this set up to length n, what is the set at point x? However, I want to do this without computing the entire set. I've seen similar logic in one place online but I was unable to generalise this to fit. Any help would be fantastic, thanks! I'm fluent in C# if

Is there set division in SQL?

送分小仙女□ 提交于 2019-12-20 01:36:05
问题 I'm fully aware that set division can be accomplished through a series of other operations, so my question is: Is there a command for set division in SQL? 回答1: http://vadimtropashko.files.wordpress.com/2007/02/ch3.pdf From Page 32: Relational Division is not a fundamental operator. It can be expressed in terms of projection, Cartesian product, and set difference. So, no. :) 回答2: Related question: Database Design for Tagging And relevant part of answer is this article So in short, no, there is

Is there a way to remove the nested query in this type of SQL SELECT?

笑着哭i 提交于 2019-12-12 09:17:40
问题 Given this table structure and example data (t3 should not be used in the query, it is only here to show the relation between t1 and t2): t1 t2 t3 -------------- ----------------- -------------------------------- | id | value | | t1key | t3key | | id | value | | 1 | 2008 | | 3 | 1 | | 1 | "New intel cpu in 2010" | | 2 | 2009 | | 4 | 1 | | 2 | "New amd cpu in 2008" | | 3 | 2010 | | 6 | 1 | | | ... | | 4 | intel | | 1 | 2 | -------------------------------- | 5 | amd | | 5 | 2 | | 6 | cpu | | 6

What is an efficient algorithm for determining the generating sets whose product contains all required permutations?

强颜欢笑 提交于 2019-12-11 08:47:09
问题 Consider a list of permutations (order-relevant combinations) of the form : (1 2 3) (1 2 4) (5 2 3) (5 2 4) I need to find the smallest number of generating sets for this permutation group. For example, given the permutations above, (1 2 3,4) (5 2 3,4) Is not an optimal solution. The optimal solution is (1,5 2 3,4). You will notice that this solution contains sets A={1, 5} B={2} and C={3,4} The original list of permutations is the ordered Cartesian product of these sets: A X B X C. I would

MongoDb Except equivalent

*爱你&永不变心* 提交于 2019-12-11 06:35:27
问题 I have a question about a problem I came across while trying to use $setDifference on a collection of documents. All I want to have are all documents that are contained in Root 1 and remove all documents that are also included in Root 2 based on the "reference.id". My collection represents two tree structures and basically looks like this: /* Tree Root 1 */ { "_id" : LUUID("9f3a73df-bca7-48b7-b111-285359e50a02"), "name" : "Root 1", "children" : [ LUUID("ca01f1ab-7c32-4e6b-a07a-e0ee9d8ec5ac"),

Crafting a LINQ based solution to determine if a set of predicates are satisfied for a pair of collections constrained by a set of invariants

与世无争的帅哥 提交于 2019-12-11 00:57:56
问题 This isn't a question I feel I have the vocabulary to properly express, but I have two collections of the same anonymous type (lets call it 'a .) 'a is defined as new {string Name, int Count} One of these collections of 'a we shall call requirements. One of these collections of 'a we shall call candidates. Given these collections, I want to determine if the following assertions hold. If there exists some element in requirements r such that r.Count == 0 , each element in candidates c such that

Proving a set of requirements can be met with a set of values using LINQ

余生颓废 提交于 2019-12-10 10:18:25
问题 This is a subset of the question posted here. Given a set of buckets of volume B={x1, x2, ..., xn} and a set of vials with liquid of volumes V={v1, v2, ..., vn } what is the best way to prove that the number of buckets can be filled with the contents of the vials assuming that vials must be poured all into one bucket. Overflow is permitted. Some obvious invariants here are that the cardinality of the buckets |B| must be less than or equal to the cardinality of the vials |V| and that the

Database operation that can be applied repeatedly and produce the same results?

风格不统一 提交于 2019-12-08 16:27:14
问题 I'm drawing a blank, or as some would say, having a senior moment. I know there’s a formal definition and a name for the concept where a db operation (stored procedure) that runs in a database will yield the same results if run repeatedly. It's something in the genre of the Mathematician’s reflexive, symmetric, transitive, etc. 回答1: Do you mean "deterministic" - as in will always return the same result if called with the same input? Or maybe "idempotent", which also means that calling the

Proving a set of requirements can be met with a set of values using LINQ

孤者浪人 提交于 2019-12-06 01:01:59
This is a subset of the question posted here . Given a set of buckets of volume B={x1, x2, ..., xn} and a set of vials with liquid of volumes V={v1, v2, ..., vn } what is the best way to prove that the number of buckets can be filled with the contents of the vials assuming that vials must be poured all into one bucket. Overflow is permitted. Some obvious invariants here are that the cardinality of the buckets |B| must be less than or equal to the cardinality of the vials |V| and that the combined volume of the buckets Sum(B) must be less than or equal to the combined volume of the vials Sum(V)