instruction
stringlengths
35
29.1k
A deck of cards is 52. A hand is 5 cards from the 52 (cannot have a duplicate). What is the least amount of bits to represent a 5 card hand and how? A hand is NOT order dependent (KQ = QK). 64329 = 96432 Yes, can use 52 bits. That can represent a hand of any number of cards. Given a hand is exactly 5 cards is ther...
What is the Monodic Second Order formula that encodes all binary strings that represent a valid parenthesis matching ? By this I mean 1s represent '(' and 0s represent ')' and at every position, number of 1s in the prefix is greater than or equal to the number of 0s . Can someone tell me how to proceed ? Thanks!
In a recent IT class we got the task of creating a finite state automaton that accepts only the words "auto" "automarke" "tomaten" and "automaten" and no others. Basically the whole class had no problems finding a 17 state solution, except for the guy two seats next to me who is incredibly convinced that its possible i...
I need prove that any red-black tree with at least two elements obtained through the insertion algorithm has at least one red node. For this, I need use Induction. I don't understand how apply induction. (((
I've not been able to find a precise definition of "stack depth" anywhere and have a rather simple question. When dealing with trees I'm used to the maximum depth (or height) of the tree being the longest simple path between the root node and a leaf. For instance, if we had a longest simple path of length $n$, there wo...
Garey and Jhonson mentions that a 3-SAT Problem can be transformed to another NP-Complete Problem - Simultaneous incongruences (AN2): Given a collection $[(a_1,b_1),…,(a_n,b_n)]$ of ordered pairs of positive integers with $a_i≤b_i$ for $1≤i≤n$, is there an integer $x$ such that for all $i$, $x≢a_i(mod\ b_i)$? But I am...
I came across Paul Turner work on increasing efficiency of M:N threading model. I am not able to grasp the concept at slide 18 of LPC-User-Threading It says : for two threads A and B : Minimal scheduling operation. ● B inherits A’s virtual runtime. ● B was not runnable, so we don’t need to remove it from runqueues. ● B...
A tree is balanced if the subtrees of each node differ in height by at most one. How many balanced binary trees can we create from $n$ nodes?
According to source page 20, theorem 1.9, it states that there is a universal Turing machine that can simulate any Turing machine with a time overhead of $O(\log n)$. Can a universal Turing machine exists with less overhead? Can we prove that no such universal Turing machine exists? If not, can we at least prove a low...
At present, I am doing a project on Optical Character Recognition (OCR). I am looking forward to improve the results by checking the output words of my OCR code with existing words from a text file. The file contains all English words. Word is good to go if it exists in the file, but if it doesn't then I want to replac...
The Builder Pattern solves the problem of Telescoping Constructors; that is, having a single constructor for every possible parameter combination (including those combinations for which a parameter is omitted). So for example: public Food(int id, String name) { this(id, name, 0, 0, 0); } public Food(int id, ...
Fix an input and tape alphabet $\Sigma$ and $\Gamma$. Let P be a property of turing machines over these alphabets, i.e., a subset of $\{\langle M \rangle \mid M \text{ is a TM over the alphabets } \Sigma \text{ and } \Gamma\}$. Define COUNT_P to be the function $\mathbb{N} \to \mathbb{N}$ describing the number of $n$-s...
It's a question of a problem set. If I search for all possible cuts on a network graph and return the minimum, (so it will be equal to max flow), what will be the complexity of running this?
I am looking for an encoding algorithm that would have an encoding function with highly expensive computational costs (ideally like scrypt). At the same time its decoding function must be a lot easier to calculate. Computational costs should not depend on the size of the encoded data. The size of the encoded data can ...
This is a question that's been bugging me off and on for years, ever since I took a compiler theory class as an undergraduate. There, we learned how to convert a regular expression into a non-deterministic finite automaton, then convert that into a deterministic finite state machine, then minimize that state machine. ...
Let $x$ be an integer such that $x \in [ - 10,10]$ and $b$ a binary variable. Apply integer programming to express $b = 1 \leftrightarrow x \ge3$ My work: \begin{equation} \begin{cases} \text{if}\,\,\,\,\ b = 1, & \text{then}\,\,\,\,\,\,\ x \ge3 \\ \text{if}\,\,\,\,\ x \ge3, & \text{then}\,\,\,\,\,\,\ b...
The assignment problem is defined as: There are n people who need to be assigned to n jobs, one person per job. The cost that would accrue if the ith person is assigned to the jth job is a known quantity C[i,j] for each pair i, j = 1, 2, ..., n. The problem is to find an assignment with the minimum total cost. There is...
While reading the book theory of computation by Michael Sipser, I did not understand the language given below. I will explain the problem first $$L = \{1^n :n \in \mathbb{Z}\}$$ Where $\mathbb{Z}$ is a set of integers. Question :I am not able to understand the string that belong to the given set will look like. I k...
say, we add the option of allowing let expressions to context free grammars: let defines a variable that defines an expression from a specific Symbol of the grammar, and every instance of the variable has to be the exact same expression eg: T := (let ((z -> U) z + z) U := x | y | Const | U +U | U ∗U | T In the above ...
I have managed to describe a problem in quantum computing as the optimization of a function f(graph,vector), over graphs and real vectors. For a given graph, I can optimize the vector with standard methods (say, gradient descent), but the search over graphs has to be a brute force random search, because I don't know wh...
Assume we have 2 max heaps, each with n nodes. We want to merge these 2 heaps and build a min heap. What is the best way to do this? The easiest way is to consider 2 max heaps an array with $2n$ elements and build a min heap with $O(n)$ complexity. Is there an algorithm with a complexity better than $O(n)$ ?
I'm quite new to computability theory and would be interested in some examples of realistic programming tasks you could encounter when working as a C++ programmer that are not computable.
Given the following recursion, $$T(n)=T(\frac{n}{2})+ aT(\frac{n}{4})+n^2, $$ How can I find the minimal value for $a$ such that ${T(n)=ω(n^2)}$? I tried to do it by tree recursion but I did not succeed to prove it by this method.
If standard function composition is defined as: (define compose { (B → C) → (A → B) → (A → C) } F G -> (λ X (F (G X)))) What type of composition does the below function describe? Is there a particular name for it in category theory? (define compose-2 { (A → (X → C)) → (B → X) ...
I'd like to double-check my understanding of Big-Oh. The definition is that $f(n) = O(g(n))$ if $|f(x)| ≤ M\,|g(x)|$ for a natural number $M$ and for sufficiently large values of $x$. Now, if $g(n) = O(n^2) - O(n^2)$, may we conclude that $g(n) = 0$? If not, what can we say about $g(n)$?
In given: $${T(n)=4T(\frac{n-2}{2}) +n^2 }$$ How can i find ${O(T(n))}$ ?
I want to determine the time and space complexity of the following functions: subs [] = [[]] subs (x:xs) = subs xs ++ map (x:) (subs xs) subs' [] = [[]] subs' (x:xs) = yss ++ map (x:) yss where yss = subs xs The language I'm considering is using (outermost) graph-reduction (also known as call-by-need or call-by-name ...
After running dfs on a graph, we get a list of n post and pre numbers. How do we sort this list in $O(n)$ time instead of $O(n\log n)$ time?
I used networkx to find the diameter of a graph that I have. It gave a diameter of 4. However, I found that between two particular nodes, using networkx's shortest path function, the path length is 5. I also coded dijkstra's algorithm and BFS from scratch and both returned a shortest path length of 5 too. Is anything w...
I am trying to revise for my exams and going through my lecture slides and recordings, my lecturer didn't really give a clear example of why Regular languages are decidable. She mentioned that it was because Regular Languages can be represented in Finite Automata, and can be classified as a subset of regular languages...
Does anyone of you know how to associate an algorithm execution time (of experimental execution) to a well known complexity time? For example, say a divide and conquer algorithm lasts theoretically O(n·logn·n^2) or Ω(n·logn), in a theoretical way, doing reccurence ecuations and all that stuff. But when you plot the dat...
I want to prove that integer factorization is in NP I have a general idea of how to prove this, and was wondering if I could get a sanity check: I'll show it's in NP by using a non-deterministic TM whose longest computational branch runs in polynomial time. The TM will do the following: Given an input (binary) word w o...
Introduction to Algorithm,3rd 9.3 Selection in worst-case linear time I have a question about its proof. I have selected that sentence. I agree that the number of elements larger than x is $$ 3\times(\lceil\frac{1}{2}\times \lceil\frac{n}{5}\rceil \rceil -2) $$ but, I think the number of elements less than x ...
I have this large text file that when unzipped has about 2GB. I split this one into multiple(more than 5 million) files and now I have a folder of about 20GB, how is this possible?
This is a related question poker hand representation and I got a great accepted answer. The problem can be reduced to a virtual 39 card deck that from what I can tell is 16 bits. I have 5 numbers 1-39 with none repeating. I need to uniquely identity those 5 numbers with the smallest possible number and not order depend...
In the first step, I agree that divide n elements into groups take one pass so the time complexity is $$O(n)$$. But if we need to find the median of each 5 elements, we may have to sort them. I know the time complexity of sorting is $$O(nlogn)$$. How to find the median of 5 elements by rote and its time complexity ...
There are many problems that people can solve more easily than a machine learning algorithm. Often this is attributed to the extra context we have access to. Image segmentation is an example of a problem that people are good at, but algorithms are not good at, probably because people have lots of external contextual k...
Okay, so a graph $G = (V, E)$ is (fully) connected if and only if for every pair of vertices $u, v ∈V,$ $u$ and $v$ are connected in $G$. And that if the vertex set is $V = \{0, 1, . . . , n−1\}$, then we can represent a graph in a program as a two-dimensional n-by-n array $A$, where the entry $A[i][j]$ is set to $1$ i...
From a simulation I get 5 numbers 1-13. The nature of the simulation is that I do not get the numbers ordered. The value/rank of the the tuple is not order dependent 5 5 5 2 2 = 2 5 2 5 5. Values can repeat but they can repeat at most 4 times (it is a deck of cards). As it turn out there are 6175 combinations. Calc...
Is the follwing promise problem NP-hard? Input: A system of quadratic equations. Promise: The system has either one or zero solutions. Question: Does the system have a solution?
I have recently thought up the following proof that L=P implies P=NP. Suppose L=P. Let A be a problem in NP. By the verifier definition of NP, each positive solution to A has a witness that can be verified in polynomial time. Since P=L, the same solution can be verified in logarithmic space. Thus NP=NL. But then NL is...
I have to convert this fsa to regular expression but these are too different than i learned... Can you guys help with converting these? Plz!
I know that given a system of multivariate quadratic equations (i.e, of the form $x^T Ax+b^T x=c$), deciding if there's a solution is NP-hard. Is deciding if there's a solution to a single multivariate quadratic equation NP-hard too? I am intersted in the NP-hardness of deciding if there's a solution to a single quadra...
This feels like it would be a well researched (or solved) problem, but I can't find the right words to search for it. Suppose there is a collection of shared resources, and a collection of possible processes. Each process consumes fixed quantities of each resource and provides a fixed benefit. Each process can be appli...
Im trying to prove that $L=\{w\#s : |w|=|s|, w \neq s\} \notin CFL$ using the pumping lemma. So I said, let say $L \in CFL$ so by the pumping exists $p$ which is the pumping length of language $L$, I think $ s = 0^{m}1^{p}\#1^{m}0^{p} \in L$ would be a good word to start with, I can write $s = uvxyz$ and i want $uv^{...
Is there a difference between the set of quantum gates that are: "universal" in the sense that you could calculate anything in BQP with a polynomial number of gates, "universal" in the sense that you could approximate any arbitrary "gate" (unitary transformation) on a set of qubits? And if so, what is the proper term...
I want to prove that the following equation holds using structural induction on (finite) lists subs (map f xs) = map (map f) (subs xs) where subs [] = [[]] (subs.1) subs (x:xs) = subs (xs) ++ map (x:) (subs xs) (subs.2) map f [] = [] ...
I am trying to revise for an exam, I have encountered this question and have seen an example solution, but it was provided by my lecturer, and it was fairly sparse and somewhat incomplete. She jumps straight into a proof that has very little context, then ends it with "see Theorem 5.2" and that is why it is undecidable...
I was recently asked this problem in an algorithmic interview and failed to solve it. Given two values N and M, you have to count the number of permutations of length N (using numbers from 1 to N) such that the absolute difference between any number in the permutation and its position in the permutation is not equal t...
In short, if $x \neq u_i \in \{\pm1 \}^n$ then why is: $$ \langle x, u_i \rangle \leq n-2 $$ but not: $$ \langle x, u_i \rangle \leq n-1 $$ ? To add context: I was reading understanding machine learning from theory to algorithms and it had claim 20.1 section 20.3 on the section of the expressive power of Neural Networ...
In finding the connected components in a graph, why do we use DFS, instead of BFS?
We know $L^+=L^\star\backslash\{\epsilon\}$. How do we interpret that $\{\epsilon\}^+=\{\epsilon\}$?
I need your help with time complexity. I have this recursive function: $$ F(n) = \left\{ \begin{array}{l l} F(n-2) + 10 F\big(\frac{n}{6}\big)^2 + 6 F\big(\frac{n}{7}\big) + \frac{n^4}{5} & \text{if } n > 1\\ 2 & \text{otherwise}\\ \end{array} \right. $$ and I had to do the same thing using recursion in C#, so I came...
I need to find an example of a pseudo-peripheral vertex which is not a peripheral vertex. I came up with this example, where diameter is 4 and pseudo-peripheral vertices labeled aqua. Am i right here? $$\mbox{dia} = 4$$ $$e(9) = e(4) < \mbox{dia}, e(8) = e(4) < \mbox{dia}$$ Could you provide other examples? Maybe some...
Is there an efficient way to find a path from root to a leaf such that it has the maximum sum of degrees of nodes from all the paths possible in the tree. For example if a tree is defined as the one in which each node is an integer and it has as many child nodes as the perfect divisors of the integer. And the root node...
Let's take the function $f = \{(0,\pi)\}$. If I want to prove that such function is uncomputable I can simply say that calculating $\pi$ from $0$ would necessarily require infinitely many steps, since a Turing Machine can only write a single digit to its tape in each step. Is this argument well constructed enough to b...
Let $x_1, x_2, \dots, x_n \in \mathbb R$ and $b_1, b_2, \dots, b_n \in \{0,1\}$. I want to know which of all the possible boolean combinations is maximal. For example, if $x_1 = 2$ and $x_2 = -2$, $$\max \sum_i b_i x_i = 2 \implies b_1 = 1, b_2 = 0$$ I can see that a brute force algorithm will have a running time comp...
I am exploring some ideas around dating site matching, and I can do with some ideas as to which is the better solution Senario: We have a boy and girl, the boy has completed his profile/bio thoroughly while the girl hasn't or maybe she just doesn't like a lot of things, so this is what the data looks like Boy likes: ...
I am trying to calculate $$V = (H^TH+I)^{-1} U$$ where $H\in\mathbb{R}^{m\times m}$ is a circulant convolution matrix corresponding to a convolution kernel $h$, and $U\in\mathbb{R}^{m\times n}$. The computation of $V$ can be done using the FFT algorithm. I am confused about the computational complexity of using the F...
I understand that a PDA is an automata with a stack (LIFO) but I still can't understand how to answer a very simple question like this one. I've read so many pages on it, searched all over Google, watched countless videos on YouTube & yet I still can't grasp this for the life of me. This is my last resort. I know i...
Given the following function, $$f(n)=\prod_2^n \log i. $$ How can I find $f(n)=\Omega (?)$ and $f(n)=O(?)$ ? I tried to do it, but I have no idea how to do it ..
What would be the differences between these two branches of research? For what I know the theoretical research is the one that will not necessarily end up with an application part, but the applied research deals with experimentation. So it would be safe to say that applied research = experimental research? Could anybod...
Let's say I have this NFA automaton A: [q1] [reject] [q1] 0 -> [q2] [q2] [reject] [q2] 1 -> [q3] [q3] [accept] [q0] [reject][initial] [q0] 1 -> [q1] [q0] 0 -> [q0] [q0] 1 -> [q0] The output of Brzozowsky's minimization method, executed manually using JFLAP and confirmed by my own implementation is:...
I'm having trouble figuring out why the 1s and 0s are where they are in this game tree for the game Nim: There is a statement in the book that explains the numbers but it's still not clear to me, In implementing minimax, we label each level in the search space according to whose move it is at that point in the game, M...
I am reading Compilers and am unable to understand difference between these two terms. I could not find any text which has clearly mentioned how they differ but these two separate terms are being used. Can someone please explain me?
I understand that a big advantage of round robin scheduling over non-preemptive schedulers is that it dramatically improves average response times. By limiting each task to a certain amount of time, the operating system can ensure that it can cycle through all ready tasks, giving each one a chance to run, and the lengt...
Suppose we have $S=\{1,2,\ldots,n\}$, a binary variable $x$ and an integer $p$. I would like to model the following constraint using integer linear programming: If $x = 1$, then there must exists a unique $i\in S$ such that: $x_j=1$ for all $j\in\{i,i+1,\ldots,i+p-1\}$. How can I do this?
I have an algorithm problem that I want to share with you and I want to get some idea how can I solve it. Problem statement: You have to reach th Nth floor of a building by using a particular elevator: there is only one button that will take you from floor i to floor i+1 with probability p(i) or to floor 1 with probabi...
Is the first function big oh, theta or omega of the second function in the following examples. $(\log n)^{\log n} $ and $ \frac{n}{\log n}$ I am not sure how fast the first function grows. $n2^n$ and $3^n$ I think the second function grows faster but not sure how to prove it. $(\log n)^{\log n} $ and $2^{(\log_2n...
Referring to this reference... I'm trying to work out the details of an integer arithmetic implementation of the CORDIC iteration. The CORDIC pseudo-rotations can be summarized as $$ \left( \begin{array}{l} x_{n+1} \\ y_{n+1} \\ z_{n+1} \end{array} \right) = \left( \begin{array}{l} x_n - d_n2^{-n} y_n \\ x_n + d_n2^{-...
I want to know about the early invention/use of the adversary argument (see the lecture note by Jeff Erickson) which is a technique for establishing lower bounds of problems. I cannot find the original papers which invented/advocated adversary argument or the first problems whose lower bounds are obtained by adversary...
I am trying to understand how the reduction proof for non r.e. languages works by following the examples from this website. In most cases to prove that a language is not r.e., you can reduce the language to the non halting problem which is not r.e. For example, if I have $$L_2 = \{\langle M\rangle\mid M \text{ is a T...
I am wondering how to go from a language such as this: L = {a^n b^m c^k | n = m or m != k} To a Context Free Grammar. I know that I would have to turn it into two separate languages but I don't know how to create the production rules for each of those languages.
I have a matrix $A$ with dimensions $M \times N$ and I want to compute $A'$ such that: $$ A'_{i,j} = \alpha A'_{i,j-1} + (1 - \alpha) A_{i,j} \\ 1 \leq i \leq M, 1 \leq j \leq N, \alpha \in [0, 1] $$ Where $A'_{i,0}$ is some given constant. I want to perform this computation as part of a machine learning training proce...
When using Gauss-Jordan elimination to convert a matrix to an upper triangular matrix, truncation errors can drastically change the answer. For example, when performing row operations with excel, with the following matrix: Is reduced to: The value in the red cell is a truncation error and should be zero. The next ste...
Given an array of size $N$. I need to find the count of values in range $[L, R]$ which are repeated at least three times in successive positions (i.e., the value occurs contiguously three times). For eg- \begin{align*} A&= 1,1,1,2,2,1,5,1,1,2,2,2,5,5 \\ L&=0,\ R=3\,, \end{align*} the answer would be 1 (1,1,1)...
I have a language L = {a^n b^m c^k | n = m or m != k} When I was working the problem out this is what I got: S -> S1|S2 S1 -> AC A -> aAb|$\lambda$ C -> Cc |$\lambda$ S2 -> BD B -> aB|$\lambda$ D -> bDcc|E E -> Ecc|$\lambda$ I feel like this is right but at the same time I am not too certain it is. Is this the correct ...
Let $ \mathcal{X} $ be a domain set, $ \mathcal{Y}=\{0,1\} $ and $ \mathcal{H}$ an arbitary hypothesis class. Assuming that there's an algorithm $ \mathcal{A} $ such that for every distribution $ \mathcal{D} $ realizable by $ \mathcal{H}$, it holds that $ \mathbb{E}_{S \sim \mathcal{D} ^M}[L^{0-1}_{\mathcal{D}}(\mathc...
Given two DFA's , $M_1$ and $M_2$, I want to create an algorithm that determines if their languages are disjoint or not. The algorithm will run in polynomial time. My idea is this: Let's say WLOG that $M_1$ has 1 accepting state. We run DFS from that state and look at paths from the state to a starting state. Ideally, ...
I have been given that $n$ make-sets and $m \ge k$ finds and $k$ unions can be performed in $O(n + m \log^*(k))$ time (I'm aware of the ackermann function but am not interested in proving that). Where $log^*(k)$ is $0$ if $k \le 1$ and $1 + log^*(log(k))$ otherwise. The $n$ part is easy -- that's due to the number of m...
I cannot go on with this exercise: Determine whether $L = \{a^nb^m \mid n > 2^m \}$ is context-free. Let's suppose that $L$ is context-free. According to the pumping lemma, there exists $N > 0$ such that every $z \in L$ of size at least $N$ has a decomposition $z = uvwxy$ such that $|vwx| \leq N$. $|vx| \geq 1$. For...
I've seen a question asking if $A \le_m B$, then if $A$ is decidable, $B$ is also decidable. My initial intuition is that this is not the case, and that there are decidable problems that are reducible to undecidable problems. While I am not sure if this is completely correct, or even how to prove this if it is correct,...
Can anyone help me with Multiple Sequence Alignment (MSA) using Hidden Markov Model (HMM) by giving an example or a reference except these 2 references: 1-Eddy, Sea.R., et al.Multiple alignment using hidden markov models, 2-Boer Jonas, Multiple alignment using hidden Markov models, Seminar Hot Topics in Bioinformatics....
Suppose that $X$ is a finite set with a probability measure $P$. I want to find the subset $A \subset X$ so that the information gain of conditioning on ${A, A^c}$ is maximal. That is, I want to find $A$ that maximizes $$H(X) -H(X|\{A,A^c\}) = H(X) - (P(A)H(A) + P(A^c) H(A^c)),$$ where $H(A)$ refers to the entropy of t...
This is exercise 2 of the lecture note by Jeff Erickson on decision tree lower bounds. We say that an array $A[1 \ldots n]$ is $k$-sorted if it can be divided into $k$ blocks, each of size $n/k$ (we assume that $n/k$ is an integer), such that the elements in each block are larger than the elements in earlier blocks an...
I'm new to SIFT and was surprised by how much the features changed after resizing an image. Here's the images I used for testing: Original: Resized: Cropped: After running SIFT on those 3 images, I was surprised to find out that the original image was more "similar" to the cropped one than the resized one (I tested ...
Suppose that $\Omega$ is a finite probability space,with measure $P$ (we can take $P$ uniform). Let $C \in \{\pm 1 \}$ be a random variable on $\Omega$, the classifier. Let $$H(C) = H(C, \Omega, P) = \sum_{i \in \pm 1} P(C = i) \log P(C = i)$$ be the entropy of $C$. For a random variable $Y$ on $\Omega$ and $r \in \ma...
folks. My question is about explaining the each step of regular expressions. The task is to find the regular expression that contains 101 as a substring. I already know that the regular expression for this is $$ (0 + 1)^*101(0 + 1)^*. $$ The question is that how we should show each step for explaining the regular expr...
I know how to prove it by reduction, but I couldn't find an explanation why it is true. $\langle M \rangle$ represents the encoding of a turing machine $M$.
To find a solution for the Traveling Salesman Problem (TSP), one way to go is an algorithm called 2-opt, which is explained below. The 2-opt algorithm basically removes two edges from the tour, and reconnects the two paths created. This is often refered to as a 2-opt move. There is only one way to reconnect the two pat...
im new at OS and I want to know how to calculate the page size of this virtual memory system? Information: Physical Memory - 32 KB Virtual Address - 16 bit Offset - 12 bits Current content of the page table is this: I just want a formula for this and not the answer. Thank you
Let $L$ be a linear language. Then there is a constant $p$ such that for all $w$ in $L$ with $|w| \ge p$, $w$ can be written as $uvxyz$ where (i) $|uvyz| \le p$ (ii) $|vy| > 0$ (iii) $uv^ixy^iz$ is in $L$, for all $i \ge 0$. How do I prove the first condition? I am having difficulty proving the bound and relating the b...
I have some difficulties proving that the language of unary primes ($L=\{1^p\mid p\text{ is prime}\}$) is not regular using the pumping lemma. Any suggestions?
So I'm having a tad bit of a problem deciphering the formal definition of NP. In my text book (Algorithm Design, Tardos et al) it says that a problem $X$ belongs to $NP$ iff; there exists a "certificate" string $t$ such that $|t| \le p(|s|)$ for a polynomial function $p$ and an input string $s$. there exists an effic...
Given a list of real numbers $p_1, \dots, p_n$, I am looking for a most efficient algorithm to sort this list in a "probabilistic ascending order", meaning that $p_i < p_j$ implies that it is likely for $i$ to be placed before $j$, but not certain. In principle, every permutation is a possible output, but the less sort...
Problem And Question I am looking for pointers for an efficient algorithm for the following problem. It is hard to explain without some data so first I will provide some example data: Destination 1: Source 1: Cost 26 Source 2: Cost 32 Source 3: Cost 98 Create New Source: Cost 100 Destination 2: Source 1...
I'm trying to prove formaly this claim, given that $\mathcal{H}$ is a hypothesis class of binary classifiers. According to the definition, Hypothesis class $\mathcal{H}$ is agnostic PAC-learnable with respect to $ \mathcal{Z}=\mathcal{X}\times \mathcal{Y}$, if exists a function $ m_\mathcal{H}:(0,1)^2\rightarrow \mathb...
I have multiple sets, e.g., $$\{1, 2\}, \{2, 3, 4\}, \{1, 4\}$$ Each variable $1, 2, 3, 4$ is binary. I need to represent the following condition without additional variables $$(1 \land 2) \lor (2 \land 3 \land 4) \lor (1 \land 4)$$ Basically, I need to enforce that either $1$ and $2$ are 1s, or $2$ and $3$ and $4$ are...
I'm going to simulate an asynchronous distributed system. In a distributed system, when a node sends a message, after $\Delta t$ seconds the message reaches to its destination. My Question: What is the probability distribution of $\Delta t$s?
I'm trying to apply the CFL pumping lemma. And, I've already tried words $a^pb^p$ and $a^pb^pc^p$. Not sure where to go from here.