Skip to main content

Questions tagged [sets]

Questions about finite and infinite sets and multisets, related data structures and concepts.

0 votes
0 answers
29 views

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 ...
Elan SK's user avatar
0 votes
1 answer
100 views

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 ...
copumpkin's user avatar
  • 101
1 vote
0 answers
42 views

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 ...
Toothpick Anemone's user avatar
1 vote
1 answer
107 views

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 ...
Charles Khervie's user avatar
0 votes
0 answers
65 views

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 ...
Dylech30th's user avatar
1 vote
0 answers
55 views

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 ...
Zeta's user avatar
  • 111
0 votes
1 answer
51 views

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 ...
Victor L's user avatar
  • 101
2 votes
1 answer
786 views

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 ...
lonewolfx86's user avatar
3 votes
1 answer
109 views

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 ...
user81993's user avatar
  • 161
0 votes
1 answer
112 views

Let there be "N" bits. We want to rank and unrank a specific subset of bit combinations based on the following criteria - ...
Dave's user avatar
  • 25
0 votes
0 answers
69 views

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 ...
Siddharth's user avatar
  • 171
1 vote
1 answer
143 views

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 ...
Xfae's user avatar
  • 13
2 votes
1 answer
98 views

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 ...
Arugo's user avatar
  • 59
2 votes
1 answer
218 views

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 ...
hovnatan's user avatar
  • 123
4 votes
0 answers
56 views

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, ...
Matheus Diógenes Andrade's user avatar

15 30 50 per page
1
2 3 4 5
30