instruction stringlengths 35 29.1k |
|---|
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?
|
I want to know when we enter a command in a shell then how does the computer recognize that command?
Does it match that command with something already stored in files?
|
I'm going through Jeffrey D. Ullman's Introduction to Automata Theory, Languages, and Computations. The author reduces an instance of the membership problem in $L_d$ (diagonalization language) to a membership problem in $L_u$. Those are defined as follow:
$L_d = \{\langle M\rangle \mid \langle M\rangle \notin L(M)\}$
... |
I'm trying to solve for https://projecteuler.net/problem=27, and I have to optimize one part of the implementation from slow() to fast(). Why do they perform so differently? I'm guessing branch predictions, but I don't quite understand how they are different to the optimizer. The code is in javascript.
function primes(... |
Given a spline, what is an efficient way to find (approximately) the least amount (and position) of key-points to approximate the spline with a line strip, so that the largest distance between the line strip and the spline at any given point is <= d.
Here is a visual example. I'm looking to find a computationally effic... |
After a few courses using CLRS, I still have not been able to find a satisfying answer to the title question.
This answer suggests Hoffman trees. But here the greedy choice is the two subtrees with the lowest frequency. I am however not convinced, that it does not exhibit OPS, since the optimal solution to the full p... |
Let denote $\mathbf{x} = \{x_1,x_2,...,x_N \}$ with $x_i \in \Bbb R$ for $i=1,...,N$ and $f(\mathbf{x},n)$ be the $n$-th symmetric sum of the set $\mathbf{x}$
$$
f(\mathbf{x},n) = \sum_{\sigma_1,...,\sigma_n} \left(\prod_{i=1}^n x_{\sigma_i}\right)
$$
with $\sigma_1,...\sigma_n \in \{1,2,...,N \}$ and $\sigma_i \ne \s... |
Context: Suppose I have a matrix $P_k\in\mathbb{R}^{n\times n}$ that evolves in time $k$ according to
$$
P_{k+1} = H_{\sigma(k)}^TP_kH_{\sigma(k)}
$$
where $H_{\sigma(k)}\in\{H_1,\dots,H_L\}$, $H_i\in\mathbb{R}^{n\times n}$ are some given matrices and $\sigma(k)\in\{1,\dots,L\}$ is a scheduling signal. My goal is to ob... |
Consider a graph $G=(V, A, w)$, where each arc $(u,v)\in A$ has a non negative weight $w_{u,v} \in \mathbb{R}^+$, partition $V$ into $U$ and $W$, $W=V-U$ such that $\sum_{(i,j)\in A} w_{i,j}z_{i,j}$ where $z_{i,j} = [[i\in U \land j \in W]]$.
By getting a randomized cut we have a 1/4 approximation:
\begin{align}
\mathb... |
How to show that the following language is undecidable using reduction on the halting problem?
$L: = \{w \in \{0,1\}^* |$ TM $M$ with $w = \langle M \rangle$ does not accept any input $\}$
When TM doesn't accept any input, does it mean that the Turing machine halts or it just rejects any words?
And how to show that thi... |
Let there are $n$ devices in the setup. Let each device sends data with a probability $p$.
Successful transmission for a slot (hence of the setup in general) occurs when only one device communicates.
Hence using the binomial theorem, we have $P_{success}= \binom{n}{1}\times p \times (1-p)^{n-1}$.
Differentiating $P{suc... |
Let $P$ be a poset on $n$ points, $\text{Aut}(P)$ its automorphism group, and $a_1,a_2,\dots,a_k$ the lengths of the orbits under $\text{Aut}(P)$.
Goal: An algorithm to generate a member from each equivalence class (under $\text{Aut}(P)$) of assignments of nonnegative integer weights to the vertices of $P$ such that th... |
I am to use Agda to prove some intuitionistic tautologies. One of them is the so called Weak Peirce's Law
$$
((((A \rightarrow B) \rightarrow A) \rightarrow A) \rightarrow B) \rightarrow B
$$
I understand that there is an "equivalence" between intuitionistic tautologies and programs and their types, that is if I manage... |
The paper I'm working on uses sets as implemented in https://docs.sympy.org/latest/modules/sets.html. A set is stored in a data structure as a sequence of intervals with open or closed bounds, so it can represent uncountable and infinite sets. What prior work can I reference for this data structure?
|
Assume I have a set of $N$ ordered points, $X$. I would like to find the set of $N$ points, $Y$, where the distance between $X$ and $Y$ $(d = \sum_{i=0}^{N-1} |X_i - Y_i| )$ is minimized but there is a minimum distance between points of $M$ $(Y_{i+1} - Y_i > M)$. Is there an algorithm or approach to deriving $Y$ given ... |
Today, in my self-lead studies, I found out about greedy algorithms, more specifically, a greedy approach to solve The Weighted Job Scheduling Problem.
I understand how the solution is implemented but, I'd love to see a proof of correctness for this solution (i.e. partial correctness and termination). If anyone can hel... |
I am unable to understand how Canonical LR(1) grammar is more powerful than LookAhead LR(1). Both have lookahead symbols in their items and works almost similarly, so how can CLR(1) derive a larger set of languages than LALR(1).
|
I have a DFA transition table like
\begin{array}{cc|c|c}
& & 0 & 1 \\ \hline
\to & p & qs & q \\
* & q & r & qr \\
* & qs & r & pqr \\
& r & s & p \\
* & s & t & p \\
... |
I need an $O(|V||E|)$ algorithm to detect if a graph has a minimum spanning tree with diameter 3.
This paper mentions that it is possible for any diameter by finding the vertex 1-center which can be done using Floyd's algorithm, but I need something much simpler only for the case of diameter 3.
|
I am wondering if every problem with an output's size that grows polynomialy is $\textsf{NP}$?
My thinking is every $\textsf{NP}$ problems can be solved in polynomial time by a non-deterministic Turing machine. (Wikipedia)
Moreover, consider a non-deterministic algorithm, that takes in input an integer $n$ and an integ... |
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. I get the general mechanisms of how interrupts are handled in computer systems, but the results of interrupts improving the efficiency of user programs with many I/O programs is kinda counter intuitive. As from what I k... |
We have an algorithm problem in hand, can you please write your ideas about this, thank you!
There are N many nodes with K different colors. Some of the nodes have direct connection between each other and some do not.
We want to select M nodes from these N total nodes, but these M nodes must be connected. Also, our sel... |
Consider the standard assignment problem: $n$ people are assigned to $n$ jobs (one person to one job) so to minimize the sum of costs. When the costs are generated randomly (using the exponential (1) distribution), it is known that the expected sum of costs is $\pi^2/6$ .
An alternative solution to the assignment probl... |
I have trouble understanding DAG behind the "contiguous subsequence of maximum sum problem". Let's say I denote by S(i) maximum of sums of contiguous subsequences ending in i. So S(i) are my subproblems. To calculate S(i) I need S(i-1) so the edge will be between node i and i-1. Denoting the sequence by a_i, I think my... |
Given this sort of dataset:
ID
Score1
P1
Flag
id1
0.01
0.2
False
id2
0.99
0.9
True
...
...
...
...
The limitations of each variable are:
ID: identifier if each object, unique in the table
Score1: A number between 0 and 1, that represent the value of the object
P1: probability of call, betwen 0 and 1
Fl... |
New to proofs (in the context of analysis of algorithms).
I'm wondering, if I were to prove a greedy algorithm is the optimal solution, does this imply its correctness as well? (partial correctness + termination).
I'm trying to understand how The Job Sequencing Problem is correct but can only find proofs for its optima... |
Background
Let L = {aa}. We know that the minimum pumping length of L is |aa| + 1 = 3. For this length all the three conditions of the pumping lemma vacuously hold true.
Doubt
Let L = {aa, aab}. Is it right to say the minimum pumping length is max(|w| | w belongs to L) + 1(in this case |aab| + 1 = 4) for finite languag... |
At page 21 of this book: https://cs.au.dk/~amoeller/spa/spa.pdf I found this:
I started reading everything and understanding it pretty well, until this.
It's defining the possible types of a language. I'm very confused about what theta and alpha mean. What are those meta-variables? What is ua.t and t[ua.t/a]?
Could so... |
The context: I have been working lately with problems like the following: Let $x_{k}\in\mathbb{R}^n$ be a state evolving accroding to:
$$ x_{k+1} = f(x_k,u_k) $$
where $k \in \{ 0,\dots,N-1 \} $, given some $x_0$ and controls $u_0,\dots,u_{N-1} \in \{1,\dots,L\}$, i.e., the set of possible controls is a finite set of "... |
Consider the standard assignment problem: $n$ people are assigned to n jobs (one person to one job) so to minimize the sum of costs. When the costs are generated randomly (using the exponential (1) distribution), it is known that the expected sum of costs is $\pi^2/6$.
An alternative solution to the assignment problem ... |
Let $\Sigma=\{0,1\}$ and $L$ be a regular language. Prove that
$$Z(L) = \{x \in \Sigma^* : \exists w \in \Sigma^* \ xww \in L \}$$
is a regular language.
I tried to build a NFA based on the DFA that accepts $L$ but failed to do so. I don't know how to ensure the $\, ww \,$ part. Please advise.
|
I am learning computer architecture and organization. I have the following doubt. Given below is a question along with its solution as seen in number 5 of some homework assignment solutions. But I think that solution is wrong.
Consider an instruction pipeline for the MIPS32 processor where data
references constitute 4... |
I am thinking about the following case where the data in region 1 is always positive and the data in region 2 is always negative, but the data in region 3 can be both positive and negative. Are there any existing results on finding exactly the $l_1$ and $l_2$ (or region 3)?
As far as my understanding of SVM when the d... |
According to Actor-Critic algorithm, $\psi_{\theta}=\nabla_{\theta}\ln \mu_{\theta}(s, a)$ where $\mu_{\theta}(s, a)$ is the policy followed by the actor and $\psi_\theta$ is the compatibile features space.
The updates for the actor and critic parameters are as follows:
For critic with the parameter w:
$w_{t+1} = w_t ... |
I have just started learning regular expressions and I don't have anybody around me to help me building conceptions. So I rely on online mediums. My question is whether every regular set corresponds a language.
I had a regular expression $(0+10^*)$ and I was trying to find the regular sets. My books suggests that $L=\... |
Given the language $L:= { \{ c^{2k} w \ \vert \ k \ge 1, \ w \in \{a,b,c\}^* \ and \ \vert w\vert_a \ = \ \vert w\vert_b \} \ \cup \ \{ a,b \}^* }$
I'm really unsure how to even start because of the union.
I tried it with $w=a^nb^n$ but my correction said that it's
pumpable because it is in $\{ a,b \}^*$ which makes ... |
When we do union by rank we merge the smaller tree into the larger tree. I dont understand why we do this exactly?
|
I have the following definition:
A green-blue tree is a binary tree that follows the following properties:
Each green node has only blue descendants.
Every path that goes from a node to a leaf has the same number of blue nodes.
This is an example of a green-blue tree:
For the first part, we can ensure that every nod... |
Design a regular expression for the language accepting the strings containing at most one pair of $1$'s over $\{0,1\}$
So basically we have the language $L=\{11,011,110,0011,1100\ldots\}$.
I find the expression to be $R=(0+1)^*11(0+1)^*$.
But I found here the answer to be $R=(0 + 10)^*(11 + \epsilon)(0 + 10)^*$.
I ca... |
Language $L$ is trivial if $L=\varnothing$ or $L=\Sigma^*$. I'm trying to prove the following theorem:
If $L_1\in R$ and $L_2$ is non-trivial language then $L_1\leq L_2$.
If $L_2$ is non-trivial the $L_2\neq\varnothing$ and $L_2\neq\Sigma^*$. If I want to prove that $L_1\leq L_2$, then I need to show that there exis... |
I have the following two languages:
$$
L_{U}\triangleq\left\{ \langle M,x\rangle\,:\,M\text{ accepts }x\right\} ,L_{D}\triangleq\left\{ \langle M\rangle\,:\,M\text{ accepts }\langle M\rangle\right\}
$$
I'm trying to prove that $L_{D}\leq L_{U}$. For that I need to show that there exists $f\,:\,\Sigma^{*}\to\Sigma^{*}$... |
Today i wrote something about the bijection between turing machines and recursive functions. And i describe a Turing Machine as a Well-formed formula because it seems like a WFF to me.
But is it correct when we say that a Turing Machine is a WFF ?
|
Good morning everyone. I am working with Python and Pandas.
I have two DataFrames, of the following type:
df_C = pd.DataFrame(data=[[-3,-1,-1], [5,3,3], [3,3,1], [-1,-1,-3], [-3,-1,-1], [2,3,1], [1,1,1]], columns=['C1','C2','C3'])
C1 C2 C3
0 -3 -1 -1
1 5 3 3
2 3 3 1
3 -1 -1 -3
4 -3 -1 -1
5 ... |
I have the following exercise I have been staring at for several hours to no avail.
Question:
Testing the monotonicity of a function - the case of bits: Given a function $f: [n] \rightarrow \{0,1\}$ and a parameter $0 < \epsilon < 1$, show an algorithm that runs in $O(\frac{1}{poly(\epsilon)})$ queries to $f$, with the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.