instruction
stringlengths
35
29.1k
Does back substitution method work for any recursive equation? If not is there any generalized form for recursive equation?
I usually post on Stackoverflow, but I got stuck with a problem which I think fits better here and I hope someone can help me. The task ist pretty simple: Shuffle/Randomize an array/list conditions: each Index has to change; an Item which was at index 0 before the shuffle has to be at an index != 0 after the shuffle a...
I need to generate all unique tuples of length k chosen from a series of unique, positive integers. In my case n choose k will have n=10, 1 <= k <= 10; and the series I am choosing from is { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } . For each chosen tuple, all of its permutations need to be present in the output. For example, f...
Suppose that we have a complete undirected positive weighted graph $G = \langle V, E\rangle$. What is the most efficient algorithm, in terms of time complexity, to find an MST for $G$? The best prime complexity I have found is $O(|V|^2)$, and the complexity of the Kruskal algorithm is $O(|E|\cdot \log(|E|))= O(|V|^2 \c...
I've got the following equation: $p(j = 1 | x, \theta) = \frac{p(j=1,x | \theta)}{p(x | \theta)}$ Why does it hold? Or maybe, how do I use Bayes Theorem in this case, i.e. if we do not only have $p(j = 1 | x)$ but $p(j = 1 | x, \theta)$?
According to wikipedia, Lamport clocks need to be incremented when sending a message (time = time + 1) and when receiving a message (time = max(time_stamp, time) + 1). In my implementation, Increment() is used when sending and Witness() is used when receiving, each of them following the previous rules. I can't understa...
Summary: A task for picking certain objects is given in the form of an ordered sequence (eg. to pick apple, banana, apple, apple, orange, order matters). The objects have to be preassigned to certain physical locations with all the pairwise distance being known and fixed. The question is how to efficiently find the bes...
How is it possible to prove whether the language $\{a, b\}^{∗} \setminus \{S → ε, S → aSbS\}$ is context free?
I've been asked to do this as part of an assignment. Here is the automaton: I understood it as describing in terms of the 5 tuples so I wrote: The states are as follows: Q = {A, B, C} The alphabet is as follows: Σ = {0,1} The start state is A The accepting state is C The transition function is as follows: Is this wh...
I was watching this video on Algorithms and counting number of inversions and he mentioned being cautions when $O(n) + O (n) = O(n)$, saying that is not true if you add $O(n)$ to itself $n$ times. Is the answer $O(n^2)$?
I was reading the book "Computer systems: A programmer's perspective" and saw that the operator, "~", is a NOT operator. When I use it to NOT positive integers, it returns the negative of the original number plus one. Why does that happen?
So I was watching this video https://www.youtube.com/watch?v=ZjjAbFxjxLQ and the guy was explaining why the top automaton is NFA (because the initial state doesn't know what to do if the input string begins with b) and the bottom is DFA (because the initial state points to a 'dead state' if the input string begins with...
Do guarantees provided by the type systems enable better performance optimizations by the modern compilers? I found a 20+ year article suggesting that it would. Also, intuitively speaking, knowing more about the code in advance should also be useful. However, a friend claims that modern JIT compilers make such claim ir...
CLRS problem 23-4 part c gives an algorithm that may or may not compute a minimum spanning tree. Given some connected undirected graph G, we have MAYBE-MST-C(G,w) T = empty set for each edge e in G, taken in arbitrary order T = T U {e} if T has a cycle c let e' be a maximum-weight edge on c T = ...
As the title says, I'm just curious if there are any problems with polynomial-time algorithms, but where no polynomial-time algorithm for it is currently known? Of course, this question would be trivial if the only method of showing a problem is in class P is by providing an algorithm. However, there can also be non-co...
I'm currently trying to investigate the relationship between relation extraction (RE) and event extraction (EE). Doing more reading on the two tasks has caused me to question my initial belief that RE is within the task of information extraction (IE). The reason why I believe so is because RE is typically modeled as a ...
Which areas of CS/Math should one have mastered before diving into parametrized complexity?
one example: How many ways we can do possible value-preserving parenthesis the following expression in such a way that value not changed after parenthesis with one constraint that parenthesis among one variable is not correct (i.e: $(i)+j+k$ is not acceptable) ? as an example for expression $i+j+k$, parenthesis like ...
I am reading Yves Lafont's introductory paper Interaction Nets. Early in the beginning he mentions that max cannot be coded as follows since in this coding it is not possible to choose which argument to look at first (so necessitating the need for a principle port). But I don't understand why it's wrong. I am trying t...
Hope you had a fantastic christmas break :) I am trying to find an algorithm in polynomial time that finds the shortest arithmetical expression (the one with the least amount of 1 symbols) to express any natural number, while only using the elements of $\Sigma=\{(,),1,+,\times\}$. As an example there are multiple ways ...
Given a Turing Machine T, are there any input strings rejected by T. I need to decide whether this is decidable or recursively enumerable. I think it's undecidable, but I'm not sure how to prove it. My initial approach would be to reduce the Halting Problem as either a string will 1)halt on final state i.e accepted or ...
I have an assignment in linear programming and this question was asked: given an input of two data sets $P_1,P_2$ containing points $(x,y)$, create a linear program that finds an equation of a line the separates between the two data sets. Now I saw in Wikipedia the article about linear separability and I didn't underst...
Question I want to analyze the potential of a cloud computing application that performs payroll and invoicing over the Internet from a large Internet company.I want also to describe the systems development steps and procedures you would use to analyze the feasibility of this approach. I would like to find material and...
Give an example of a string in the language of $(0^*10^+)^+$. I've been asked to give an example of a string in this language but I'm confused on how to read this notation. I'm guessing the acceptable strings are supposed to start with 0, but that's about all I can infer.
TLDR: I want to know if there's a simple way to fill in distances for all vertices reachable from negative weight cycles (not just ones on the cycle itself) once Bellman-Ford has found a negative-weight cycle. The Bellman-Ford algorithm finds single-source shortest distances $d$ for a graph of $|V|$ vertices by making ...
I'm reading this paper on latent representations with the information bottleneck https://arxiv.org/pdf/1804.06216.pdf and in section three, the authors write that the parametric formulation of the information bottleneck is $\max\limits_{\phi,\theta} - I_\phi(t;x) + \lambda I_{\phi,\theta}(t;y).$ My question is not abou...
As far as I can tell, there are no examples of trapdoor functions which hardness assumptions is merely hardness of some NP-hard problem in worst case. That is, a trapdoor function in which, it is proved that, if there is an PPT algorithm that can invert it with non-negligible probability, then there is a PT algorithm w...
Axiom schemata (such as ZFC) are, in a sense, infinite sets of axioms. Do the ATPs designed to work with FOL (such as Vampire) accept axiom schemata? I looked in the Vampire "manual" briefly, but couldn't answer this question. Is this possible? How would one do it in TPTP syntax? Are problems involving axiom schemata p...
I have some difficulties in understanding how to prove when a language is in P or is NP-Complete. Specifically, consider the following decision problems w.r.t undirected graphs $G = (V, E)$: $L_1 = \{ \langle G = (V, E), k\rangle \mid \text{$G$ consists of connected} \\ \text{components of size at most $\log|V|$ each,...
I was given this special type of Directed Graph and was asked to find it's Maximum Independent Set. Graph Properties : Graph has $N$ vertices and $N$ edges There can be no edge from a vertex $v$ to itself Each vertex $v$ has only 1 outgoing edge and 0 or more incoming edges I framed this problem as a linked list with...
I was asked the following question in an interview and I don't understand what is the best solution for it - Assume you have an application that needs memory. It asks for a program for this memory, 20 bytes each time. Each allocation (calling to malloc) costs another 8 bytes, so actually, you use 28 bytes (if you alloc...
I would like to know how to derive the time complexity for the Heapify Algorithm for Heap Data Structure. I am asking this question in the light of the book "Fundamentals of Computer Algorithms" by Ellis Horowitz et al. I am adding some screenshots of the algorithm as well as the derivation given in the book. Algorithm...
I am afraid the question title might not be sufficiently accurate but I could not come up with something more accurate Here is the problem Given 'n' machines Each machine has a set of capabilities Each machine has max availability (A(m)) Given 'm' tasks Each task requires a set of capabilities Each task takes a cert...
I do not have a strong background in theoretical computer science, so the terminology I use may not be the most ideal. Basically the "trend" across programming languages I have noticed is that there appears to be an trade-off in the speed of a programming language (how long it takes to execute a program) and its expres...
Evening All I already have a "grasp" of haskell (not terrible, about 6 month experience) and am trying to learn the fundamentals that sit behind it, thus am now turning my attention to trying to learn Lambda Calculus. I thought, perhaps mistakenly, that it might be a good idea to try to work out the λ -terms that corre...
I am currently taking computer science coursework as part of a computer science related degree at my University. I was wondering if I should upload the solutions I make for various trivial homework assignments (ie. not more than 20-30 or so lines of code, on basic/fundamental topics) to my GitHub account, or if I shoul...
I'm looking for a computer langauge with "dependent types" but... The problem with it having a full implementation is that you end up having to write formal type proofs to get even anything simple done. (Agda/Iris). These are fine if you are writing a proof checker but not for general programming. As a compromise it wo...
CLRS exercise 24.4-9 says the following: Show that the Bellman-Ford algorithm, when run on the constraint graph for a system $Ax \leq b$ of difference constraints, minimizes the quantity $\max_i\{x_i\} - \min_i\{x_i\}$ subject to $Ax \leq b$. Explain how this fact might come in handy if the algorithm is used to schedu...
I'd like to partition a graph into subgraphs with overlapping nodes. To do a simple partition into two, I could use kernighan_lin_bisection algorithm available in networkx package. import networkx as nx from networkx.algorithms.community.kernighan_lin import kernighan_lin_bisection if __name__ == '__main__': G = ...
Afternoon All, Perhaps an easy one for many, but am new to Lambda calculus: Is the below list, Ni, a representation of the Church numerals? I think it is but how do I prove it...if not, what is it...? The terms Ni and N'i for each natural number i are defined as follows. (n and c are variables while i stands for a numb...
The following problem (I'm paraphrasing) appeared in the 2019 Balkan Olympiad in Informatics: Five friends are on a road trip in a country with $N$ cities and $M$ bidirectional roads joining them. They start in city $1$ and wish to end in city $N$. All of them love driving, so they move in the following fashion: Each...
Say I have an object which I pass to a method, and the method returns that same object, just mutated. So it goes like this: doSomething({ a: 1 }) // { b: '1' } function doSomething(input) { input.b = String(input.a) delete input.a return input } How do you specify a type for this object and type for the action ...
The following problem was part of a local programming contest I attended..(I solved it via the obvious Brute Force solution) I was wondering whether there was a cleaner Dynamic Programming solution. Problem Statement: You have an array $a$ of $n$ integers and an integer $k$. Your task is to find a subset $m$ of a where...
Given the languages $L_0 = {w \in \{0,1\}^*}$ such that $w$ is a palindrome and $L_1 = {w \in \{0,1\}^*}$ such that $w$ is not a palindrome, meaning $L_1$ is the complement of $L_0$, we want to find the grammar for both languages. $G(L_0) = S \to \epsilon | 0S0 | 1S1 | 0 | 1$ is easy to come up with, but $G(L_1)$ is mu...
This question connects different disciplines so it's awkward to choose a SE site for it, but I'll go with this one because here (I hope) the shared culture will make information transfer easier. So computers as we know them use electricity and I don't know what other invisible things that I don't understand. I was wond...
Why we can't create a binomial heap in max-heap format instead of min-heap format?
Context I am a final year Bachelor of Mathematics student and next semester I will write my Bachelor thesis. My interests are in Machine Learning (ML) and I will do a master in ML next year. More specific sub-fields I like are Deep Learning Computer Vision Natural Language Processing Reinforcement Learning And my int...
I have the following problem: I have $c$ conflicts, named $(c_1, \ldots, c_c)$, where each conflict $c_i$ has certain size $s_i\in\mathbb{N}_0$: the number of times conflict $c_i$ has happened. Also, I have $m$ conflict resolution methods, named $(m_1, \ldots, m_m)$. Each method $m_j$ cannot be used more than $u_j\in\m...
I have a real life algorithmic problem and I'm trying to find out if there is any similar widely known algorithmic problem with known solutions that I could adapt to my particular use case. I want to solve a kind of scheduling problem: I have a machine that will be processing jobs and I want to fit them into a schedule...
I don't know how to find the Language and the regular expression for each one. there are any special method for those kind of question?
I am a college student looking to get into industry work soon and want to understand what employers consider 'proficient' when it comes to programming languages. Right now, I understand that to mean that one can write a fully functional program without consulting any references. However, is there a tangible project o...
I have found some problems whose solving "patterns" appear quite recently, and I am not sure if the way I'm solving them is the most correct/efficient one: For example, take this language: $\{w | w\in\{a,b,c\}^* \text{ with }|w|_a=|w|_b \text{ or } |w|_b=|w|_c\}$ The solution would be as follows, where $\\\$$ is the bo...
I am making a scheme that respresents some closure properties (union, intersection, complement and concatenation) for regular languages, context-free languages, decidable languages and RE languages. Below you can see my scheme. I am trying to find all possible internal closure properties of these different languages t...
I stumbled across the optimization problem described below and I am looking for how to approach it efficiently. I have the feeling that the problem at hand might be known, but I was not able to find its name or further information on it. So any help to find an efficient algorithm for its solution or a pointer to the na...
I have a list of billions of paths in an unknown graph, e.g.: A -> B -> D -> E A -> F -> K A -> B -> K -> B -> D -> E and I want to obtain the edge list, e.g.: A -> B A -> F B -> D B -> K D -> E F -> K K -> B This feels like a classical problem, and I would like to know if there is a classical solution.
In this question, I'm considering only "finite grammars". A finite grammar can only produce a finite number of distinct sentences. The following grammar is finite in my definition: S → AB A → B | a B → a | b It can only generate the following finite number of sentences: aa, ab, ba, bb On the o...
I have the following DFS2 pseudo-code, which is used in the pseudo-code of IDA*, from my teacher's book, but I cannot understand why it's correct: DFS2(N0, f, threshold): PQInit(PQ) // PQ means Priority Queue, for a pair (c, p) in PQ it represents a path from N0 to c. PQ.offer(null, N0) while isEmpty(PQ) is FALSE do ...
Some scheduling algorithms favour CPU bound processes while others favour I/O bound processes. Which algorithm favours which type of process? My answers: SJF favours I/O bound processes.Explanation: Short CPU burst processes(I/O bound processes) are given higher priority. SRTF favours I/O bound processes.Explanation:...
The question is clear in the title. I am trying to solve this recursion as a part of showing that the worst case of quicksort algorithm occurs when $k=0$, but can't do it. I could do the following specific cases (by repeatedly using the same recursion): 1)$T(n)=T(n-1)+O(n)$ 2)$T(n)=2T(\frac n2)+O(n)$ Can anybody please...
I'm looking for a collection of SAT problems that are usable for a test suite, i.e.: are small/easy to solve, that is, this is not a benchmark but a correctness test suite some satisfiable, some unsatisfiable answer and a possible assignment (for sat. ones) is known All I find online are collections of benchmarks but...
I know that feedback vertex set (FVS) problem is $\mathrm{NP}$-complete since there is a simple and nice polytime reduction from vertex cover (VC) problem to FVS. Specifically, given a undirected graph $G$, we construct $G'$ as follow: For every $uv \in E(G)$, we construct a new vertex $e_{uv}$, and let $V_{0} = \{ e_...
I am studying the longest path problem with the final objective to show that it is NP-complete. On wikipedia I read that the problem itself is NP-hard but the underlying decision problem is NP-complete. I have some trouble understanding the difference between the two though. How are they not the same? I read in another...
I am trying to remove ϵ rules from the following grammar (after applying the remove redundant symbols algorithm): $G = (\{S,A,B,C\},\{0,1\},P,S)$, where the productions are \begin{align} &S \to AB \mid C \\ & A \to 0A1 \mid \epsilon \\ &B \to 0B \mid 0 \\ &C \to 0C0 \mid B \end{align} The result of applying the remove ...
I have been reading a book called The Algorithm Design Manual by Steven Skiena and one of the topics discussed there is an algorithm to find all the articulation points in a graph. In it, we first construct a DFS tree and store the following information for each vertex in the DFS tree: The traversal order at which we ...
Given a full tree $\ T = (V, E, w) $ I need to find the path with maximum length from root $\\ s $ to any of the leaves. I was thinking I could use some sort of BFS. Because I'm looking for maximum length path, I must go through all of the edges of the tree and I will start at the vertex $\ s $. So I'll use a dictionar...
to prove this statement I assume the probing function as: $$h(i,x)=h'(x)+i^2 \text{ mod t} $$ And for $0\leq i,j < \frac{t}{2}$; $i\neq j; t \text{ prime}$: $$h(i,x) = h(j,x)$$ This results into $$(i+j)(i-j) \text{ mod t} = 0$$ Which is a contradiction as either $i+j=0$, $i-j =0$ or $(i+j)(i-j)=t$, and because i and j ...
I want to learn about Volterra classifiers in-depth to understand the following papers Papers https://openaccess.thecvf.com/content_cvpr_2014/papers/Kang_Convolutional_Neural_Networks_2014_CVPR_paper.pdf https://www.researchgate.net/publication/51855543_Trainable_Convolution_Filters_and_Their_Application_to_Face_Recog...
I found the following answer: $L_{17} = \{ \langle M \rangle \mid \text{$M$ is a TM, and $M$ is the only TM that accepts $L(M)$} \}$. R. This is the empty set, since every language has an infinite number of TMs that accept it. As I know number of TMs is $\aleph_0$ and number of languages is $2^{\aleph_0}$, so how c...
Is it possible to generate a better random number generator algorithm from an algorithm that use N number of computers with an algorithm that uses N+1 number of computers? I use the word computer here, but I believe you can use the word processor instead as not all computers are single-processor computers although I am...
Where "switches" are the basic abstract building blocks for logic gates: vacuum tubes, transistors, magnetic relays, or whatever. We're not counting any switches in the RAM or tape drive because that's a separate component. I'm not sure if the exact number is known or provable, but an upper bound could be proven by imp...
I asked the following question on math.se but it wasn't really answered so moved it over here as I feel it's more relevant. I saw the question below on an old stack exchange question when looking to understand NP-completeness. At first, I thought I understood it so I gave it a go but ended up more confused than before ...
By "indexing" I mean assigning addresses or labels or whatever to nodes to make them easier to locate, similar (in its effect, not necessarily in the implementation) to how a database can be indexed. I feel this question must be pretty elementary, but as a CS noob I don't know how to search for the answer. I may not ev...
Given an undirected graph with at least one path connecting $u, v$, and a sequence of edges to be removed: $e_1, e_2, \dots$, I would like to quickly identify the point at which $u$ will be separated from $v$. Clearly this could be done by doing a full path search after each removed edge, but this is very expensive. Is...
Pure Prolog (Prolog limited to Horn clauses only) is Turing-complete. In fact, a single Horn clause is enough for Turing-completeness. However, pure Prolog is incapable of expressing list intersection. (Disequality, dif/2, would allow it to do it, but dif/2 is not Horn, unlike equality). This seems like a paradox, at f...
I found this on Wikipedia and I'm confused by the parenthesis in the notation not that it doesn't make sense to me but is there a more natural human version? And im generally confused about all the different notations surrounding logic and quantifier. $(\forall L \subseteq \Sigma^*)(regular(l)\Rightarrow((\exists p\geq...
I have an array (|A|≤10^6) of numbers (not guaranteed to be distinct) and a set of prime numbers. For each of the prime numbers, I want to know how many numbers in the first array are divisible by this prime number. For example: Array = {5 5 7 10 14 15} Set = {2 3 5 7 11} result:2:2; 3:1; 5:4; 7: 2; 11:0 Brute force ...
I am trying to develop the intuition of the master theorem for the case where $a > b^{d}$ [Case 3] in this video. In the video, they say that since most of the work is done at the leaves, we should expect $O(\text{number of leaves})$ but I don't see how that is similar to $O(n^{\log_b a}$), which one would get from th...
I'm trying to understand the solution of the following problem (LC 801): Given two arrays, A and B, of the same nonzero length, find the minimum number of swaps (A[i] <--> B[i]) to make A and B strictly increasing. The solution is guaranteed to exist for the given input data. Example: Input: A = [1, 2, 9, 4, 5, 6], B ...
This is a homework question and I am trying to fully understand what I have to do and how to go about it. Therefore, I don't want full answers to the question. The programming language PRE-WORK-POST is defined as follows: Let P, Q, R be LOOP Programs. Then "PRE P WORK Q POST R END" is a PRE-WORK-POST program, whereby ...
Many languages with GC perform escape analysis to reduce heap allocations. Is there a language with a "no-escape" construct that tells the programmer during compile time to not escape certain variables? This way they could be guaranteed to be allocated on the stack instead of the heap. Compare with value types in Java ...
I began a simple collection of the events behind todays computers. My knowledege in these fields is so limited, and I read: "In the 1930s and working independently, American electronic engineer Claude Shannon and Soviet logician Victor Shestakov both showed a one-to-one correspondence between the concepts of Boolean lo...
I'm creating a tool where, given a list of N items that have a volume (v) and a price (p), it should produce a list L that optimally fits as much value as possible into a single bin with a fixed size V. L does not need to contain all N. My current solution is a heuristic that simply sorts all the items by price-per-vol...
Given a graph $G = (V,E)$, how to partition $V$ into $k$ parts $P_1, P_2, \ldots P_k$ of at most $M$ vertices, such that the number of triangles (3-cliques) contained in the parts is maximal? This seems NP-complete. Was this problem studied before? (I couldn't find anything after searching clique graph partition). Furt...
I have a list of items that have a parent/child/grandchild/etc. type of relationship. Each item has a list of descendants, and an _.isDescendentOf(other) member function that returns true when a node is a descendant of another node (they have a list of immediate parents, and can sweep upwards to find grandparents). Som...
It is well known that for arbitrary flow networks, Goldberg's push-relabel algorithm takes $O(V^2E)$. Part of that comes from $O(V^2E)$ non-saturating pushes. Another part comes from $O(V)$ relabelling operations per vertex, each taking $O(V)$ time, for a total of $O(V^3)$ for all relabelling operations. I'm intereste...
What is the fastest known time complexity for computing central trinomial coefficients? Let $C_n=1,1,3,7,19,51,...$ (OEIS A002426) denote the coefficient of $x^n$ in $(x^2+x+1)^n$ starting at $n=0$. It can be shown that, if $n$ is prime, then $C_n=1 \pmod n$, because by the binomial theorem $$(x + y)^n=\sum_{k=0}^{n} \...
I need to find a regular expression for the language of all words over $\{0,1,2,3\}$ which do not contain $222$ as a substring.
So, I was watching a video about the conversion of $\epsilon$-NFA to a DFA. In the resulted DFA, she didn't write the state 4 in any successor set of the sets containing the state 3, and her explanation was that this happens because the state 3 has no outgoing transitions that are labeled with letters from $\Sigma$ in ...
I'm looking for an algorithm that will let me optimally select items from a set. These items have properties which are involved in defining constraints as well as the objective function. .e.g Say each item in the set has integer-valued properties A, B, C. I need to select n items (say 2, can pick any item at most once)...
Let me just say that this is for a university project. I do not expect an answer but more of a "hint". I have a schema of a Supermarket that holds a sequence of queues: +-- Supermarket------- |queues: seq Queue ---------------------- And here is how I've defined a queue: +-- Queue ---------- |length: ℕ ---------------...
Given $A_1$ - DFA with $n$ states, $A_2$ - NFA with $m$ states (both over the same alphabet - $\Sigma$). What's the state complexity, i.e. an upper bound for the amount of states of the minimal DFA, recognizing the language $L(A_1)\setminus L(A_2)=L(A_1) \cap(\Sigma^*\setminus L(A_2))$. What I thought of: evaluate the ...
Consider the Halting problem : No TM H exists which given any TM and input, decides whether that TM will halt on that input. The usual proof (informally) is that if such an H existed, then a function D(X) = {if H(D,X) then loop; else Halt;} can be constructed, with D(D) leading to a contradiction => hence H can’t exist...
I'm really interested in the idea of functional programming, it seems like a very modular way of doings things. I've seen some suggestion that functional programming is just as powerful as procedural programming (any problem you can solve with one can be solved with another). I'm curious as to how this conclusion was o...
The following is a function to write a recursive function that accepts an array and a callback. Function returns true if a single value in array returns true when passed to the callback otherwise it returns false. I have trouble understanding the "if not" line written here(line 4), how does the cb interact with arr? Pl...
I am working on my own personal project. I took an intro to coding class last semester so I have been exposed to coding but I am still lost with it. Basically, for my project, I want to build a web map (I'm not even sure if that's the right word for it) using python. Here is an example. Basically, some numbers will ha...
Looking at the pumping lemma, I've noticed that in the string $xy^pz$, there seems to be no rule explicitly stated for $x$ and $z$. If I understand correctly, $x$ and $z$ are basically anything on the 2 sides of the string $y^p$ that we're pumping and thus can be anything in $L$. Rule 2 & 3 of the pumping lemma are: $...
In the Partition problem, there is a set of integers, and the goal is to decide whether it can be partitioned into two sets of equal sum. This problem is known to be NP-complete. Suppose we are given an instance and we know that it admits an equal-sum partition. Can this partition be found in polynomial time (assuming ...
Consider the following language $$L= \{ \langle M\rangle | \text{ $M$ is a TM, and $L(M)\in coRE$} \}$$ I don't understand why the language $L$ is in $R$, intuitively, I think this is not true. Indeed, suppose we have a TM $M$, now for input $x$ such that $x\notin L(M)$, it seems that we cannot decide whether $x\notin...
I was writing up an algorithm that involved knowing the size of integers my hardware can manage without having to resort to software implementations of math operations and the additional computational load that comes with them, and I realized that I've never given this much thought. In theory, a 64-bit computer has 64 ...
I have a numerical dataset of $N$ columns ($\approx 150$) and $K$ rows ($\approx 60000$). On a user interface, you can apply a filter to one or more columns. We can call the number of filters = $Z$ (with $Z \le N$). Those filters are double sliders allowing to get a min/max for the column. For each filter, I would like...