instruction
stringlengths
35
29.1k
Given numbers $y_1,\ldots,y_n$ and $w_1,\ldots,w_n > 0$, find $y_c$ which minimizes $$ L = \sum_{i=1}^n w_i (y_i - y) $$ under the constraint $|y_i - y| \leq 4w_i$. How to proceed?
A power sequence is a sequence containing consecutive powers of a number starting from power one. for example $3^1, 3^2, 3^3$ is a power sequence. The question is to find the length of the longest power sequence in an array in $O(n)$ time. Note that the sequence is a subsequence of the array. For example, in the array ...
While reading about interrupt mechanism, I understood that there is an IRQ signal line on the bus by which an I/O interface raise an interrupt request. There is an INTA signal line using which the processor indicates acceptance of to the interrupt request.The processor interrupts the program currently under execution, ...
For homework I've to give an algorithm that computes the coefficients of the polynomial $p(x)^n$ in time $O(n\log n)$, where $p(x)$ is a polynomial of degree 7. As an hint I'm told to consider first the case where $n$ is a power of 2. My guess is that I should use FFT and somehow manipulate it with modulo operations (m...
I have a set of $k$ strings of $n$ length each. I need an algorithmic strategy that finds the LCP (Longest Common Prefix) of each set's string pair. In addition, I need time complexity $O(k*n+a)$, where $a$ must be the sum of all LCPs. Any tip/paper/help will be much appreciated.
I'm not very sure how exactly a fractal number is stored nor how random function works in mordern programming languages. But I am curious, will random function ever hits a hard coded decimal number? I know mathematically it is impossible, but how about in computer science? Such as the following javascript code, will it...
Given n disks in the plane, i want to compute the lowest point in their intersection area, im looking for a simple randomized incremental algorithm. There are some circles in the plane, these circles have an intersection R, the point with the lowest y in R is what i mean. Why i thought of RIC is that maybe we can add ...
If we've got this expression: FGa where F and G are functions (as well as a, of course; but let's treat a as a constant). It must be understood that: first apply F taking G as input; then apply the previous result with a as input. This is FGa = (FG)a conventionally expressed: ( F(G) )( a ) Or is it this instead: ...
I know how to prove longest-path problem by reducing Hamiltonian Path problem. Here I want to prove NP-hardness of a Hamiltonion Path problem by reducing longest-path problem. (pretend we know longest-path problem is NP-hardness, not Hamiltonion Path problem) I'm wondering if it is possible to reduce Hamiltonian Path p...
What is a trace bit in Processor Status register, I can't find any resource that describe about how it work, for now all I could find is that it take two bits 0,1 for Trace on/Trace off mode. Can anyone help me understand it in detail?
How many languages can a Regular Expression describe is it only one or infinite? I have tried to google it but i haven't found any answer? I know that a Regular Expression describes a Regular Language?
I'd like to create a NFA that accepts only inputs like "aaaaa";"a";"bb";"bbb", but not like "aab";"aabaa". Is the even possible? As far as I understand NFA is processing a superspositon of all sub-inputs. So then, if given automaton accepts "a" or "b", it would always accept "ab" just like it accepts "b". Is there a wa...
Why is there no algebraic definition of algorithm besides recursive functions? If I'm wrong, what is the matheist definition of algorithm that you've ever seen in a paper and can you provide a link? For example, modern machines do overflowed arithmetic by the rules of modulo $2^{32}, 2^{64}$, etc arithmetic. So why is ...
I'm on second year IT studies. I can't do this on my own and my teacher is not eager to help. I went that way but I'm pretty sure it's wrong. Please, help :/
If $L$ is some language and $\{ww^R \mid w \in L\}$ is a regular language then does $L$ have to be a regular language?
Given a non-associative, direct-mapped cache and its cache capacity, block size, and address size, how would I go about determining what bits of the address are used to access to cache? Is there a generalized formula? If there is a generalized formula, how would that formula change or stay the same for an X-way set ass...
In a network flow graph, using the Ford–Fulkerson algorithm, we can find a residual graph G_f which no augmenting paths. This gives us a way of finding one minimum cut (a cut (S, T) with minimum capacity) where S is the set of vertices reachable from the source vertex s in G_f (and it is clear that this set of vertices...
I am given a input string $s$ ("bedbathandbeyond") and a set of words {"bed", "bath", "beyond", "bat", "hand", "and"}. I need to divide the input string $s$ into a series of words in the dictionary. In this case, the two allowed outputs would be ["bed", "bath", "and", "beyond"] and ["bed", "bat", "hand", "beyond"]. Bot...
I took programming lecture it was about C/java and how to build compilers, so I wanted to know. As far I see, languages like Java/C# are developing their virtual machine CLR/JVM with good base and are improving repeatedly to increse its speed and their JIT compiler. So I was wondering, is it possible in near future tha...
From Wikipedia, "Complexity classes are sets of related computational problems. They are defined in terms of the computational difficulty of solving the problems contained within them with respect to particular computational resources like time or memory. More formally, the definition of a complexity class consists of ...
Partition problem: given a non-empty finite set $P = \{p_i : i ∈ I = \{1,\dots,m\}\}$ of $m$ positive integers such that $\sum_{i=1}^m p_i = 2T$, can $I$ be partition into two disjoint subsets $I_1, I_2$ such that $\sum_{ i \in I _ 1} p_i = \sum_{ i \in I _ 2} p_i = T$? My question is: when we deriving reduction from P...
I'm working on a case and I need some help :) I need to find number of ways and solutions itself to express N as the sum of given numbers. So, Sum (N) = 600 and the numbers from which I need to get the sum are: 50, 75, 100, 150, 200, 250. I want to find all different ways (number of ways and solutions) to express 600 a...
Given this pseudo-code that finds the number of distinct elements in the given array: D(A) // A is an array of numbers U_Size = 1 For i=2 to length(A) U=? For j=1 to U_Size If A[j]=A[i] Then U = FALSE j = U_Size if U = TRUE Then U_Size = U_Size +1 A[U_Size] = A[i] ...
Consider the following random walk: Namely, if $S_i$ is the state at time $i$, then $\Pr(S_{i+1}=1|S_i=0)=1$, and for every $s>0$ we have $$S_{i+1}|S_i=s= \begin{cases} s+1 & \text{w.p. }1-p\\ s-1 & \text{w.p. }p \end{cases}. $$ In my application, $p>\frac{1}{2}$. I'm interested in two quantities, $\Pr(S_T > H)$ and $...
I thought I understood BCFN until I bumped into this example from my course slides. A relation in a library database contains what books are currently borrowed by what users. The relation contains the unique ID of the user, their name and the title of the book. Different users might share the same name. A book can onl...
I'm having trouble identifying a problem in this pipelined datapath. After executing an add instruction, there are 5 subsequent R-type instructions executed. However, we are assuming no data hazard, so no data dependencies that are relevant. That confuses me because that takes out the main issue with executing multipl...
On my compilation theory exam we had the following problem: Construct a PDA translator (just one stack) such that it translates the language $$ a^{m+n}b^n \rightarrow x^{2m+2}y^{3n}, \text{ where } n,m \geq 0$$ I cant think of any solution. My approach was as follows: I would put in the stack $m+n$ symbols of $a$. The...
How to prove that the dual of the dual of a connected planar graph $G$ is isomorphic to $G$? In the post linked above, the user "plop" gives a great response where they claim, in particular, that a plane graph $G$ has a well-defined geometric dual. Paraphrasing, for any two drawings $G^*_1$ and $G^*_2$ obtained in the ...
I need to prove that the following language is not regular by showing there are infinite pairwise distinct equivalence classes: $$ L = \{a^{n^3} \mid n \geq 1\} \subseteq \{a\}^* $$ Looking at a few examples, I intuitively noticed that for each $i \geq 1$ there is an equivalence class $[a^{i^3}] \neq [a^{j^3}]$ for ...
I know that the depth of a circuit is the maximal length from an input gate to the output gate of the circuit and its size is its number of gates. Is there a formula that you can go from depth to size and can someone explain the steps?
Recently we had a quiz where one of the question were - Q: Asymptotic notation for polynomial : - 2^Ο(n) - Ο(n log n) - n^Ο(1) - None of these I know that Polynomial time complexity is $\mathcal{O}(n^c)$, where $c$ is an arbitrary constant. But then I checked it up on Wikipedia, and it got me confused. Accordin...
I'm not entirely sure what to call this, or if there are good reductions to other known problems, so references to those will help. As input you're given an array $A$ of length $n$ of distinct elements, and another array $B$ of length $k < n$ that contains a subset of the elements in the first array, potentially in a n...
Draw DFA for the language of all strings starting with $a$ and ending with $b$. Now what I have done is Here I used q3 as a trap. But could I do this instead? I have not used trap in the 2nd solution and used a self loop instead.
Does anyone have a list of problems where you have to combine dynamic programming with probability?
I have been given a linked list in Python. At some point, one of the nodes is linked to a previous node creating a "tail" and a "loop": Node1 -> Node2 -> Node3 -> Node4 -> Node5 -> Node6 -> Node3 Node1 and Node2 are considered elements of the "tail", while Node3, 4, 5 and 6 are considered elements of the "loop". My tas...
I am solving a CVRP (Constrained Vehicle Routing Problem) on a connected graph, that is not necessarily complete. Edge weights represent Euclidean distances. I know that, in general, the complexity of the problem in terms of the number of variables (and computational time) increases with the number of edges in the grap...
I'm reading an unfinished Introduction to Category Theory/Products and Coproducts of Sets and have come across the following: A power set of a set is the set of all its subsets. A script 'P' is used for the power set. Note that the empty set and the set itself are members of the power set. \begin{equation}\mathcal{P}\...
I have a doubt about loading kernel for every user using a Multi-User system. Every user's processes and programs are scheduled to CPU in a time-sharing fashion. But, do every user on the multi-user system have their individual kernel loaded in the main memory, or is there only one kernel loaded which is sort of distri...
I am working on a pumping lemma question and trying to prove that the following is not context-free, but I can't finish the proof. The language is $$L = \{ a^n b^m \mid n \leq m^2 \}$$ Assume Demon picks $p$ and I choose $s = a^{p^2}b^p$ and $s = uvwxy$ such that $p \geq |vwx|$. The first case is $vwx = b^j$. If we ch...
Summary I am using a DAG to compress a tree structure with many repeated nodes (the repeated nodes only very seldomly do not also have repeated edges out.) Normally, when attempting to add an edge to a DAG that would cause a cycle, you instead detect the situation and abort. I'm seeking an algorithm that will instead ...
I'm already guessing that the answer is no because we cannot know whether there is a class "in between" already known classes? Or can we? I am very new to complexity theory. Thanks for any answer in advance! EDIT: Now that I think about it again, what I am asking is if SAT was in P, could we show that SAT could not be ...
I need help with this problem: Let say that G has a perfect elimination order, than I have to prove that G is perfect. Can someone help me with that? I've tried to solve it with induction but I did not succeed..
Background: a set of 300 images are prepared, randomly pair compared with 60 other images, assigned a rating (from 1-star to 5-star) based on the pair comparison score (+1 if wins a pair comparison and +0 if loses a pair comparison), the score range for the rating assignment is 0-11 for 1-star, 12-23 for 2-star, 24-36 ...
Peter (P), Mary (M), Otto (O) and Dicky (D) would like to rent an apartment house. The house has three floors: G/F, 1/F, 2/F. Every floor has only one apartment. P, M, O and D must be assigned to exactly one floor. Note that more than one person can live in the same apartment. Consider the following constraints. P an...
Let $p$ be a Fermat prime ($p=2^m+1$) and $n=p2^k$ and $a∈Z^*_n$, I should suggest an algorithm that will find $\operatorname{ord}(a)$ in polynomial time (that is, in time polynomial in $\log n$). I showed that if $n$ is the above then $φ(n)$ is power of 2. For example: let $m=k=2$ so $n=5\cdot4=20$ and $φ(20) = |{1, 3...
The question is motivated by this post on StackOverflow. Given an integer $n$ and a finite list of distinct positive integers $ds$, let $f(n, ds)$ denote the number of ways $n$ can be expressed as a sum of elements of $ds$ up to order. Sometimes $f(n, ds)$ is referred to as the number of ways to make change of $n$ in t...
I understand that computer memory in typical modern computing systems (such as the laptop I am asking this question from) is generally involatile but in some exceptions, such as RAM, the memory is indeed volatile. Is RAM always volatile? Isn't there any "exceptional" kind of involatile RAM by humans somewhere?
How can I find the minimal spanning tree of graph with edge values from 1 to 5 integers (no need to be unique) most effectively? I know I can use Kruskal algorithm, but how can I modify the algorithm to find it faster when I know there are edges with values only 1, 2, 3, 4 or 5? I cant figure it out how it could be fas...
I know that the reduction relation is not symmetric. Writing formal proofs is the main core of the course I take on Theory of Computation. So I'm trying to prove that theorem. For that I need to show two languages $L_{1},L_{2}$ so $L_{1}\leq L_{2}$ and $L_{2}\not\leq L_{1}$. My textbook suggests to use $L_{1}\triangleq...
I am using the following definition of the Global Minimum Cut problem: Given a graph $G = (V,E)$, a Cut of $G$ is a partition of $V$ into two subsets $(A,B)$. A cut-edge of $C$ is an edge $(u,v) \in E$, with $u \in A$ and $v \in B$. A Global Minimum Cut of $G$ is a Cut which is the Minimum in some metric. For my purpos...
I know deadlock occurs when Process A has resource R1 and is waiting for resource R2, while process B has resource R2 and is waiting for resource R1, however why don't both processes just let go of the resource they are currently owning before/while waiting for the other resource? How does A keep holding on to R1 even ...
The question was asked Construct an NFA with set of all strings that start with $10$. The solution provided to me is But my question is what if the automaton receives an input $0$ at the starting? Also there is no option for $q_1$ to transit after receiving $1$. So I think the solution should be Please correct me i...
So the Remez algorithm is an algorithm for finding optimal polynomial approximations or at the very least for converging towards them. To find an approximation of $f$ by an $N$th degree polynomial the algorithm samples $N+2$ points and solves a particular system of equations using those points to create a first approxi...
I have a collection of sets $A_i \subset \mathbb{Z}$ where I want to find the global maximum after combining the sets using sumset. The sumset is $$ A + B = \{ a + b : a \in A , b \in B \} $$ and $R$ is the combination of each set $A_i$ $$ R = \sum A_i $$ Then with some function $f : \mathbb{Z} \rightarrow \mathbb R$, ...
I'm trying to understand a poly-time reduction proof from dominating set to vertex cover. If I'm understanding correctly, it goes something like this: suppose we have a vertex cover of size $k$ in graph $G$. Then we construct a new graph $G^\prime$ with the same vertices and edges, except for every edge $(u,v)$ we add ...
How do you make a TM that accepts the following language? $$ \{ a^{n^2} \mid n \ge 0 \} $$
I'm trying to make a context-free grammar for $L=\{a^ib^ic^id^{3i}\mid i>0\}$. I could make a grammar for $a^ib^jc^jd^{3i}$. But I can't make the grammar for the special case that $i=j$ as it is in $L$.
Regarding this question: You are given an unsorted array $A$ of $n$ integers in the range $2^n −10n \leq A[i] \leq 2^n$. Suggest a data structure that allows to answer in $O(1)$ steps the number of keys in the range $a$ to $b$ (note that $a, b$ are not necessarily integers). The construction of data structure should c...
I was doing exercises regarding the halting problem and there is this question where I am stuck Ques: it goes like suppose if you can decide the halting problem with a query "Is <tm,s> belongs to HALT?" (tm = turning machine and s = string) so it can solve i number of instances <tm1,s1> <tm2,s2> <tm(i),s3(i)> now it sa...
How do I compute the edit distance between two words in which substitution is not allowed? The allowed operations include insertion (with cost 1) and deletion (with cost 1), but not substitution. How is this supposed to be computed without substitution?
Given an array with size of $n$ and except from $\sqrt{n}$ ( lower value ) elements in the array, all of the other elements are integers between the bounds of [$\sqrt{n}$, $n$$\sqrt{n}$] I will need to write an algorithm that sorts that array in $\Theta$($n$) Furthermore, will the same mission could be performed if, no...
How to design a Turing machine for a context-free grammar? what are the steps? for example, What are the steps to design a Turing machine for the following grammar with alphabet $\{a,b\}$. $S\rightarrow aX\mid b$ $X\rightarrow bS\mid aX\mid \varepsilon$ This is what I come so far for the above example, in the link, a...
I have this brute-force algorithm to solve the problem: Generate all possible partitions of P into two subsets of P1 and P2 For each partition P1, P2 generated in Step 1, compute the cost of the partition Report the partition with the lowest cost found in Step 2. How can I analyze the number of possible partitions...
I'm learning the initialization methods for Lloyd's algorithm. And I have a hard thing finding examples where Kmeans++ works better than Gonzalez and where the reverse is true so Gonzalez works better than Kmeans++. Does anyone have an example input (Pointset and value k) for these two scenarios?
Assume we want to use quicksort on some array $s$ with length $n$ consisting of only $n$ distinct elements. Let $S_{(1)},S_{(2)},\dots,S_{(n)}$ be the sorted order of the elements in $S$. Furthermore, let $d(i)$ be the number of elements that $S_{(i)}$ is compared to. Finally, the pivot element is chosen uniformly at r...
$f:\mathbb{N} \to \mathbb{N}$ is in $\mathcal{O}(0)$ only if $f(n) \neq 0$ for a finite number of values of $n$. Therefore, $\mathcal{O}(0) \subset \mathcal{O}(1)$ strictly. Is there something in between, i.e. a function $t:\mathbb{N} \to \mathbb{N}$ with $\mathcal{O}(0) \subset \mathcal{O}(t) \subset \mathcal{O}(1)$?
$L=\{uvw \mid u,v,w \in\{0,1\}^*,|u|=|v|=|w| \wedge u\neq w\} $ Any help would be appreciated.
I'm working on a textbook problem, 7.36 in Sipser 3rd edition. It claims that if we are given an integer $N$ and set of pairs $(s_i, q_i)$, where $s_i$ are binary strings and $q_i$ are states (we are unconcerned here with whether the states are accepting), then the problem of "deciding whether there exists some $N$-sta...
Are the definitions of loop in CS and in programming (standard/common) identical? If not, what is the main difference / what are the main differences?
I'm implementing a stable integer sorting algorithm, I've chosen radix sort. I've tested LSD vs MSD implementation, wrote MSD/LSD hybrid implementation to reduce bandwidth pressure. The repo is here: https://github.com/KirillLykov/int-sort-bmk Now some Figures to discuss. First of all, radix sorts outperform significan...
In the literature, when reading about zero knowledge proofs, the prover (prover/verifier) is always given an unlimited computational power or just capacity to solve NP. Is it necessary for the prover to have higher computational power than the verifier? If it is, is there any variant that does not need this property? I...
Show the language $$L = \{xy \mid |x| = |y|, x\neq y\}$$ is not linear. I've seen and proved a pumping lemma for linear languages, mentioned here: If $L$ is linear then there exists a constant $p$ such that for all $w \in L$ with $|w| \ge p$ there is a decomposition $w = uvxyz$ such that: $|uvyz| \leq p$. $|vy| > 0...
I'm reading the overview book of the Intel QuickPath Interconnect and it says there: The physical connectivity of each interconnect link is made up of twenty differential signal pairs plus a differential forwarded clock. I can't find what is a forwarded clock, does anyone know what it is and if there is some material...
I'm writing a simple scheme inspired interpreter. I'm not calling it a scheme implementation because I don't really want to implement all the standard, only the minimal set of primitives needed to keep evolving it from it self. I have two primitives lambda and lazy, lazy is a lazy version of lambda in the sense that it...
I have a list of elements, each with an id and a weight. A: The weight should be directly proportional to the probability of being randomly selected: An element with weight 10 should be twice as likely to be selected as an element with weight 5. B: I need to add/remove elements and increase/decrease their weight dynami...
Given a range [l, r], we are supposed to find the median of all the nodes that are present in the binary search tree and whose values are within l and r. Let me take an example. Let the BST be the following 7 / \ 3 12 / \ / \ 2 5 10 15 and let the range be [1, 14]. Now we see that the nodes w...
Write protected input turing machine is a single-tape TM that cannot write on the input portion of the tape. I almost prove that these TMs can only recognize regular languages but i have a problem in one of my steps. In one step of proof i define a characteristic function $f_w$ such that for any $q \in Q, f_w(q)=q’$ i...
Let $G=(V,E)$ be a graph. For $C\subseteq V$ let $G[C]$ be the subgraph of $G$ induced by $C$. A split Graph is defined as follow: $G$ is a split graph if there exists a subset $C\subseteq V$ so that $G[C]$ is a clique and $G[V\setminus C]$ is an independant set (edges between $C$ and $V\setminus C$ do not matter). T...
Is there any graph with $\Theta(2^n)$ minimum $(s, t)$-cuts? Given an undirected graph $G = (V, E)$ and two distinct vertices $s$ and $t$ of $G$. A minimum $(s, t)$-cut is a $(S, T)$ cut of G which has the minimum cost over ALL cuts of G, and which also satisfies the additional requirement that $s \in S$ and $t \in T$....
If I had a process, 1, which has the following segments: Segment 1 - 50 bytes Segment 2 - 200 bytes Segment 3 - 90 bytes and I know that the total bytes in memory is 1024, how do I work out the offset/base/limit and the frame size for each segment that needs to be placed in physical memory? Thank you for the help in ad...
Consider the number of times that 'statement' runs in the following examples. I am confused as to the applications of floors and ceilings when calculating the loop complexity. for (int i = 1; i < m; i += a) { statement; } In this example, I count the loop by establishing a bijection between the loop iteration and t...
Luca Trevisan wrote, " The oracle $C$ tells us that we cannot have a relativizing proof that derives the $ ⊈ /$ conclusion from the $ ≠$ assumption, so a theorem such as Karp-Lipton, which derives (via relativizing arguments) the $ ⊈ /$ conclusion from a stronger assumption, is about as much as we can hope to prove usi...
In my introductory algorithms class I recently learned about the Cut Lemma and how it can be used to prove correctness for many Minimum Spanning Tree algorithms like Kruskal's and Prim's. In class, to simplify these proofs-of-correctness, we assumed that all edge weights in the graphs we were considering were distinct....
Consider the following 3 strings: 1tb hdd 256gb ssd hdd 256gb 1tb hdd If you know, that all of these strings are part of a product title, specifically part of the title of a Laptop product, a human can easily read these out, and understand that the specific laptop for which the respective string is part of has either h...
Is there a (weakly) universal hash function for strings without any assumption of the string length? I did not find one on Google / Wikipedia.
Propose and prove an $\epsilon$-test for the following property in the dense graph model: $G=(V,E)$ is a complete multipartite graph. That is, there exists a partition $V=V_1\cup\ldots\cup V_\ell$ such that $uw\in E$ if and only if there are $i\neq j$ such that $u\in V_i$ and $w\in V_j$. I have been stuck at trying t...
I am trying to prove that for every $k > 1$, there exists a language $A_k \subseteq \{0, 1\}^*$ such that a DFA accepting $A_k$ has $k$ states but no less. I thought about proving this in two ways: constructively, or by contradiction. By Contradiction: For some $k > 1$, suppose there is no language $A_k \subseteq \{0, ...
I am wondering if Hash tables would be a good choice as it mentions dynamic sets to store data which follows normal distribution. I have doubt in this because normal distribution has bell shaped curve which means elements near the median are more than others. So, If I use hash table then that would lead to clustering. ...
I was reading the HOList paper that applies Graph Neural Networks (GNNs) to the HOL Light (HOList) data set and benchmark for ML for theorem proving. They describe their results etc but there is no code I can find or even pseudocde (algorithmic description) of how to transform an AST -> ABT. How does one do this? This ...
How can you prove that $L=\{a^n b^{2n} \}$ is not regular without the use of pumping lemma?
from Wagner–Fischer_algorithm: I understand substitution cost needs to be adjusted, either 0 or 1: for j from 1 to n: for i from 1 to m: if s[i] = t[j]: substitutionCost := 0 else: substitutionCost := 1 d[i, j] := minimum(d[i-1, j] + 1, // ...
Suppose an algorithm is $O(n!)$, but we need to run it $n$ times, so the total complexity is $nO(n!) = O(n \cdot n!) = O((n+1)! - n!) = O((n+1)!)$ Strictly, there is no constant factor that would make $n!$ greater than $(n+1)$, but it seems pointless to indicate that there is a constant shift. Is it ok to write $O((n+c...
I'm trying to design a turing machine that given a number in base 10 multiplies it by 2. The problem seems trivial if the number is represented in binary so what I've thought is try to convert it from base 10 to base 2, multiply it by 2 and convert it again. But I'm not quite sure if I'm taking the wrong path or not. M...
This might not be a computer science specific question and apologies if that is the case but it does come from material related to working out access control lists and I cannot understand the notation and I wonder if someone could break it down for me? $$A’[s_i,o_j]=A[s_i,o_j] \; ∀(s_i,o_j)≄(s,o)$$ I understand that $A...
I've been writing kinds using asterisk * as a placeholder for a type. For example → * is the kind of all functions of time. This was fine until I needed to use the free monoid operator *. I was thinking that I could write the free monoid as ٭ (the arabic five pointed star), but maybe there's a better option. What's a ...
Let $M$ be a Turing Machine for SAT. We want to encode certain paths of $M$ in a very short way in order to diagonalize against the paths. For each natural number $k$, we will have a formula $\phi$ of length $n$ that does the following: $\phi$ is satisfiable iff the assignment encodes a run of $M$ on $\phi$ of length $...
One of my friend told me that there is a language $C$ for every two languages $A$ and $B$ s.t $A \leq_{m} C$ and $B \leq_{m} C$ , he simply define two languages $A’=\{0w|w \in A\}$ and $B’=\{1w|w \in B\}$ so $C=A’ \cup B’$ and he define the function $f(w)=0w$ if $w \in A$ and and $f(w)=1w$ otherwise. I suspect this fun...
I have been looking around and i cant seem to find an example of such case that a non-regular $L$ has a non regular $L^*$. Is it possible? If so, can you provide an example of such case please?
I'm having problems with this. Can someone help me please. Find the language generated by this grammar over the alphabet $\{0,1\}$: $S\rightarrow BAB\mid CAB$ $BA \rightarrow BC$ $CA \rightarrow AAC$ $CB \rightarrow AAB$ $A\rightarrow 0$ $B \rightarrow 1$
For every nondeterministic Turing machine, must there exist an equivalent deterministic one that runs in no more than twice the time? Why or why not? Can anyone explain?