Questions tagged [sets]
Questions about finite and infinite sets and multisets, related data structures and concepts.
442 questions
0 votes
0 answers
29 views
Unordered Variant of "Minimum Cost Tree From Leaf Values"
This problem is based on https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/description/ : Given an array arr of positive integers, consider all binary trees such that: Each node has ...
0 votes
1 answer
100 views
Efficient “sentence” lookup by set of “words”
Imagine I know a vocabulary of 10 words in any language. I also have a large corpus of sample sentences that are broken into words. I’d like to efficiently look up all sentences in my corpus that only ...
1 vote
0 answers
42 views
Intersections of Sets of Strings (Alabama, Alaska, Arizona, Arkansas)
Consider the following four strings of text: Alabama Alaska Arizona Arkansas These strings of text represent four names for four different states within the United States of America. Suppose that we ...
1 vote
1 answer
107 views
What's the real life uses of Reflexive Closure in computer science?
I was tasked to discuss Reflexive Closure, in relation to computer science. In Discrete Mathematics context, its basically a set that relates to an element itself. But I just can't find any ...
0 votes
0 answers
65 views
Question regarding coinduction
I'm rather stuck with the example of proof by coinduction, as generally known the principle is written as: $$ P\subseteq F(P)\implies P\subseteq \nu F $$ in an old problem When can the coinduction ...
1 vote
0 answers
55 views
Construction of a polynomial time algorithm
We are currently learning derandomization, which aims to transfer a probabilistic proof into a deterministic algorithm. My problem is as follows. Given $n$, constructs in time polynomial in $n$, a ...
0 votes
1 answer
51 views
How to find the minimum set of members of many sets
Given many sets, what algorithm finds the minimum set(s) of members present in all those sets? For example, given these sets: {1,2} {1,2,44} {2,5,6} {5,6} The ...
2 votes
1 answer
786 views
Definition feels contradictory (Computational Complexity Theory)
I studied a definition for time complexity: Let $M$ be a deterministic Turing Machine. The running time of $M$ is said to be: for a function $t: \mathbb{N} \to \mathbb{N}$ ($\mathbb{N}$ is natural ...
3 votes
1 answer
109 views
Is there an algorithm for rearranging a set in a specific way while optimizing for minimum amount of moves?
Say I have an array that goes like [ a, c, b, d ] and I want it rearranged as [ d, c, a, b ]. The only type of change I'm allowed to make is plucking an element from one place and inserting it into ...
0 votes
1 answer
112 views
Binary subset rank and unrank
Let there be "N" bits. We want to rank and unrank a specific subset of bit combinations based on the following criteria - ...
0 votes
0 answers
69 views
Can you make the following "coinductive" proof precise?
Question: I have a proof which overwhelmingly feels like it's a proof "by coinduction." Unfortunately I can't coinduct my way out of a paper bag, so I don't know if this actually works. I ...
1 vote
1 answer
143 views
Is this intersection set problem NP-Hard?
Suppose we have collection of n sets $S_1, S_2, \dots, S_n$. Each set has a size of at least $k$. We know for sure that $\exists k$ sets where all of them contain the same $k$ elements; $|S_1 \cap S_2 ...
2 votes
1 answer
98 views
Decide whether this Problem NPC or P?
Input: A finite set A, subsets S1, . . . , Sn ⊆ A, and a number k ∈ N. Question: Does there exist a set R ⊆ A with |R| = k such that |R ∩ Si| = |Si| for all 1 ≤ i ≤ n? I read somewhere (without ...
2 votes
1 answer
218 views
Given two sets of integers find an integer in the first set furthest away from all members of the second set
If given two sets of integers how can I find an integer in the first set furthest away from all members of the second set. The distance of two integers is the absolute value of difference of the two ...
4 votes
0 answers
56 views
Cardinalities in set coverings
Let $I$ be a set of items; $C \subseteq \mathcal{P}(I)$ be a set of subsets of $I$, where $\mathcal{P}(I)$ stands for the power set of $I$; And $C(i) = \{ c \in C \mid i \in c \}$ be the set of sets, ...