instruction
stringlengths
35
29.1k
Problem I am considering the following maximization problem: Input is a finite collection of finite sets $\mathcal{F} = \{ X_1, X_2, \ldots, X_n \}$. Goal is to find a subset $G \subseteq \mathcal{F}$ that maximizes $|G| \times |\bigcap G|$ where $|G|$ is the cardinality of the set $G$, and $\bigcap G = \bigcap \{X_{...
As I understand it in dataflow programming, programs are structured as directed graphs, an example of which is below Is it true to say that the arrows (or edges) represent the variables within a program and the vertexes (blue circles) represent programmatic functions? Or is this too much of a simplification? I am inte...
I have seen some implementations of Pollard's P-1 algorithm where the upper bound is only increased by 1 if no factor is found. Such an implementation is described here. Is it sort of missing the point in terms of efficiency to only increase by 1, or is is it sill better than trial division for finding a factor? Is wha...
Is English Turing-complete? Intuitively it makes sense that English is Turing complete, since you can talk someone through building a Turing machine. But I also think there might be some operators used in programming that aren't used in person-to-person communication, at least in daily life. Also, what level of English...
Suppose, we want to rearrange all possible $n$-bit binary strings (i.e., we have $2^{n}-1$ possible strings) in a 1-D array $X$; given that stings with smaller hamming distance should be placed as much closely as possible. Is there any algorithm to find the best solution efficiently? Note: I belive, for this problem, w...
I am currently studying for my exam and I am having trouble to solve this question: Right or wrong: If $A$ is context-free then $A^*$ is regular. I think it's wrong because if $A$ is context-free it means that $A$ can be a non-regular language. And the non-regular languages are not closed under the Kleene star operat...
I'm looking for an $NP$-hardness proof for the following variant of $SAT$: $$ EVEN-SAT = \{\langle \phi \rangle: \phi \text{ has an even number of satisfying assignments}\} $$ I've been playing around with gadgets for a while, but I haven't been able to construct a reduction. Still, I feel like there should be one. Hel...
While reading Compilers by Alfred Aho, I came across this statement: The problem of generating the optimal target code from a source program is undecidable in general. The Wikipedia entry on optimizing compilers reiterates the same without a proof. Here's my question: Is there a proof (formal or informal) of why this...
Please forgive me if this question is trivial, I couldn’t come up with an answer (nor finding one). In order to show that there are boolean functions $f : \{0,1\}^n \rightarrow \{0,1\}$ which can be computed only using circuits of size $\Omega(2^n/n)$, we use a counting argument: there are at most $O(2^{k \log k})$ cir...
Are there polynomial-time algorithms whose input is global but output is local in nature? What I have in mind is a problem instead of an algorithm. It’s the satisfiability (SAT) problem. Each clause is global information, because it’s surrounded by a host of satisfiable assignments, or rather their inverses, in the sea...
For example, a valid number would be 6165156 and an invalid number would be 1566515. I have tried many times to construct a finite state machine for this with no success, which leads me to believe the language is not regular. However, I am unsure how to formally prove this if that is indeed the case. I tried applying t...
Let $\Sigma$ be an alphabet and let $L$ be a language over it with the following properties: if $w\in L$ then there exists $v\in \Sigma^*$ such that $wv \in L$ and for every $s\in \Sigma$ the word $wvs$ does not lie in $L$ $wv\in L$ then $vw \in L$ It is prefix-closed, i.e. prefix of any word is still in the language...
I can very clearly see "why" mu-recursion is a universal model of computation, i.e. why the Church-Turing thesis -- that any physically computable algorithm can be executed with mu-recursion -- holds for mu-recursion. It reflects exactly the type of algorithms that I can carry out with my own brain. I cannot see an ana...
Pardon the word play. I'm a little confused about the implication of the claim and hence the question. Background: I ventured into Category Theory to understand the theoretical underpinnings of various categorical constructs and their relevance to functional programming (FP). It seems (to me) that one of the "crowning ...
I discover this in All NP problems reduce to NP-complete problems: so how can NP problems not be NP-complete? If problem B is in P and A reduces to B, then problem A is in P. Problem B is NP-complete if B is in NP and for every problem in A in NP, A reduces to B. Problem C is NP-complete if C is in NP and for some NP...
I had a question about random shuffling. Given a sorted list, is it possible to design an algorithm to return a uniformly random arrangement of the items in a deque with the following operations: read from list and add to front of deque read from list and add to back of deque remove from front of deque and add to back...
Consider $n$ sets, $X_i$, each having $n$ elements or fewer, drawn among a set of at most $m \gt n$ elements. In other words $$\forall i \in [1 \ldots n],~|X_i| \le n~\wedge~\left|\bigcup_{i=1}^n X_i\right| \le m$$ Consider the complete graph $G$ formed by taking every $X_i$ as a node, and weighing every edge $(i,j)$ b...
I am quite new to master theorem and I would like to ask the following question for $$()=4(/4)+20.$$ If there is a constant value like $20n$ does it affect the equation? Would the equation look something like this for test case 1: Is $f(n) = 20n \in O(n^{log_ba-\epsilon}) \in O(n^{\log_4^4-\epsilon}) \in O(n^{1-\epsil...
What is the correct way to solve the following recursion: $T(n)=T(\lceil\frac{n}{2}\rceil) + T(n-2)$ Or basically any recursion that has two parts which converge in a different rate. I'm trying to get big $O$ approximation, as tight as possible, but I couldn't figure it out with any "traditional" approach.
Given a grammar $G$ for a Context Free language $L$, we can augment it by "shuffling" the right hand side of each production, e.g.: $A \to BCD$ is expanded to $A \to BCD \; | \; BDC \; | \; CBD \; | CDB \; | \; DBC \; | \; DCB$ It may happen that the resulting language $L'$ generated by the expanded $G'$ is equal to $L...
In de Oliveira and Cook's Extensibility for the Masses uses Java for its code (it's not about stuff specific to that language though) and the ability to create anonymous inner classes is used extensively, starting from the code in Figure 4. Yet the authors claim that they rely only on a modest set of features and the s...
Prove that $L=\{a^ncb^n| n \in \mathbb{N}\}$ is not regular. Here is my try, I would really appreciate if someone could tell me if this is a correct proof. Proof: Lets assume L is regular. Then we know that L must meet the requirements of the pumping lemma. So let p the pumping number. Let $w=a^pcb^p$. $w$ is obvious...
Say you had (0,0,0,1,2,3,4,5,6,7,8,9,10) or (0,1,0,1,0,1,2,3,0,1,0,0,1) Could you use, for example, the KMP algorithm to deduce the validity of the above lists as prefix functions? I know there is a way to find whether a substring exists in a string using KMP, but is there a way to do it the other way around, starting ...
I'm wondering what's the answer of the following question: What is the maximal difference between the depths of 2 leaves in an AVL tree? Intuitively I think that it shouldn't exceed $log n$ but have no idea how to prove that. On the other hand, I saw multiple articles that claim the depth can become larger and larger w...
The standard Post Correspondence Problem concerns tiles with two rows of symbols, and whether a tile arrangement can be made so that the sequence of the top symbols of the tiles is equal to the bottom one. Let $\text{n-PCP}, \text{n} > 0$ a generalization of the Post Correspondence Problem where the tiles contain $\tex...
I'm trying to understand implications of translating between functions and languages for P/Poly complexity. I'm not sure whether the following all makes sense. Giving it my best shot given my current understanding of the concepts. (I have a project in which I want to discuss Hava Siegelmann's analog recurrent neural ...
Suppose we are playing the game hangman. My opponent and I both have access to the dictionary during the game. My opponent picks a word from the dictionary with knowledge of the algorithm which I will use to guess his secret word. Once my opponent has picked a word, I am given only the length of the word. I can guess a...
So I was supposed to prove with the help of Rice's Theorem whether the language: $L_{5} = \{w \in \{0,1\}^{*}|\forall x \in \{0,1\}^{*}, M_{w}(w) =x\}$ is decidable. First of all: I don't understand, why we can use Rice's Theorem in the first place: If I would chose two Turingmachines $M_{w}$ and $M_{w'}$ with $w \neq ...
A central processing unit offers to handle various operations like calculating, watching movies, making presentation etc. While a graphics processing unit is majorly used for the purpose of video rendering or playing of high-quality graphical games. I found the above statement on a website listing the differences betwe...
Let's say Bob wants to send a particular binary sequence to Alice. Imagine that Bob and Alice both have powerful machines but slow Internet connections. Bob could just send the sequence directly but the upload and the download would take a lot of time. Instead Bob could send a program that outputs the sequence. Assume ...
Let $A\in RE$, and define$f(A) = \{y |\ y= f(x),\ x\in A\}$ for some computable function $f$. Then $f(A)\in RE$. I can't figure out why this is true. Since $f$ is computable there is a Turing machine that computes it, denote it by $M_f$. Since $A \in RE$, we get another machine that accepts $A$, and obviously $f(A)$ is...
My problem is as follows: I have a set of shifts at various locations that need to be filled by tutors. A simple example would be basic math in room A on M, W, F from 9-11am and Sa from 12-3 pm. Locations can have a priority. Skills can have a priority. Tutors have a set of times when they are available. Tutors set a m...
As sensors only sense continuous quantities whereas an ADC is a device which actually converts one form of input to another.
This happens to me from time to time: I compile my code with the highest optimization level (-Ofast) of the allegedly fastest compiler (GCC) of one of the fastest languages (C/C++). It takes 3 seconds. I run the compiled program, measuring performance. Then I make some trivial change (say, marking a function inline), c...
Given a connected graph, with weighted edges, a virus starts from a given node. It takes x seconds for the virus to travel from a node to one of its neighbours where x is directly proportional to the weight of the edge. If you are allowed to remove one edge from this graph in order to maximize the ammount of time it ta...
Given a connected DAG I know how to compute the number of paths between two nodes. See e.g. Counting number of paths between two vertices in a DAG . Is there a reference or name for the algorithm? If not, are there well known applications?
I want to prove that $L=\{\langle M \rangle |L(M)\text{ is undecidable}\}$ is undecidable I am not sure about this. This is my try : Suppose L is decidable. Let $E$ be the decider from $L$. Let $A$ be a TM which is recognizing $A_{TM}$. Let $S$ be a TM which works on input $\langle M,w \rangle$ in the following way(the...
I want to prove that $$A \leq_p {\overline{A}} \Leftrightarrow {\overline{A}} \leq_p A$$. Does anyone have a Idea how to solve this ?
The question is quite simple; almost every computer language today provides the $\exp(x)$ function in their standard library to compute expressions like $ke^{-(x - h)^2}.$ However, I would like to know whether this function is the fastest way to compute the above expression. In other words, is there some way to compute...
Given a connected graph and two nodes s and t, there can be many different simple paths (without cycles) from s to t. Is there an efficient algorithm to find the average length of these paths?
Let $L$ be the languague which contains all satisfiable formulas which do not have the or symbol $\lor $. Or more precise $$L=\{\phi | \phi \text{ is a satisfable formula which is only using the junctors $\lor$ and $\neg$ }\}$$ Is $L$ NP-Complete ? I think it is NP-Complete. I can at least show that is in NP. A nondet...
Suppose that there is a server that has $n$ files. The server is used to construct a perfect hash function for those files and then the computed parameters will be sent to a user. These parameters will be used by the user to compute the hash of a certain file in order to find its position between files on the main serv...
The polygon above is actually a collection of a lot of black points closely packed together. I want to approximate these black points as straight line segments. The black points are not sorted in any order. What I'm doing right now is sort these points by selecting any random black point and recursively finding the ne...
I looked at the Cook's theorem at Wikipedia which presents a way to convert any NP problem to SAT but it seems to require O(f(x)^3) variables. Is it possible to remove some of the checks in the conversion so to make it O(f(x)*log(f(x))) in variables and time?
I would like to read some books (or any other material) that cover the design of randomized algorithms with a particular focus on the analysis. My main goal is to develop the rigour needed to construct the proof of correctness for such algorithms. I am currently reading Probability and Computing - M. Mitzenmacher, E. U...
I have a set $S = \{0,1,2,3,4,5,6,7,8,9\}$. $S_i \subset S$ for $i = {1,2,3,4,5}$. Any three $S_i$ has the same union, that is $S_1 \cup S_2\cup S_3 = S_1\cup S_2\cup S_4 = ...=S_3\cup S_4\cup S_5 = A$ and no $S_i\cup S_j = A$. What is lexicoraphical least of such $S_i$s? I have to write a Python code for this and I w...
Say I start with an iso with about 4GB of data and use this, to install windows on a computer. After installation, the operating system will take up about 40GB of disk space. Where does all this "extra" data come from? I mean, when all the information can be packed into 4GB, why does it need 40GB in the end?
In the paper Comparison Based Sorting for Systems with Multiple GPUs, the authors describe the selection of a pivot element with respect to the partition on the first GPU (and its mirrored counterpart on the other GPU-partition). That pivot element is crucial for being able to merge the two partitions, given that we ha...
I am trying to design an algorithm for a problem, and the following is an auxiliary problem for which a good solution would imply a faster algorithm for the original problem. I am given access to an array of numbers. However, I am only allowed to query it by specifying an arbitrary subset of indices, in response to whi...
I am very new to Computer architecture. I am thinking to add one more output register to this 4 bit CPU as shown below. However, I am not sure should I connect the output register to the current CPU. Should I connect it just the same way as the current one and label the 2 output register as output A and output B? But i...
I know this is probably a really basic question but I just cant wrap my head around it right now. So the basic PSO update formula is as follows: $$\bar{v}_{n+1} = \omega \cdot \bar{v}_n + c_k \cdot r_1 \cdot (\bar{p}_{best}-\bar{p}_n)+ c_s\cdot r_2 \cdot (\bar{g}_{best}-\bar{p}_n) $$ velocity(n+1) = momentum_component ...
I read the following argument showing that not every language is described by a grammar: For a fixed alphabet $\Sigma$ and variables $V$ there are uncountable many languages over $\Sigma$ since the power set of $\Sigma^\ast$ is uncountable. But grammars are finite objects by construction and thus there are only counta...
Let $X = \{1,2,\dots n\}$, and $Y_i= \{T \in \mathcal{P}(X): |T| \le i\}$. I am interested in "avoidance sets" $A \subset Y_n$. We say a subset $S \subset X$ is valid with respect to an avoidance set $A$ if $T \not \subseteq S$ for all $T \in A$. We let $f(A)$ denote the set of $S\subset X$ that are valid with $A$. It ...
I am working on floor planing on small orthogonal grids. I want to partition a given $m \times n$ grid into $k$ (where $k \leq nm$, but usually $k \ll nm$) connected components in all possible ways so that I can compute a fitness value for each solution and pick the best one. So far, I have the fitness evaluation at th...
Given a tree of "N" nodes(each node has been assigned a value A[i],node-"1" is the root of the tree), and a constant "K" , we have Q queries of the following type : [w] (which means find the lowest valued node in the sub-tree of [w] , only considering those nodes in the sub-tree of [w] which have a depth less than equa...
Currently I have this 4 bit CPU as shown in the schematic diagram below. What I wish to achieve: Add one more output register to make the CPU output a total of 8 bits Show alphabet using the 8 bits output My current trial: Cout of the first IC connected to Cin of the second IC Cascaded in a synchronous fashion Wh...
I am having trouble understanding the conceptual meaning of the two kinds of analysis. I know the equations and how to solve the problems and I know how one is a forward data-flow analysis while the other is a backwards data-flow analysis, but there is still something missing in the explanations I have seen so far, in ...
I have forgotten how to do this. How do I figure out what the requirements are for a 128-bit string using a certain alphabet? That is to say, I want to generate a UUID (128-bit) value, using only the 10 numbers for the alphabet. How many numbers do I need, and what is the general equation so I can figure this out for a...
I came upon this particular question which I do not understand from Jeff E. Algorithms, Chapter 9, ex. 8. https://jeffe.cs.illinois.edu/teaching/algorithms/book/09-apsp.pdf How can we remove any arbitrary vertex from a directed graph, with weighted edges that can be positive negative or zero, without changing the short...
I am programming a CNC machine (using matlab). In order to generate a surface with a "high" shape accuracy (order of $1\mu m$) and "small" micro roughness (order of few nm) I need to make sure that no large acceleration/decelerations takes place, because this would induce vibrations. If the amplitude of these vibration...
Does every thread have its own main function? I know that its have its own stack, but what about main function (not necessarily a function which called main). For example, when creating a thread, we pass a function as an argument for the new thread to run it. I tried to search about this topic, but couldn't find answer...
Short Version: How can we construct a trie which maps abbreviations of names-of-the-month to full-month (we map the abbreviation "mar" to "march")? The set of all abbreviations is formed by: keeping the first letter of the month name. (all abbreviations of "january" begin with "j") deleting 1 or more characters ("ja...
I was going through section of Breadth First Search of the text Introduction to Algorithms by Cormen et. al. and I faced difficulty in understanding a statement in the proof below which I have marked with $\dagger$ Theorem: (Correctness of breadth-first search) Let $G = (V, E)$ be a directed or undirected graph, and s...
I have been learning graph algorithms, and the concept of dynamic programming is quite succinct. However, I read that Bellman Ford is a form of dynamic programming. I am not sure why since given so many unnecessary re-computations, it is not exactly efficient in the likes of other dynamic programming that computes the ...
I am implementing a Merkle tree and am considering using either of the two options. The first one is sorting only by leaves. This one makes sense to me since you would like to have the same input every time you are constructing a tree from the data, that might not arrive sorted by default. CAB / \ ...
I know how to prove that CFL are closed under kleene star operation using CFG. I can't find online or in class notes a proof using PDA. I would appreciate description of the basic idea (not formal).
Suppose we have a graph $G$ with $n$ vertices. Suppose LP is a linear programming problem where there is a variable for each vertex of $G$, each variable can take value $≥0$, for each odd cycle of $G$ we add to LP the constraint $x_a+x_b+x_c+\dots +x_i≥1$ where $x_a,x_b,x_c,...,x_i$ are the vertices of the cycle. The o...
I have some questions about Pi Calculus: How to simulate the natural numbers only with its primitives? It's possible simulate the if else clauses without the sum (+)? A minimal and standart example would be interesting.
I am using the CPU-OS simulator by Besim Mustafa(https://www.merlot.org/merlot/viewMaterial.htm?id=476196) and I am studying Pipeline Stages. I have written a simple program and captured the metrics like CPU Clocks, CPI, Instruction Count, Speed Factor. My question is what changes should I make to improve the CPI and S...
The language is given by: $$L=\{a^nb^m|n<m\}$$ I have proven that the language is not regular using the pumping lemma but I need help with proving it through Myhill-Nerode Equivalence. Any help would be appreciated.
What sort of speedup can a Turing machine with more than one head give vs a one-headed machine (I do not mean multiple tapes, I mean multiple heads operating on the same tape making concurrent edits on different parts of the tape)? ie. what is the overhead, worst-case, for a one-head Turing Machine to simulate a multi-...
Where $\Omega(f)$ denotes the set of functions with f as lower bound, why is $\sum_{i=0}^n\sqrt{i}\log_2^2i \geq \Omega(n\sqrt{n}\log_2n)$? How can the function on the left be compared to a whole set? I thought usually a function is an element of the set, i.e. $g\in\Omega(f)$ or it is not, i.e. $g\notin\Omega(f)$. If ...
The pipeline of a modern processor has many stages that may issue read requests to main memory, e.g. in fetching the next command or loading some memory location into a register. How is the result of a read request returned to the right pipeline stage, given that there are more than one possible recipients? Since most ...
I have arrays comprised of string elements like the following 2 examples. Each of the following lines is a string element of the array. example1: aaa bbb cc1 dd1 aaa bbb cc1 dd2 aaa bbb cc2 dd1 aaa bbb cc2 dd2 aaa bbb cc3 dd1 aaa bbb cc3 dd2 example2: bbb rrr nnn ttt ooo eee ddd fff contr bbb sss nnn ttt ppp ee...
There seem to be at least a couple different possible ways of modeling sum types in a type system, but I haven't been able to find consistent terms for referring to them: A sum type is formed from a set of "data constructors", which are function-like entities that notionally map values of a summand type to values of t...
Hi, I am learning about memory management in operating systems. I am confused with Address Translation. In this question (pic attached), can anyone explain, how the answer is obtained for Blank #2? What are the steps? Thanks in advance
I am trying to prove that the next problem is NPC: $$ A = \{ \langle\phi\rangle \ \big| \ \phi \ \text{is CNF and has sat. assignment where exactly 10 vars are TRUE} \} $$ I am trying to find polynomial mapping reduction from SAT but I can't find a way to force exactly 10 variables to get TRUE assignment. My idea was ...
I am wondering if there are any clustering applications in practice where the number of clusters, i.e., the $k$ in the $k$-means problem is very high ($k>50$, optimally $k>200$), if possible with a citation. The clustering can take place in any metric space.
Suppose you receive a list of $n$ instructions on $k$ boolean variables where each instruction has the form $$x_i \leftarrow x_i \oplus x_j,$$ (where $\oplus$ is the binary XOR) can we efficiently find a minimal series of instructions (of the same form) that computes the same result, using up to $m$ initially zero extr...
As per the title, is there any polynomial time algorithm to count the number of satisfying arguments for a 2SAT expression with pure literals? An even shallower case: Is there any such counter when the literals in the expression are either all positive, or all negative?
Consider there is a city with $n$ residents who are in need of internet and there are $m$ internet providers in the city. Here in the city every resident needs internet and every resident knows what providers are available to him. Formally let resident $i$ has list of providers $a_i$. Also each provider has a maximum n...
I know it should be easy but I'm trying to determine the complexity of the following variant of Subset Sum. Given a subset $S$ of positive integers and integers $k>0$ and $N>0$, is there a subset $T\subset S$ such that $|T|=k$ and the members of $T$ sum to $N$ ? All of the formulations of subset sum that I've seen do...
I'm trying to solve problem 5.33 from Sipser's Introduction to the Theory of Computation, "Consider the problem of determining whether a PDA accepts some string of the form $\{ww|w\in \{0,1\}^∗\}$. Use the computation history method to show that this problem is undecidable." I have an attempt at a solution but somehow ...
I need to find examples for language $L_i$ $i\in[1,3]$ of natural numbers that is: $L_1\in$ $RE \backslash R$ $L_2\in$ $coRE\backslash R$ $L_3\in$ $\overline{ R \cup RE}$ My idea was in any case to take a language in the desired language class, and find some sort of function from the language to the natural number...
How can we prove Stream A = νX. A × X is isomorphic to Nat -> A = (μX. 1 + X) -> A ? In programming sense, Stream A can be seen as a function from Nat to A, and I can write isomorphisms between them. But how can this be proven mathematically? I would also like to know the conversion mechanism from μ to ν, and vice vers...
By this I mean a theory where you can say Language X is Query Complete so that you know that language is able to do any sort of query? I'm guessing not because some queries would run into things that a language would have to be Turing complete to work? Why do I wonder - well you might have a relational database and a g...
I am having trouble recovering rotation and translation from an essential matrix. I am constructing this matrix using the following equation: \begin{equation} E = R \left[t\right]_x \end{equation} which is the equation listed on Wikipedia. With my calculated Essential matrix I am able to show the following relation hol...
I have a graph like this that starts from one top node and has cycles: I need to write an algorithm to figure if node1 depends on node2. The most primitive algorithm I've written simply starts with node1 and recursively follows all available edges looking for node2 starting from node1. It's very inefficient because I ...
This is a question from GATE CSE 2009. Which of the following is FALSE? A] There is a unique minimal DFA for every regular language. B] Every NFA can be converted to an equivalent PDA. C] Complement of every context-free language is recursive. D] Every non-deterministic PDA can be converted to an equivalent determ...
I did a project in a class using A* search to solve an 8-puzzle. But what about a puzzle with multiple ‘solved’ states? For example, and 8 puzzle with some repeated tiles. I’m not sure whether something like A* search could still work or not. I have trouble fathoming how a heuristic might be designed. Are their other s...
GJ Woeginger lists 116 invalid proofs of P vs. NP problem. Scott Aaronson published "Eight Signs A Claimed P≠NP Proof Is Wrong" to reduce hype each time someone attempts to settle P vs. NP. Some researchers even refuse to proof-read papers settling the "P versus NP" question. I have 3 related questions: Why are people...
If I have datapoints in a high dimensional space and want to find a (linear) subspace onto which a data-set projects well, I can use PCA and then discard less important dimensions of the new basis to get compressed datapoints. However, often the data can be projected onto lower dimensional spaces with much smaller erro...
Consider a Turing Machine which (1) reads all its input and (2) accepts inputs arbitrarily large. Can we conclude that there must be a loop in the finite-state control as its inputs get larger?
I was watching a dynamic programming video by Erik Demaine . He says here https://youtu.be/OQ5jsbhAv_M?t=2133 , finding the shortest paths from S to V for all V, by guessing the node after the starting node is not the right approach, and instead should guess the node before the last node. I didn't understand his explan...
A] {ambncpdq | m+p = n+q, where m, n, p, q >=0} B] {ambncpdq | m = n and p = q, where m, n, p, q >=0} C] {ambncpdq | m = n = p and p not= q, where m, n, p, q >=0} D] {ambncpdq | mn = p+q, where m, n, p, q >=0} Instead of Formal proofs if any answer can provide telltale signs of a language being CFL or not will be mor...
$$\log n+\log \frac{n}{2}+\log\frac{n}{4}+\log\frac{n}{8}+\cdots+\log\frac{n}{n}=\Theta (\log^2n).$$ The sum of logarithms is the logarithm of the product $n\cdot\frac{n}{2}\cdot\frac{n}{4}\cdot\frac{n}{8}\cdots\frac{n}{n}$. This equals $n^{\log n}$ divided by what? If the product would just be $n^{\log n}$, then this ...
Let's say we have a SUBSET-SUM problem with list {$x_1,x_2,x_3,...x_N$} and weight $W$, with some of $x_i<0$. Is there a known way, in polynomial time, to convert this problem into an equivalent problem, but with all $x_i \geq 0$? And if there aren't any, is it possible for there to be such an algorithm?
I am given a directed acyclic graph $G = (V,E)$, which can be assumed to be topologically ordered (if needed). Each edge $e$ in G has two types of costs - a nominal cost $w(e)$ and a spiked cost $p(e)$. I am also given two nodes in $G$, node $s$ and node $t$. The goal is to find a path from $s$ to $t$ that minimizes th...
When downloading a file from the internet to our computer we are usually prompted with an estimate of how long it will take for the file to be downloaded. From the Halting Problem, we know that $\mathrm{HALT}_{\mathrm{TM}}$ is undecidable, where: $\mathrm{HALT}_{\mathrm{TM}} =\{⟨M,w⟩\mid M \text{ is a TM and }M\text{ h...
(1) Assume a function $f:\mathbb{Z^+}\rightarrow\mathbb{R}$ that's defined in a way that utilizes, say, eight basic computations, including addition, subtraction, division, multiplication, (positive square) root, and the floor function. We write a (Sage) program that involves a "for-loop" execution for $f(x)$ values ra...