instruction
stringlengths
35
29.1k
As per my research on stack overflow communities, This is probably known as cutting stock problem / multiple Knapsack problem (a variant of the bin packing problem) which is NP hard. here are the constraints: there are two integer arrays one has lengths (already defined), the other has the bin sizes (already defined),...
I'm having problems in finding language of the CFG from given production rules. For example if the production rules are \begin{align} &S \to AS \mid \epsilon \\ &A \to aa \mid ab \mid ba \mid bb \end{align} How can I find the language it describes?
I wonder if there is a formula to calculate the sum of n/1 + n/2 + n/3 + n/4 + ... + 1. (Integer division) The number n can be as large as 10^12, so a formula or a solution having the time complexity of O(logn) will work. This is how far I can get: The sum can be described as n * (1 + 1/2 + 1/3 + 1/4 + ... + 1/n). The...
Usual NbE algorithms for untyped lambda calculus, which use (P)HOAS to embed terms to a host language constructs, results in a beta-normal form of a terms. Is there algorithms to (efficiently) exploit host language constructs to normalize untyped terms to beta-eta normal form?
I am studying Term Rewriting by reading Baader's book "Term Rewriting and All That". I am in the chapter of Equational Unification, in the section of Commutative Functions. I am trying to do the following exercise: Let $s, t \in T(\Sigma, V)$. By exercise 10.10 we know that the $\approx_{C}$-classes of these terms are...
Please help me prove the following problem: A unary function $f(x)$ is said to be partially $n$-computable if it is computed by some $\mathcal{S}$ program $\mathcal{P}$ such that $\mathcal{P}$ has no more than $n$ instructions, every variable in $\mathcal{P}$ is among $X, Y, Z_1, . . . , Z_n$ and every label in $\mathc...
I have a graph in which certain vertices are labeled. I need to assign labels to all of the other vertices in a way that minimizes the number of edges between different-label vertices. How can I do this efficiently?
Does there exist a Deterministic pushdown automata for the language $L=\{ a^ib^j| i \neq 2j+1, i,j>0\}$ where $\Sigma = \{a,b\}$ I have tried to find a pushdown automata and it turned out to be a non-deterministic one.
I know that a NAND gate is considered universal because we can use it to implement an AND, OR, and NOT gate. Given an arbitrary gate, or set of gates, how many operations would it take to verify if these gates are universal (by brute force), and does there exist a more efficient way to do this? How expensive is this in...
I have an array composed of integers from 1 through n. For each integer, I want to count the integers which are greater than that integer and occur after the integer's placement in the array in O(n*log(n)) time complexity Ex: array : {2, 1, 4, 3} For 1, 4 and 3 are after 1 and greater than 1 so 3 and 4 are chosen For ...
I am trying to understand an example of theorem proving via type checking in Haskell given here. The example is as follows. Using the Curry-Howard isomorphism, construct an inhabitant of the type and prove that $N= (A\vee (B\rightarrow A))\& (C\&(C\rightarrow B))\rightarrow ((\neg B\& A)\vee ((A\rightarrow B)\&(B\right...
If FA1 and FA2 are 2 DFAs with minimum number of states. I want to find cross product DFA (FA1XFA2). Will the cross product DFA obtained from 2 minimum DFAs also have minimum number of states(num of states in cross product DFA = num of states in FA1 x Num of states in FA2). How to think on this?
Let's say we have $3^{4n}$ and $4^{3n}$. With the note of The Asymptotic Cheat Sheet from MIT. We should first calculate the lim n->infinity $3^{4n}$/$4^{3n}$. and it result is $\infty$. In the we have lim n→∞ f(n)/g(n) != 0,∞ ⇒ f=Θ(g) Note 1 and lim n→∞ f(n)/g(n)=∞ ⇒ f=ω(g) Note 2 My questions is: Give...
Setup I am trying to write a function that determines if a set of vertices, edges and faces is a pure simplicial complex. A pure simplicial complex is a set where all facets have the same degree, a facet is a simplex that is not contained in a simplex of higher degree. So for example, a single vertex is a facet. A set ...
Let $\Sigma = \{a,b,c\}$, and consider the function $f\colon \Sigma \to \Sigma^*$ given by $f(a) = abc$, $f(b) = bac$, and $f(c) = cba$. We can extend $f$ to $\Sigma^*$ in the obvious way. Since $f(a)$ starts with $a$, it can be shown inductively that $f^{(n-1)}(a)$ is a prefix of $f^{(n)}(a)$ for every $n$, where $f^{...
I showed that, over an uncountable domain,learner A and a distribution P, such that for every sample size m and all samples S from $P^m$ $$ : L_S(A(S)) − L_P (A(S))| = 1 $$ Now I wanna prove for countable domains. Lets assume X = N. I wanna prove that, for sample size m, and every $\epsilon> 0$, there exists a learner ...
I have a simple grammar as below and wonder if it is convertible to regular grammar? If yes, what is the conversion sequence? If no, how can we prove it? S -> A A -> aAA | b | c In which S is the start symbol; A is non-terminal; a b c are terminals. Any help or suggestion is appreciated.
I am going through Computational Complexity by Arora and Barak, and there I came across the proof of why mod $p$ gates cannot be computed by $ACC^0[q]$ circuits, where $p$ and $q$ are distinct primes. The book proves it for $p=2$ and $q=3$, and I am facing difficulties generalizing this result for arbitrary $p$ and $q$...
There may be some theoretical literature, unknown to me, that addresses this question. If possible, I would like a practical approach to this problem. My attempt involves the use of an equational specification language called CafeOBJ (see introduction). In particular, the BOOL module can be viewed as a formalisation of...
The problem here described was taken from a university exercitation session. A serial production line is made of $K$ workstations: one kind product is manufactured by this line and has to be processed by each of this workstation. In each workstation are present equal machines in parallel. Stations are separated by an i...
I know that a Deterministic TM single tape has an equivalent Deterministic TM multiple tape, but I can't get how a Deterministic TM multiple tape can simulate a non-deterministic TM(The mecanisme). Regards, Thank You
Let's say I have a context-free grammar G and a string S. The normal CYK algorithm outputs that s can not be build using G. How would I find the closest String S' that can be build using G?
I want to know whether a given neural network (with a finite number of nodes) is able to store all injective maps f: D -> C, where D has cardinality k and C has cardinality N (so the number of maps is N! over (N-k)! ). For example is a network with 1000 nodes able to store 60 injective maps from {1,2,3} to {1,2,3,4,5}...
I'm trying to figure out of if there's a way to generate all unique sets of integers of length K, where each member has an upper bound of N, and a lower bound of M, without tracking which sets have already been generated, where the order doesn't matter. To be clear: I'm not looking for ways to filter duplicates from a ...
I find several contradictory definitions regarding the head movements of the Turing machine. In some places, it is only L / R. While in some other formal definition; it is L / S / R. Which one is correct?
I'm trying to prove the language L = {$0^n 1^$ | x ∈ Σ*, n ≥ 1} is regular, but don't know how to present it in a DFA/NFA. I'm thinking to have n+1 states in a NFA, with the start state as the accepting state. The NFA reada $0$s to go from q$0$ to q$n+1$, then reading $1$s or $0$s to stay in the q$n+1$, then reading th...
Suppose you have access to a random number generator $G()$ that generates uniform random numbers in $\{0,\cdots,n-1\}$. (Here, $n$ is given and cannot be changed.) How do we generate a uniform random number in $\{0,\cdots,m-1\}$ for $m\leq n$? We require that we can only call $G()$ $O(1)$ times in expectation. My effor...
Going through the topic of LBA, i.e., Linear bounded automata. I found that LBA requires the NTM with some constraints on tape. I found the same information from different sources. But I did not get why all the sources mentioned that it needs a NTM. I am not getting why I need a NTM for LBA? We also know that any NTM c...
So, I was going through the Rod-Cutting problem in the Dynamic Programming section of the Introduction to Algorithms by CLRS. Here's the rod-cutting problem statement: Given a rod of length n inches and a table of prices pi for i = 1, 2,…n, determine the maximum revenue rn obtainable by cutting up the rod and selling t...
I am working on an NP-complete problem and, I have proposed an efficient (as I think) Integer Linear programming to find the solutions in some small instances. My algorithm can work on a greater size instance in comparison to other studies. My tutor does not consider it sufficient to provide just one ILP algorithm and,...
I need to find a Turing machine that decides $A=\{0^{3^n} | n\ge 0\}$. I tried doing the same as Sipser does on page 172 in his back, where he creates a Turing machines that decides $A=\{0^{2^n} | n\ge 0\}$, by iterating over the input, and crossing (by writing $x$) on every other $0$. I wanted to cross every third $0$...
Schwartz-Zippel lemma is as follows. Let $f(x_1,\ldots,x_n)$ be a polynomial of total degree at most $d$ over a field $\mathbb{F}$ and assume that $f$ is not identically zero. Pick uniformally at random elements $r_1,\ldots,r_n$ from the field $\mathbb{F}$ then probability that $$f(r_1,\ldots,r_n) = 0 \le \frac{d}{|\ma...
I can use Bellman-Ford to get some of the elementary negative weight cycles in a graph. It's not guaranteed to always get all of them. (Elementary Cycle: A cycle is elementary if no vertex but the first and last appears twice.) But I want to find ALL elementary negative weight cycles. Even taking each vertex as the sou...
In my notes is represented like this: From wikipedia: In computer science, an inverted index (also referred to as a postings file or inverted file) is a database index storing a mapping from content, such as words or numbers, to its locations in a table, or in a document or a set of documents. Where is the inversion...
I have this assignment question to find the pumping length of a regular language (L). The regular expression for the L is given as $(0+0001)((1111)^*+(00)^*)$ What is the length of the longest string that cannot be pumped? What is the length of the shortest string that can be pumped, I think this will come naturally w...
I am looking for literature on mathematical models of (political) voting schemes. Concretely, I am interested in models that allow votes of the following form: "I am voting for $X$, but only if $>40\%$ of my peers vote for them, too. Otherwise, I'd like to vote for $Y$ instead." In that sense, I'd like to consider vo...
I was going through the theory for weighted least-squares fitting and I understood its basic underlying concepts, but I couldn't understand why exactly do we keep the weights as a diagonal matrix during calculations. This might be a dumb question but I don't have much experience with matrices and I am in the process of...
I am confused and got contradictory statements from various sources. It is mentioned in Page no 292, Chapter 11 A Hierarchy of Formal Languages & LBA, Peter Linz -An Introduction To Finite Automata, 5th Edition that "A language L is said to be CSL if there exists context-sensitive grammar G such that $L = L(G)$ or $L =...
Good evening everyone! Can someone help me with the following task? So we have this NFA: I was supposed to create a regular expression out of it. Now the solution says: $a^{+}b^{+}(c|ca^{*}b^{+})^{*}$ Unfortunately I don't understand how this is possible. If I look at the NFA, then we can accept a word that only inclu...
For example, whether there exists $\mathsf{PSPACE}$-hard sparse language an open problem, as it is not yet known whether polynomial hierarchy collapses. But is it a solved problem for larger complexity classes like $\mathsf{EXP}$ or $\mathsf{PR}$? What is the smallest complexity class (that is larger than $\mathsf{PSPA...
Can someone explain why the complexity of a query for LA is √n when we only decompose the tree into long-paths? How can we show/prove that? How can we prove that the number of paths can be as high as O(√n) ??? Please help, I've been struggling for a couple of days now. Stage 1: https://en.wikipedia.org/wiki/Level_ances...
I'm trying to find or create an algorithm for efficiently displaying text that is word wrapped. All the algorithms (if they an even be called that) for word wrapping presume a given lot of text and window size, and compute word wrapping in $O(n)$ time. That isn't realistic because text can be huge, users can modify t...
This is a problem of VC that I've been trying to solve. Any help is appreciated. Let's assume hypothesis classes $H_{\mathit{init}}$ of initial segments over domain $X = \mathbb R$ and $H_{\mathit{decst}}$ of decisions stumps over domain $X = \mathbb R^2$ as follows: \begin{align} H_{\mathit{init}} &= \{h_a \mid a ∈ ...
I have a linear grammar $G$ and a string $s$. $G$ is is not limited to right or left linear only but rather has a mix of rules of both types. Is there an algorithm to determine whether $s \in L(G)$ in less than cubic time? Converting to CNF and applying the CKY algorithm takes cubic time, and I am wondering if there i...
Automata theory measures the difficulty of language recognition problems by using an automaton that can accept or reject for the given string. However, I want to measure the difficulty of a sequence-to-sequence (seq2seq) problem. For instance, what is the difficulty of the following seq2seq problem associated with coun...
Considering the following language as an example: $$\begin{align} S &\rightarrow aS \mid bA \\ A &\rightarrow bA \mid aB \mid aD \mid \varepsilon \\ B &\rightarrow aB \mid \varepsilon \\ D &\rightarrow aD \mid \varepsilon \end{align}$$ This has ambiguous transitions on the string $ba$, but how do we prove in general th...
One proof for $2-SAT$ being in $P$ uses the implication graph, i.e. one creates 2 vertices per variable $a$, one for each possible literal ($a$ and $\neg a$). One then adds 2 arcs per clause $(a \lor b)$, one from $\neg a$ to $b$ and one from $\neg b$ to $a$, respectively representing the implications $\neg a \implies ...
Given a collection C of sets, there are a number of proposed algorithms for building the subset partial order, e.g. this paper. But is there any work on algorithms that return the [components of such collection, that is the weakly connected components of the DAG that represents the subset relation? Input: C, a set of ...
Is there a linear time online version of the preprocessing RMQ algorithm? That is, an algorithm that allows to update the data structure when appending additional elements at the end of the input array in O(1) (worst case or amortized) time per element (while still allowing answering arbitrary queries in constant time)...
The Quest: Use context sensitive grammar (CSG) to produce an equal N number of repeating a, b, and c using the alphabet {a, b, c}. For example, if N = 5 use CSG and a, b, and c to produce a result such as 'aaaaabbbbbccccc'. What I (think I) understand so far: CDG == CSG (context sensitive grammar) Linear bounded autom...
What exactly is the difference between $$ C = \{a^*\}\{b\}\{a^*\}\{b\}\{a^*\}\{b\} $$ and $$ D = \{a^nba^nba^nb | n \geq 0 \} $$ It is known that D is non-regular and C is regular, but I am not sure why.
You're given N integer arrays. Each array can have different size and contains unique values. However same integers can be found in different arrays. The goal is to partition those arrays into K groups such that: Arrays grouped together don't share any integer I want to minimize the number of groups Example: Input: [...
Given a complete graph how do I find maximum weight spanning tree. where $weight(u, v) = \sum_{i=1}^{k} |w_{i,u} - w_{i,v}|$ assuming $k \lt 7$ and $n \le 500000$. $n$ number of nodes $weight(u,v)$ means weight from node $u$ to $v$ $w_{i, u}$ is given for $i < k$ for a give node $u$ $k$ is some constant.
Given the language $ A = \{w \in \{a,b\}^{*} | w = w^{R}\}$ (i.e. palindromes using the symbols $a, b$), I am trying to determine if the Pumping Lemma can be applied to strings of the form $s = a^{2p}$. From my understanding of the Pumping Lemma, to show it would hold, I need to decompose $ s $ into $ s = xyz $ such th...
I am working on a problem where you're given $n$ distinct numbers, and you want to find the number of permutations such that it takes bubble sort at most 1 pass to complete. e.g., if n=3, then the following permutations would only require 1 pass 1 2 3 1 3 2 3 1 2 2 1 3 But 3 2 1 2 3 1 would require more than 1 p...
I am working toward understanding a proof the the PCP theorem using Arora and Barak's textbook Computational Complexity. I believe I found a few (fixable) errors in Section 22.2, in the part titled "Proving Theorem 11.5 from Lemma 22.4", but I am not sure I completely understand. As I stated two years ago, I still can'...
There is an “informal” definition of $\operatorname{LR}(k)$ (can be recognised by a parser that looks at $k$ symbols ahead) and a “formal” one (as a property of the set of rightmost derivations possible for the grammar). Is there a similar formal criterion of a grammar being $\operatorname{LALR}(k)$ or specifically $\o...
I have a project which includes a disassembler which makes old virtual machine formats playable online. It's a very simple disassembler; it basically processes the instructions outputting a code fragment which continues until it gets to any kind of branch or jump statement. The branch will set the program counter to it...
I am working on Software Foundations Volume 1 on my own it is its 2019 version by the way, and I have reached to its lesson Inductively Defined Propositions, and there, for almost one month I have been stuck on an exercise re_not_empty expressed like this in Coq (the exercise itself begins at Fixpoint): Inductive reg_e...
I have the following functions that I need to rank in increasing order of Big-O complexity: $$(\log n)^3, 10\sqrt n, n\log n, n\sqrt n, n^4 + n^3, (2.1)^n \cdot n^2, 3^n, 2^n \cdot n^3, n! + n, n^n. $$ My current ranking is as follows: $$(\log n)^3 < 10\sqrt n < n\log n < n\sqrt n < n^4 + n^3 < (2.1)^n \cdot n^2 < 2^n ...
Suppose you want to determine the largest number in an $n$-element set $X = (x_1, x_2, \dots , x_{n})$, where each element $x_i$ is an integer between $1$ and $2^m − 1$. Describe an algorithm that solves this problem in $O(n + m)$ steps, where at each step, your algorithm compares one of the elements $x_i$ with a const...
Given a list $L = [1, 2, .., n]$ and a list $C = [(L_i, L_j), ....]$ form a group of pairs $G = g_1, ..., g_{n/2}$ such that: every element of $L$ is assigned to exactly one group $g_k = (L_i, L_j) \Rightarrow (L_i, L_j) \notin C $ (constraint) I get that there are (potentially) many solutions to this problem. How ...
I am trying to show that $A = \{w \in \{a,b,c,d\}^{*}|w \textrm{ has equal occurences of } ab \textrm{ and } cd\}$ is not regular by using the Pumping Lemma. My idea here was to use the string $ s = (ab)^{p}(cd)^{p} $. Clearly, $ s \in A $, and $ |s| = 2p \geq A $. So the the three conditions of the pumping lemma hol...
I am working on implementing algorithms to solve Hamiltonian Cycle Problem. I need difficult problem graphs to test my implementations but my google-fu is weak and am unable to find any. Please advise where I might find a set of difficult graphs for the Hamiltonian Cycle, or how to generate such graphs for testing.
I have two $N$-vectors of positive integers, called cost and gain, and I have another integer called budget. You can think of every pairwise correspondence between cost and gain as a stock, and every possible subset of stocks as a portfolio. I need to determine the portfolio (subset of pairwise correspondences) whose s...
Let $f : \{0, 1\}^{n} \rightarrow \{-1, 1\}$ be a Boolean function. Let the Fourier coefficients of this function be given by $$ \hat f(z) = \frac{1}{2^{n}} \sum_{x \in \{0, 1\}^{n}} f(x)(-1)^{x \cdot z}$$ for each $z \in \{0, 1\}^{n}$, where $x \cdot z$ is the bitwise inner product between $x$ and $z$. Let me choose a...
I working through some textbook exercises, and came across a problem that I'm struggling with. Give a CFL $L$ such that $\{x|\forall y \in \Sigma^* \space xy \in L\}$ is not a CFL. I've got the idea that we can let $L$ be formed by taking a language that is not CFL, and following each element by every string, and also ...
As the title says, I am wondering if writing more data (i.e. larger files) to disk (e.g. Tablet SSDs) will consume more energy than smaller files. My expected answer is "yes, because larger files take longer to write, hence need more energy". However, I am not sure if that is true. If someone could shed some light (bet...
Question: S → abSab | baSba | TT T → aTa| bTb | ε My answer: Eliminate ε rules: S-> abSab | baSba | TT | T T-> aTa | bTb | aa | bb Correct answer: S → abSab | baSba | TT | abab | baba | T T → aTa | bTb | aa | bb I want to know why abab and baba in S. For me, ε could be replaced by T so that S-> abSab | baSba | TT | T
I am aware that the traveling salesman problem (TSP) and the bottleneck TSP problem is NP-hard for complete directed graphs. I am also aware that regular TSP that allows a path with repeating is also NP-hard. However, I was not able to find a reference for the complexity of the bottleneck TSP problem with repeated node...
This question boils down to: If a polynomial time solution exists for a decision problem, is there also a polynomial time solution for the same problems optimization flavor? Let's take the Traveling Salesman Problem for example: TSP Decision Problem (NP-Complete): Input: Graph G, Budget b Output: Does a route exist in...
I am reading some papers in machine learning and at the very beginning (introduction) you will see statements of theorems that says, for example: Theorem 1.1. For any constant ϵ > 0, it is NP-hard to find a halfspace that correctly labels (1/2 + ϵ)-fraction of given examples over {0, 1} n even when there exists a mono...
I have a question on if production rules of a formal grammar are being specified correctly. Wikipedia defines the syntax of grammars as the following finite set of production rules, where it states each rule has the form: $(\Sigma \cup N)^{*}N(\Sigma \cup N)^{*} \implies (\Sigma \cup N)^{*}$ How can each rule have thi...
Consider the polynomial algebra $\mathbb C[X]$. Then the set $\{1, X, X^2,\dots,\}$ forms a vector space basis for this algebra. In general, we know that the set $\{P_n(X) \in \mathbb C[X]: n \ge 0 \text{ and degree}(P_n) = n\}$ forms a basis. We consider the binomial basis defined as follows: $\binom{X}{n} = \frac{(X...
This answer seems incorrect to me: Which NP-Complete problem has the fastest known algorithm? The fastest solution for one NP-Complete problem should be the fastest solution for all NP-Complete problems. Why? Can any NP-complete problem be reduced to any other NP-Complete problem in polynomial time? So, finding some su...
I have sections 1,2,3...44. We can group only adjacent ones and create groups of maximum size S = 4. There are two possible variations of this problem: can not overlap at all (preferred) can overlap only in outer sections (numbers) /i.e. 1+2+3, 3+4+5+6, 6+7+8 ... Each section (or group) has it's own value, which is c...
i spent literally 5hrs trying to figure out, why the value of n is 1 for my second test case ( which begins at line 12 ) , but i am unable to, could you help me with that? int t,n,i,j; char c; cin>>t; while(t--) { cin>>n; cout<<n<<"\n"; getchar(); while(scanf("%c %d %...
Im trying to determine what is the time complexity of sorting numbers with a specific range and base. I have n numbers in the range of 1-n^10 and the base for the radix sort is n/log n. I have tried to calculate it using log equations but im getting to a linear result, I dont know wether im right or wrong. Thank you ve...
I want to see the converse proof for the random coding (shared randomness) capacity of AVC. All I can find online is Csiszar Narayan's AVC paper which looks at deterministic coding. Further, the proof itself is quite dense (using Lemma 2 in the paper). I am wondering if there is any work that proves the converse of AVC...
I am given this exercise: Let L1 ={akbk : k > 0} and L2={ck : k > 0}. For each of the following strings wi, state and explain whether or not wi ∈ L1L2. w1=ε w2=aabbcc w3=abbccw w4=aabbcccc w5=ccaabb w6=ab So far I haven't seen such a notation for languages as the one that L1 and L2 are seen in. For example, I had seen ...
I have a dataset of streets - and each street contains several houses. street_id | house_id | number of calls | number of people living | etc... 1 | 1 | 10 | 5 1 | 2 | 3 | 1 2 | 3 | 4 | 2 2 | 4 | 15 | 19 ...
Let $1 \le r \le n$ b e integer(with $n$ large) and let $\mathscr X_n$ be the set set of all $2^n$ binary strings of length $n$. A binary $r$-coverage code is a subset $S$ of $\mathscr X_n$ such that every $x \in \mathscr X_n$ is within Hamming distance $\le r$ of some $y \in S$. A minimal $r$-coverage code is one for ...
I'd like to search for a combination of resources that when used, would produce at least up to a threshold of different kinds of materials. For the majority who are not in the know, I'll use an analogue for the rest of the question. For the few who benefit from this information: the game I'm referring to is Magic The G...
I would like to write a function that returns a 2D array of floating point numbers representing pixels in an image. I have tried implementing perlin noise 3 times and have followed this (https://www.youtube.com/watch?v=MJ3bvCkHJtE&t=1008s) video. So far, I've been getting numbers larger than 1 as my final result. I've ...
Let $A$ be an $n \times n$ matrix over some field $\mathbb{F}$. The determinant $$ \det(A) = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) A_{1 \sigma(1)} \cdots A_{n \sigma(n)}$$ can be evaluated in $O(n^3)$ field operations (via Gaussian elimination, say). Note that this is much better than naive evaluation of the...
Here is an excerpt from Cracking Coding Interview book where it's talking about the time complexity of insertion to an ArrayList. I am trying to prove that the sum of $X + \frac{X}{2} + \frac{X}{4} + \frac{X}{8} + .... 1 $ is $2X$. Given, \begin{align} & X + \frac{X}{2} + \frac{X}{4} + \frac{X}{8} + .... 1 \\ & = X ...
I am a research student in the area of programming language/software engineering. I am claiming to provide an automated technique to solve a research problem in one of my papers. The prototype tool that I am creating for this paper is required to test some real-world libraries. I am using a symbolic execution tool in m...
I work at a startup and we're doing a lot of online market research to get data about supermarkets in Germany, their name, address, telephone numbers, emails and so that already exist on their website or other places on the internet. my question is: Is there any algorithm that could help us do this job faster instead o...
An undirected graph on $n$ vertices and $n-1$ edges $G = (V,E)$ is partitioned between two players $A$ and $B$ such that $A$ knows $(V,E_A)$, $B$ knows $(V,E_B)$ and $E_A \dot\cup E_B = E$. Initially, $B$ receives an advice $m_1$ that depends on $G$ and the given partition. After that, $B$ receives a randomized message...
Assume that a simple graph has $2n$ vertices and the property that every subset of $n$ vertices induces a subgraph with at least $k$ edges. Question: What lower bounds are known on the total number of edges? For example, if $k=n$, then the graph should have at least $5n$ edges. We can see this by splitting the set of ...
I was working through some exercises regarding NP complexity, when I came across this one: Let $mH$ be the problem of finding a Hamiltonian cycle of length $m$ ($m$ fixed) in a graph $G$. A cycle of length $m$ is a sequence of nodes $e_1,e_2,\ldots e_m$ with the property that they form a Hamiltonian cycle. Show that t...
I am having trouble understanding the Big-Theta definition and providing a proof. Prove that $4n^3 + 3n^2 +2n - 5$ is $\Theta(n^3)$. I believe using the definition the set up would be as followed: Proof: By Big-Theta Definition Let the above expression be denoted as $T(n)$. $T(n)$ is $\Theta(n^3)$ if $c_1*n^3 \leq |T(...
I have seen the formulations there is no ϵ>0 such that a problem can be solved in $O(n^{2-\epsilon})$ time a problem requires time $n^{2-o(1)}$ a problem requires time $\Omega(n^2)$ being used in the context of lower bounds but I am not sure as to whether there are relevant differences between these notations or ...
I am going through a Turing machine topic. I know about decidable, semi decidable, and decidable problems. But honestly speaking, I did not get any practical examples of Semidecidable problems. Can you please share some examples or a URL link? Is the NP problem a semidecidable problem? If yes, then it means that NP-co...
And is there an attack strategy that you can use to approximate the architecture of a machine learning system with the knowledge of class labels and some data points?
I am trying to teach P vs NP to some primarily Machine Learning folks. I wanted to come up with an introductory fact to grab their attention. Reasoning for Question: Most problems in Machine Learning are NP-hard. 2/3. All NP-Hard problems are the same problem - per reduction unto each-other in trivial poly-time. Th...
Say there is a class called Person. Then in the following expression : Person human = new Person() Which is the "reference" and which is the "object"? human should be the reference since it's not an actual object, it simply points to an object. On the other side, new Person() truly is the actual object. I've seen these...
I am looking for examples of NP-complete problem-solving exact algorithms with a linear space complexity and an exponential time complexity. Algorithms which solve the k-SAT problem exactly (such as DPLL and PPSZ) are good examples. Indeed, the space they require is at most linear in the number of variables of the form...
My system needs to wait for the completion of N tasks and terminate when all are completed. The work items are passed in as an immutable array and the execution of these items are handled externally to my system. Checking for completion is quite inexpensive and the items can complete in any order. The size of these lis...
Let's say that we have a function $g(i,j)$, which is an arbitrary boolean-valued function over $i,j \in \{a,b\}^*$, such that $|i| = |j| = m.$ Moreover, we can also say that $g$ has communication complexity $c(m),$ and we let $L = \{ij \mid g(i,j) = 1\}.$ Would it be accurate to say that if $c(m) = O(1),$ then $L$ is r...