instruction
stringlengths
0
29.8k
⌀
I was learning about decidability when I thought of this question: If P is partially decidable, is ¬P decidable, partially decidable or undecidable? I think it is Undecidable since if ¬P holds then P doesn't hold, and the characteristic function of P is undefined when P doesn't hold so we can't come up with a charac...
There is no definitive answer. If predicate $P$ is partially-decidable, $\neg P$ can be decidable, partially-decidable or undecidable. - Let $P(n)$ be "is $n>1$?". $P$ is partially decidable. $\neg P(n)$ is "is $n\not\gt 1$?", which is decidable. (Note that a partially-decidable predicate such as $P$ can be decidabl...
If we can make memory infinite, why don't we just give Deterministic Finite Automata an infinite amount of states? Why is it useful to define Turing machines and pushdown automata? Bonus question: Can we think of the universe as a big ass DFA? (Standart Model, interaction of particles, etc.) Sorry for the long li...
Since there is no such thing as infinite memory, can we say that all pushdown automata and Turing machines are actually very big DFA?
|complexity-theory|turing-machines|finite-automata|pushdown-automata|
DFAs have a bounded amount of memory. In contrast, PDAs and Turing machines can use an unbounded amount of memory. The amount of memory used by a PDA or a Turing machine at any given time is finite, but is not necessarily bounded. For example, the standard PDA for the language of all words of the form $a^nb^n$ uses ...
For every second $a$ that you read, push $BBB$ into the stack.
I am trying to create a PDA with at most 7 states that accepts the following language over the alphabet $\Sigma = \{a,b\}$: $$ \{a^{2k}b^{3k} \mid k \geq 0\} $$ The tricky part is that multiple push allowed but multiple pop is not allowed. I was able to find the easy solution when multi push/pop is allowed. I ...
Pushdown automaton that accepts $a^{2k} b^{3k}$, without multiple pop
My lecture notes for complexity says that $\mathsf{ASPACE}(f (n)) = \mathsf{DTIME}(2^{O(f (n))})$ I can prove the forward direction ($\mathsf{ASPACE}(f (n)) \subseteq \mathsf{DTIME}(2^{O(f (n))})$) by building a computation tree of the alternating Turing machine and rejecting after $\ge 2^{f(n)}$ time steps and then...
Here is another solution. For every $aa$ you could check every $bbb$(skips first $b$ and pop $2a$ for last $2b$).
Here is another solution. For every $aa$ you could check every $bbb$(skips first $b$ and pop $2a$ against for last $2b$).
{"Voters":[{"Id":150715,"DisplayName":"user19121278"}]}
Here is another solution. For every $aa$ you could check every $bbb$(skips first $b$, keep stack's present top $a$ as it is and pop $2a$ against for last $2b$).
{"Voters":[{"Id":150715,"DisplayName":"user19121278"}]}
I'm trying to understand the implementation of the algoritm [here][1]. Please see GammaLowerRegularized(a, x) function. I understand 1st part of the function for `x <= 1 || x <= a`. The authors use Kummer's confluent hypergeometric function `M(1,a,x)`, because it converges under the specified conditions. But don'...
DVR(uses Bellman-Ford to reach the neighbor e. g, RIPv1) and Link state(uses Dijkstra algorithm to keep the knowledge of entire topology e. g. OSPF) is the example of dynamic routing protocol. In dynamic routing routers exchanges the routes (routing database) periodically with neighbors (for DVR) or with whole entire t...
DVR(uses Bellman-Ford algorithm to reach the hop e. g, RIPv1) and Link state(uses Dijkstra algorithm for finding the shortest path to keep the knowledge of entire topology e. g. OSPF) is the example of dynamic routing protocol. In dynamic routing routers exchanges the routes (routing database) periodically with neighbo...
Finite automata can have any amount of memory, but it will always be finite. Pushdown automaton and Turing machine do have unbounded memory at their disposal. Apart from that, the Turing machine concept is an answer to the question what is an algorithm. In the same way the equivalence between context-free grammar an...
This problem appears on the competitive programming contest here: https://szkopul.edu.pl/problemset/problem/NZSCUwz2ACePsBKuVCIVzrRt/site/?key=statement Apparently it's the Polish Olympiad in Informatics 2018. The problem has $n \le 200,000$ vectors, meaning that any brute force solution won't work. I solve...
It seems that the algorithm is based on the approximation of the following continued fraction: [![Continued fraction][1]][1] (The image from the Boost C++ Library [documentation][2]) To approximate such a fraction one can use the following [recursion][3]: [![enter image description here][4]][4] [1]: ht...
This problem appears on the competitive programming contest here: https://szkopul.edu.pl/problemset/problem/NZSCUwz2ACePsBKuVCIVzrRt/site/?key=statement Apparently it's the Polish Olympiad in Informatics 2018. The problem has $n \le 200,000$ vectors, meaning that any brute force solution won't work. I solve...
I'm trying to understand the implementation of the algoritm [here][1]. Please see GammaLowerRegularized(a, x) function. I understand 1st part of the function for `x <= 1 || x <= a`. The authors use Kummer's confluent hypergeometric function `M(1,a,x)`, because it converges under the specified conditions. But don'...
It seems that the algorithm is based on the approximation of the following continued fraction: [![Continued fraction][1]][1] (The image from the Boost C++ Library [documentation][2]) To approximate such a fraction one can use the following [recursion][3]: [![enter image description here][4]][4] The resul...
I think there may be a mistake in your statement, unless you allow a walk to stay in the same vertex on a step, instead of crossing an edge (but that's not the usual definition of [walk](https://en.wikipedia.org/wiki/Path_(graph_theory)#Walk,_trail,_and_path)), or unless you consider each vertex in a complete graph to ...
null
There is a unique path in the derivation tree that leads from the axiom $S$ to the terminal symbol $\#$. An idea would be to turn this tree upside down along that path. This solution follows the construction for the [closure under cyclic shift for context-free languages][1], as suggested in the book by Hopcroft and ...
null
null
References: [nLab][1] [1]: http://nlab-pages.s3.us-east-2.amazonaws.com/nlab/show/dependent%20type
null
Given an array of characters, I need to delete all the characters that got repeated 3 or more times (consecutively) and add '0' at the end of the array for every deleted character, The restrictions: * $O(n)$ time * $O(1)$ memory * Can't overwrite a cell in the array more than once Examples: "aacccbbddde" --> ...
null
I have a Boolean formula in [conjunctive normal form][1] (CNF) $$(a\vee b \vee c) \wedge (a \vee b \vee \neg c) \wedge (x \vee y)$$ I know that this can be simplified to $(a\vee b)\wedge (x \vee y)$. 1. Is there an algorithm to decide if a CNF is already in the reduced form or not? 2. Is there an algorithm ...
Is there an algorithm for reducing CNFs further?
null
I understand that there are three types of programming languages: * Machine languages * Assembly languages * high-level languages And that: * Machine languages have no abstraction * Assembly language have little abstraction * High-level languages have much abstraction (data types being the difference maker...
null
There doesn't seem to be any resources on this. > I would like to know if there is a linear-time algorithm $(\mathcal{O(n)})$ to *convert* a > Complete Binary Tree with data left-to-right increasing stored in > external nodes, to a [Priority Search > Tree](https://en.wikipedia.org/wiki/Priority_search_tree). ...
How to convert a Complete Binary Tree to a Priority Search Tree in O(n)?
|data-structures|trees|binary-trees|search-trees|
null
I would like to know if there is a linear-time algorithm ($\mathcal{O(n)}$ time) to convert a Complete Binary Tree with data left-to-right increasing stored in external nodes, to a [Priority Search Tree](https://en.wikipedia.org/wiki/Priority_search_tree). By conversion, my aim is to create a "Priority Search Tre...
Linked lists can work well even if memory is fragmented. Arrays usually require a continuous piece of memory. For large piece of data finding this large continuous piece of memory might be hard. Most of benefits of linked lists requires to remember more links than just the head. For example. If you are doing some se...
null
Ubiquitous computing refers to ["information technology and computer power, which in principle pervade all everyday objects"][1] (see Friedewald and Raabe, 2010). A similar form is wearable computing, where the computing device is placed on a persons cloth/body. This topic currently gets much attention: smart watches...
null
I was interested in finding regular expression for all strings with at least two $0s$ over alphabet $\{0,1\}$. I attempted and formulated $$(0+1)^* 0 (0+1)^* 0 (0+1)^*$$ Is this correct? And if not can somebody post and explain the correct one?
null
# Classic, well-known results # As mentioned by Standa Zivny on the related question of CSTheory, [Which SAT problems are easy?](https://cstheory.stackexchange.com/questions/4375/which-sat-problems-are-easy), there's a well-known result by [Schaefer from 1978][1] (quoting the answer of Zivny): > If SAT is parametrise...
null
Maximum difference between maximum and minimum frequency in a subarray
null
Bayes theorem probability doesn't make sense
null
I was watching video [*7. Binary Trees, Part 2: AVL*](https://www.youtube.com/watch?v=U1JYwHcFfso&list=PLUl4u3cNGP63EdVPNLG3ToM6LaEUuStEY&index=10), where professor Erik Demaine stated that $$2N_{h-2} = 2^{h/2\text{ (or maybe with floor or something... maybe it's ceiling)}}$$ where $N$ stands for the number of nodes in...
null
[Malament-Hogarth space-times][1] allow for infinite computations to be performed in finite time (in the observer's frame of reference), by essentially placing a classical computer into a black hole and then retrieving it. Practically, there are some difficulties in extracting intact objects from a black hole, but the ...
null
some thoughts but haven't been mathematically proven. to solve the problems we need to decide the priority to buy each product 1. if $ p_i(t) = p_j(t) $ has crossing point at $ t_{ij} > 0 $, we have two cases: 1. when $ t < t_{ij} $ and $ p_i(t) > p_j(t) $, then we want to buy $ p_j $ sooner than $ p_i $ ...
null
null
DVR(uses Bellman-Ford algorithm to reach the next hop e. g, RIPv1) and Link state(uses Dijkstra algorithm for finding the shortest path to keep the knowledge of entire topology e. g. OSPF) is the example of dynamic routing protocol. In dynamic routing routers exchanges the routes (routing database) periodically with ne...
It seems that the algorithm is based on the approximation of the following continued fraction: [![Continued fraction][1]][1] (The image from the Boost C++ Library [documentation][2]) To approximate such a fraction one can use the following [recursion][3]: [![enter image description here][4]][4] The resul...
Suppose $f$ is a partial function over the natural numbers. If $f$ is computable by a universal register machine program, is the function $$ g(x)=\begin{cases} 1&\exists y:f(y)=x\\ \text{undefined}&\text{otherwise} \end{cases} $$ also computable by a universal register machine program? If $f$ is total the...
Universal register machine that recognizes the domain of a partial function
|computability|computation-models|
Suppose $f$ is a $\mathbb N$-valued partial function over a subset of $\mathbb N$. If $f$ is computable by a universal register machine program, is the constant partial function $$ g:\text{image}(f)\to\mathbb N $$ defined by $g(x)=1$ for $x\in\text{image}(f)$ and undefined elsewhere also computable by a universal r...
Universal register machine that recognizes the image of a partial function
I want to know what will change if we keep on using {0,1} for our Fourier analysis of boolean functions? What are the things, which can not be performed with {0,1} and can be done with {+1, -1}?
Why do we use {+1, -1} in place of {0, 1} for the Fourier analysis of boolean functions?
|boolean-algebra|
**Holddown** is another loop-prevention mechanism employed by distance vector routing protocol($DVR$). This feature prevents a router from learning new information about a failed route. When a router receives the information about the unreachable route, the holddown timer is started. The router ignores all routing upda...
**Holddown Timer** is another loop-prevention mechanism employed by distance vector routing protocol($DVR$). This feature prevents a router from learning new information about a failed route. When a router receives the information about the unreachable route, the holddown timer is started. The router ignores all routin...
ETH says that, for $s_k = \inf \alpha$ such that k-sat can be solved in $2^{\alpha n}$, it holds that $s_3 > 0$. The strong exponential time hypothesis (SETH) says that $\lim\limits_{k \rightarrow \infty}s_k = 1$. I think you mean the latter in your description. Answering your question: The conjecture presents a...
Many years ago I was asked for help by a mate who studied economics. His professor had developed a model for work per time: After you perform X units of work, your experience grows, and therefore you can perform one unit of work Y percent faster. And my mate couldn't wrap his head around it. Since you ask about the...
Many years ago I was asked for help by a mate who studied economics. His professor had developed a model for work per time: After you perform X units of work, your experience grows, and therefore you can perform one unit of work Y percent faster. And my mate couldn't wrap his head around it. Since you ask about the...
You can use $\{0,1\}$ if you want, and this point of view appears in many applications, for example in combinatorics and random graph theory. What is important is that you use the Fourier basis. Sometimes other bases are used. For example, every function $f\colon \{0,1\}^n \to \mathbb{R}$ can be expressed in the for...
We have this algorithm which is supposed to find max matchings. ``` = ∅; //the matching is initialized to zero for ( = {, } ∈ ) { //for each edge in the graph if ( x and y vertices are free) //check if M U e is a matching = ∪ ; } ``` 1. Give an example where this algorithm does...
Max matching algorithm lemma approximation algorithm
|approximation|matching|
null
When working with multiple cameras, epipolar geometry enables you to triangulate points in space, find the position of the cameras in space, calculate the cameras distortion and more stuff addressing cameras. I can recommend to you the book "Multiple View Geometry" by Richard Hartley and Andrew Zisserman for more d...
For the lower bound take a path of three edges $P_3$. If the algorithm considers the middle edge first, it gets a matching of size one, meanwhile the matching consisting of the first and last edges has size two. For the second part, note that the algorithm provided in the question yields an (inclusionwise) maximal m...
If you make the elements stored in the list already contain the next/prev pointers (called an intrinsic or intrusive linked list) than the list doesn't need to do allocations and risk fragmenting memory further just to store 3-pointer sized structs or an array of pointer that needs reshuffling every time you pull out a...
{"OriginalQuestionIds":[151485],"Voters":[{"Id":6759,"DisplayName":"Steven"},{"Id":91753,"DisplayName":"John L."},{"Id":-1,"DisplayName":"Community","BindingReason":{"DuplicateApprovedByAsker":""}}]}
TOTAL is the problem of deciding whether a given Turing machine halts on all inputs. This problem is [$\Sigma_2$-complete](https://en.wikipedia.org/wiki/Arithmetical_hierarchy), and in particular, it is neither r.e. nor co-r.e. Your problem is also $\Sigma_2$-complete. There is a simple reduction from TOTAL to your ...
When working with multiple cameras, epipolar geometry enables you to triangulate points in space, find the position of the cameras in space and more stuff addressing multiple cameras. I can recommend to you the book "Multiple View Geometry" by Richard Hartley and Andrew Zisserman for more detailed understanding. (C...
No, $\{\langle D,M\rangle\mid D\text{ is a DFA }\land M\text{ is a Turing Machine }\land L(D)\subseteq L(M)\}$ is not recursively enumerable. ------ Let $Z=\{0^{n}\mid n\ge0\}$. Call a Turing Machine (TM) $M$ a $Z$-TM if $Z\subseteq L(M)$. **Claim**. $\{\langle M\rangle\mid M\text{ is a } Z\text{-TM}\}$ is not...
This problem appears on the competitive programming contest here: https://szkopul.edu.pl/problemset/problem/NZSCUwz2ACePsBKuVCIVzrRt/site/?key=statement Apparently it's the Polish Olympiad in Informatics 2018. The problem has $n \le 200,000$ vectors, meaning that any brute force solution won't work. I solve...
null
I know this is over a year, but just wondering what you came up with? I'm thinking of using a Queue. I would initialize the queue with the known days and amounts and sum the entries. Then with each new day, I would add it to the queue and add the amount for that day to the sum, and then remove an entry from the queu...
I was curious to see whether or not there was a common algorithm for mapping two unrelated data sets. So for example let's say I wanted to give you a spirit animal based on your name, birthday, zodiac sign, height, and weight. How would someone go about creating an algorithm based on that? Another example is som...
Is there an algorithm for mapping two ambiguous and unrelated data sets?
|algorithms|randomized-algorithms|software-engineering|
Assume that the probability that a woman is above 80 years old is 3 times that of a man. How much information (in bits) do you get if you are given that a 80 year old person is a male? How should I approach such a question? I have learned about entropy and how to measure it but do not see any way to apply this knowl...
Entropy of a single Hint
|probability-theory|entropy|
Let's start with the well-known minimum hitting set problem (known to be NP-hard): given some collection of sets: $U = \{S_1, S_2, S_3\} = \{\{1, 2, 5, 9\}, \{1,2,7\}, \{42, 13, 23, 1, 2\}\}$ for example, we wish to find some minimum cardinality set $H$ composed of elements from the union of all elements of $U$ of such...
Is finding the union of all minimum hitting sets NP-hard?