instruction stringlengths 35 29.1k |
|---|
I have the following function:
$\displaystyle\frac{n \cdot 7^n+\frac{8}{n!}}{(n+7) \cdot 7^n}=\Theta(1)$
I don't how they come to this. What is the proper way to analyse a function to theta notation?
|
Here is a question i came across :
Given two arrays, write a function to compute their intersection.Here we will allow the duplicates.
Note:
Each element in the result should appear as many times as it shows in both arrays.
The result can be in any order.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2] ---> ... |
Suppose I have an undirected graph with four vertices $a,b,c,d$ which are connected as in a simple path from $a$ to $d$, i.e. the edge set $\{(a,b), (b,c), (c,d)\}$. Then I have seen the following proposed as a greedy algorithm to find a maximal matching here (page 2, middle of the page)
Maximal Matching (G, V, E):
M =... |
Prove that the language consisting of all valid regular expressions is not regular.
I am approaching this using the Myhill-Nerode Theorem as follows:
I am trying to find a pairwise distinguishable set. I feel that the proof will have to do largely with bracket expansions leading to an invalid string.
So I thought I wo... |
Is there any language, which can be used to define all programming problems perfectly?
By perfectly, I mean with these two properties:
p is the problem.
d is the definition in the language.
P(d, p): "d is the definition of the problem p"
$$
\forall p\exists d(P(d, p))
$$
$$
\forall p\exists d1,d2((P(d1, p) \land P(d2... |
I am looking for a term:
How is the tree called that you can obtain from a DAG by going top-down and appending all visited nodes to a tree, thereby copying nodes from the DAG into multiple occurences in the tree?
The resulting tree will contain all edges and nodes from the original DAG and a number of nodes multiple ti... |
Is there any way at all possible or possible with hardware (aside from a NAS) to access hard drives while the computer is in a low power mode such as sleep (aside from WOL)?
For example, can I log into a networked drive located on the computer and spin it up to access data without the computer coming out of low power m... |
The question is the following:
3. Given a hypothetical microprocessor which generates a 16-bit address (assume that the program counter and address registers are 16 bits wide) and has a 16 bit data bus.
a) What is the maximum memory address space that the processor can access directly if it connected to a "16-bit memor... |
Let $G=(V,E)$ be a graph, where $|V|=n$,$|E|=m$,$k=m/n$.
We consider the following algorithm:
while (there exists $u ∈ V (G)$ such that $d_G(u) < k$) do
$\quad G ← G − u$;
Prove that the resulting $G$ isn't null.
Implementing the algorithm is easy, but I can't find a way to prove it rigorously.
k doesn't change over ... |
We have an integer $K$ and an array of $N$ positive integers each smaller than $K$. How do we group the numbers into the minimum number of groups where the sum of each group is less than or equal to $K$?
|
I wish to undestand how to proof a function is/is not computable. I found this example online (without solution) beacuse I was thinking was easy to understand, but I am stuck in understanding how to set the proof.
Given $M_n$ the nth Turing Machine produced in output by an enumeration algorithm for Turing Machines. Let... |
I am trying to do the leetcode question
I got the answer and trying to understand a systematical way to come up with the answer using the DP bottom-up approach, and I am having a hard time to understand it, up to m=2.
What would be the best way to visualized or step by step to come up with this answer??
What is non-af... |
So today in our exercise session on complexity theory we discussed that P, NP, and BPP are closed under karp reduction. We also figured that the proofs could likely be expanded to straight generalizations of these three "classes of classes" (nondeterministic, deterministic, probabilistic) like EXPTIME.
This, to us, beg... |
I understand that any assembly programming language has so little abstraction, so that one who programms with it (OS creator, hardware driver creator, "hacker" and so on), would have to know the relevant CPU's architecture pattern very well.
For me, this requirement to know the relevant CPU's architecture pattern very ... |
I am a beginner to predicate logic and BigO and am having though time understanding the definition of BigO in terms of predicate logic in the picture attached. I particularly am unable to understand what is meant by n0 in this context. Any help is greatly appreciated.
|
For example, this gate:
looks like an OR gate, except there's a dot to the right. The dot is reminiscent of the fact that there's a dot in the NOT gate, so I wonder if it has something to do with that. There's no NOT after this gate in the diagram I'm looking at, so this doesn't to be implementing NOT OR or something ... |
I have heard that the complexity class of performing a perfect disassembly of binary is undecidable. Is this correct? Are there any proofs of this?
|
Given two duplicate binary trees (see the embedded picture), you are given a node in Tree A, find the same corresponding node in Tree B.
I believe the optimal approach should be traversing both trees at the same time, and when you reached the node in Tree A, you would know you have also reached the same node in Tree B.... |
The language $L = \{ \text{M} \mid \text{M is a TM and the set of words w such that M halts on w is decidable} \}$ is given.
I need to prove that $L$ is NOT Turing recognizable. I've got a hint: it should be similar to prove to the Rice Theorem, using a reduction. However, this hint isn't very helpful to me.
|
I have an algorithm that constructs an optimal binary tree using dynamic programming. After introducing what I thought would be an optimization, the algorithm became over 2 times slover. Question: Is there an analytical way to determine whether such change will improve the runtime of an algorithm with memoization?
Pyt... |
Would anyone apart from Intel and AMD ever be able to make a processor that can be used on a personal computer, or is it impossible? I believe it is due to them owning the x86 instruction set, which means that a company doesn't have the right to produce a processor which could run a personal computer. But what if the p... |
I was reading the CLRS. In the Hashing Chapter on page 262 a statement says: "For example, if we know that the
keys are random real numbers $k$ independently and uniformly distributed in the range $0 \leq k < 1$, then the hash function $h(k)= \lfloor km \rfloor$."
Question: Does Uniformly distributed meant all numbers ... |
I read that the XOR of basis cycles can generate all the cycles present in the graph.
I was just wondering if there exists any one vertex which is present in all the basis cycles and is present in all the cycles of the graph.
Can someone point me to something that might help me tackle this problem?
|
The question is: Is there a word $w$ on which a TM $M$ halts after a maximum of $|w|$ (word length) steps?
More formerly, is the language below decidable?
$$H=\{\langle M\rangle \mid \text{ TM $M$ halts after a maximum of $|w|$ steps for some word }w \}$$
I highly assume, that this problem is not decidable because in ... |
I am trying to understand what this question is asking in terms of conversion. I know how to convert binary to decimal and vice versa, but the method you need to use has me confused.
I need to convert 010111 to decimal using only odd numbered positions while still applying the correct positional exponent in the convers... |
Will an NPDA accept a string that reaches a final state but does not have all its input consumed yet?
|
i am working with ID3 algorithm, and i know that classic ID3 basically can handle missing data. But i am trying to code this algorithm, so what should i do if there is missing attribute's value in training dataset? How can i classify the data point that has missing attribute's value?
|
As the question says, if I input on the tape of a Turing complete machine a program that solves the halting problem with the correct inputs the program will never end its execution regardless of memory and time. Isn't the halting problem a computational problem that can't be executed by a Turing complete machine so tha... |
I am designing a network for a max flow and would appreciate the following feature:
Say there is a flow incoming to a vertex. I would like to consume some specified amount of that flow and let through the rest. Unlike vertex capacity, which says "let though at most N units of flow", I need to "let through everything bu... |
Theorem. Show that if $L$ is regular, then so is
$$
\varphi(L)=\left\{w \in \Sigma^{*} \mid \text {there exists an } \alpha \in \Sigma^{*} \text { with }|\alpha|=|w| \text { and } \alpha w \in L\right\}
$$
Proof. Let $L$ be a regular language. Because $L$ is regular, there exists a DFA $M$ that accepts it. We constr... |
The generalized assignment problem (GAP) [1] is given by:
Instance: A pair $(B,S)$ where $B$ is a set of $m$ bins (knapsacks) and $S$ is a set of $n$ items. Each bin $j∈B$ has a capacity $c(j)$, and for each item $i$ and bin $j$, we are given a size $s(i, j)$ and a profit $p(i, j)$.
Objective: Find a subset $U ⊆ S$ th... |
As an amateur Bash/JavaScript scripter who never wrote one sentence in Assembly, I ask:
Do compilers of high programming languages always compile them directly to machine code, or are there cases when a compiler of some high programming language compiles it to assembly (and then assembler will assemble input to machine... |
I have heard that we can convert any text to hash code , but hash code can't be converted back to text without brute force.
Suppose we consider the text "mal". The hash codes of the individual letters are
m= 6f8f57715090da2632453988d9a1501b
a= 0cc175b9c0f1b6a831c399e269772661
l= 2db95e8e1a9267b7a1188556b2013b33
Those... |
We know we have a long way to go before we come to a proof of P $\neq$ NP. We also know that this road is studded with minor conjectures that will have to be proved/disproved in order to arrive at the much sought-after truth.
My question is the following: if tomorrow a proof of P $\neq$ NP would appear, what would be a... |
For an undirected connected graph $G=(V,E)$ given as adjacency list I want to find a directed strongly connected graph $G=(V,E')$ where each $e' \in E'$ is either $(u,v)$ or $(v,u)$ if we look at its original $e=\{u,v\}$. Also we're assuming there are no bridges in the given graph G (which I'm checking before hand).
|
I am not sure about the difference between $n^{\Omega(1)}$ and $\Omega(n)$. It seems to me that the only difference is that $n^{\Omega(1)}$ can contain some sublinear functions, i.e., $n^{\frac{1}{2}}$, which is not the case for $\Omega{(n)}$. Is there any other differences between these two notations?
|
Given a graph where some nodes can provide some services with x,y,z... capacities. A node connected to multiple nodes needs to divide these services to the connected nodes and these nodes themselves should further divide this to their connected nodes. when a node receives two services from 2 differnt nodes it is connec... |
The simply typed lambda-calculus with numbers and fix has long been a favorite experimental subject for programming language researchers, since it is the simplest language in which a range of subtle semantic phenomena such as full abstraction arise.
I tried to find a definition for full-abstract model but I haven't ... |
I'm trying to find An efficient algorithm for the following problem:
I have $n$ sets of numbers (different sets might have common numbers) and I need to find union combination of $k$ sets that Will yield the biggest set.
For example: if i have the sets $A1=\{1,3,4\}, A2=\{1,2,4\}, A3=\{5,7\}$ in that case $n=3$ and le... |
Consider a Turing machine with input alphabet $\{a,b\}$ that computes the following function:
$$
f(w, v) =
\begin{cases}
w & \text{if } \operatorname{length}(w) > \operatorname{length}(v), \\
v & \text{otherwise}.
\end{cases}
$$
I wish to use a TM with two tapes, the first of which contains the input string, say encode... |
Three commonly used functions when it comes to bit manipulation are :
is_pow2: Checking that an integer is a power-of-two (only one bit is set): $00010000 \Rightarrow yes$
floor_pow2: Finds the largest integer power of two not greater than the given value $00010010 \Rightarrow 00010000$ (msb on the left, lsb on the r... |
I saw the posted question here about a direct reduction from near-clique to clique.
Clique-or-almost is like near-clique but with the option for a complete clique of size $k$, I mean that perhaps an edge is missing and perhaps not.
I can't figure out how to change the proof in the link to fit to the reduction from Cliq... |
I have heard that a matrix can be modeled as just an one array by declaring increasingly large spaces to be from the second array, and that the least you need for a Turing machine is just a PDA with two stacks. I also know that you can’t simulate a Turing machine with a PDA, because a professor challenged a student whe... |
Does anyone know how to compute node degree distribution in a graph ? I am talking about a large graph for example California road network and imagine we have some data such as number of nodes and number of edges and now we want to visualize data by histogram for distribution of nodes degrees.Is there any specific for... |
So I understand how to do this with there being multiple symbols in each possible production, but when it is singular, it seems to get more complicated, or I am overthinking it? Would the left-most derivations be the exact same as the two different derivation trees for some string x in this case? Both cases lead me to ... |
Assume that $B_b$ denotes the finite set of bitstrings of length $b$, if we are given its subset $A = \{e_i\}, i \in \{0,... n\}$, such that $e_i \in B_b$, what is "the parity sum of As bitstrings" ($parity_A$)?
Is it a single bit $parity_A = parity(concat(parity(e_1), parity(e_2), ..., parity(e_n)))$?
Or is it a bitst... |
Problem 13.5.2 of Pierce's TAPL's book (page 167) asks:
Can you find a context $\Gamma$, a store $\mu$ and two different store typings $\Sigma_1,\Sigma_2$ such that both $\Gamma | \Sigma_1 \vdash \mu$ and $\Gamma | \Sigma_2 \vdash \mu$?
I'm not getting the proposed solution:
But how can this be the case? I mean shou... |
I am trying to understand what is the domain for denotational semantics.
Right now the way I understand denotational semantics is that given some syntax of a program that maps to some mathematical object that represents its meaning. e.g. for example give some arithmetic expression AExp the denotation $[\_]:AExp \to (S... |
In the article at nlab about the relation between type theory and category theory, it is said that "beta reduction" in type theory corresponds to "counit for hom-tensor adjunction" in category theory and also "substitution" corresponds to "composition of classifying morphisms / pullback of display maps" correspondingly... |
A knob is used to select one of three positions A, B, C.
The knob can never be turned from A to C, or from C to A, without spending at least one second in position B. The initial position of the knob can be any of A, B, C.
Give a regular expression for this language.
I tried starting from B, and ended up with:
BB*((AA*... |
In the partition problem, the task is to partition $n$ given integers into two subsets $A$ and $B$ with equal sum. This problem is known to be NP-hard, but it becomes easy if the "equal sum" requirement is replaced with the following:
The difference $|\sum_A - \sum_B|$ should be at most the largest integer in the set ... |
I am trying to find an efficient algorithm to solve to following problem: Given an undirected disconnected graph, I want to add as few as possible edges to make to graph connected while minimizing the number of vertices on the longest path in the resulting connected graph. As a result I need the number of vertices on t... |
I came up with an algorithm to decide this language, but not sure if it is correct?
for every string w over {0,1} of length at most n1 x n2:
if D1 accepts w and D2 rejects w:
REJECT
ACCEPT
Where n1 and n2 are the number of states in $D_1$ and $D_2$.
|
I have a graph with N nodes and M edges. It is a single component.
Now I have to delete a single node from graph, deleting that node might split graph into 1,2 or more components. The count of such components is required for each deleted node. Note that only a single node is deleted at any point of time.
I need to do t... |
A gardener considers aesthetically appealing gardens in which the tops of sequential physical trees (eg palm trees) are always sequentially going up and down, that is:
| |
| | |
| | | | |
On the other hand, the following configurations would be invalid:
|
| |
| | |
reason: 3rd t... |
In my max flow network, I would like to have an edge with upper bound of the flow (a.k.a. edge capacity) $c_{max}$. However, I would also like to add a lower bound for the flow through the edge, $c_{min}$.
I need to be sure that the minimum flow satisfies not only all the upper bounds (capacities), but also all the lo... |
Given a multiset of $2m$ positive numbers, $S=\{s_1,s_2,\ldots,s_{2m}\}$ and given $m$ targets $t_1,t_2,\ldots,t_m$. Can we partition $S$ into $m$ pairs $(a_i,b_i)$ such that $a_i+b_i=t_i$, where $a_i\ne b_i$ and $a_i,b_i\in S$?
For example for $S=\{1,4,6,1,2,5\}$ and $t_1=7$, $t_2=t_3=6$. The answer is YES and the pa... |
If $A\leq_p B$ and $B$ is in $NP$, is it true that $A$ is in $NP$?
What about : "if $A\leq_p B$ and $B$ is in $coNP$, then $A$ is in $coNP$"?
Thanks in advance.
I think both hold. If $B$ is in $NP$, then the yes-instances of $B$ can be verified in polynomial time. If $A \leq_p B$, I can "translate" an instance of $A$ ... |
I am looking for an example such that the union of infinitely many recursive sets is not recursive but recursively enumerable.
I was thinking taking $S_i=\{i\}$ and then taking the union of these with the indexes in the halting set, so that the union is the halting set, which is not recursive, but recursively enumerab... |
I am studying for a test in computer science, and am encountering difficulties with regular expression. Here is example of a question I don't understand.
I managed to solve the following question:
Give a regular expression for the language of all words over $\{a,b\}$ which contains one of $aa,bb$ as a subword.
My so... |
In duplicate subset sum problem (DuSSP), we are given a multiset $\{a_1,a_2,\ldots,a_n\}$ where some of the $a_i$ are duplicates. We can assume that $a_1\leq a_2\leq \cdots\leq a_m.$ We are also given a target $s$. The problem is to find a subset of $\{a_1,a_2,\ldots,a_n\}$ that sum up to $s$.
In distinct subset sum pr... |
I know the basics of using the pumping lemma for CFG to prove a language L is not context-free, however, the # symbol seems to be throwing me off or my understanding is not complete.
|
I have a function defined: $V(j, k)$ where $j, k \in \mathbb{N}$ and $t > 0 \in \mathbb{N}$ and $1 \leq q \leq j - 1$. Note $\mathbb{N}$ includes $0$.
$V(j, k) = \begin{cases} tj & k \leq 2 \\ tk & j \leq 2 \\ tjk + V(q, k/2) + V(j - q, k/2) & j, k > 2\end{cases}$
I am not allowed to use repeated substitution and supp... |
Some definitions and facts (from Wikipedia):
A linear grammar is a context-free grammar that has at most one nonterminal in the right hand side of each of its productions.
the left-linear or left regular grammars, in which all nonterminals in right hand sides are at the left ends;
the right-linear or right regular gra... |
Show that: $\Theta(n\log n)\cup o(n\log n)\neq O(n\log n)$
I tried to start this in many ways but I don't really know how... intuitively isn't $\Theta \cup o = o$? So that would mean that I would have to just show that $o(n \log n) \neq O(n \log n) $ Which would be easier I think. But I don't know how to go about th... |
Show that $0.01n \log n - 2000n+6 = O(n \log n)$.
Starting from the definition:
$O(g(n))=\{f:\mathbb{N}^* \to \mathbb{R}^*_{+} | \exists c \in \mathbb{R}^*_{+}, n_0\in\mathbb{N}^* s. t. f(n) \leq cg(n), \forall n\geq n_0 \}$
For $f(n) = 0.01n \log n - 2000n+6$ and $g(n) = n \log n$
Let $c = 0.01\implies 0.01n \log n ... |
So I know the Oblivious Turing Machines head position depends on the size of the input word and a number of steps. Can it be modified in such a way that it's not dependent on the size of the input word?
|
How do I define a Regular Expression for the language L = {w|every two successive 0s are followed by a 1} ?
I don't have any idea on how to even approach this problem, primarily because it says "every two 0s".
|
If we have n balls in a red box (each ball is assigned a different number from 1 to n) and n balls in a green box (again each ball is assigned a different number from 1 to n). Lets say we have a player that chooses randomly a ball from each box and throws it on the floor. If we can predict exactly the time when a pair ... |
I came across following question:
What are maximum number of configuration of Turing Machine after $n$ moves?
The answer given was:
$k^n$, where $k$ is a branching factor.
And that "branching factor" left me confused. So I gave some thoughts: Given $Q$ be total number of states, $\Gamma$ be a tape alphabet and two ... |
In Sipser's Introduction to the theory of computation (3rd edition), I found the following claim.
Consider the grammar:
$$
\begin{align*}
&R \to XRX \mid S \\
&S \to aTb \mid bTa \\
&T \to XTX \mid X \mid \epsilon \\
&X \to a \mid b
\end{align*}
$$
In this grammar, it holds that $T \Rightarrow^* T$.
Can anyone explain ... |
I'm looking for an algorithm to randomly generate permutations on 1:n, which though have a defined bubblesort distance d from 1:n, e.g. (2,3,1) and (3,1,2) are distance 1 from (1,2,3), (2,3,1) and (3,1,2) are d=2, finally (3,2,1) is d=3.
Naive approach is to flip a random sorted pair d times, however it seems it does n... |
. You have developed an artificial amoeba, and you can control exactly how it divides.
Each individual amoeba can be instructed to divide into A, B, or C amoebas. That
is, if you instruct an amoeba to divide into A, this amoeba will disappear, and A
different new amoeba will appear.
You start out with K amoeba initiall... |
When I input something wrong in my Casio fx-82MS calculator it shows Syntax error on its screen.
So does even a simple calculation on a most simple calculator like this goes through compilation phases? or is it directly the hardware that is doing all the stuff and showing the output or is there some kind of very basic... |
I've been studying dynamic programming lately and came across a problem that is, I believe (might be wrong, though), a modification of the classic longest alternating subsequence (LAS) problem.
But instead of asking you what is the maximum length, this problem asks what is the minimum number of changes you would have t... |
So I understand what a mapping reduction is and how to create them for simpler problems such as a reduction from the set of even numbers to set of odd numbers however, seemingly more complicated questions trip me up such as the following...
A and B are computable languages where B is non trivial give a mapping reductio... |
I would like to find the "optimal" shortest path tree (SPT) in some undirected weighted graph. As "optimal" SPT, I mean so its maximal path from root to leaf is minimal from any other potential SPTs.
It is quite easy to find SPT from 1 root via Dijkstra's algorithm. So I can run Dijkstra from all vertices and find the ... |
An array is built starting with an empty array, and then a sequence of insertions:
insert $a_1$ at index $z_1=1$
insert $a_2$ at index $z_2$
insert $a_3$ at index $z_3$
...
and so on. When we insert element $a_i$ and index $z_i$ the result is that $a_i$ is now at index $z_i$, whereas everything before index $z_i$ is... |
I have the following:
(|$y=0; x=c$|) while(x > 0){y=y+a; x=x-1;} (|$y= a*c$|)
This seems like a fairly simple program and I can intuitively tell that the post condition $y=a*c$ is true when the loop terminates, but I cannot a find a good invariant. Of course, I think I can say the variable $a$ is an invariant, but I d... |
I was reading Database Systems, 6th ed by Ramez Elmasri and Shamkant Navathe. In the textbook they make a claim (in Chapter 15, section 15.2 Properties of Relational Decompositions) which I quote below:
Claim 1. It is always possible to find a dependency-preserving decomposition $D$ with respect to $F$ [$F$ is the set... |
For a language $L$ over an alphabet $\Sigma$, we say that two words $v,w \in \Sigma^*$ are equivalent, denoted $v\sim w$, if for every word $z \in \Sigma^*$, $vz \in L$ iff $wz \in L$. We define $[w]_L$ to be the equivalence class of $w$ under this relation. The index of $L$ is the number of equivalence classes of stri... |
I'm using Knuth's Dancing Links (dlx) algorithm to solve for solutions to tiling a 2xN rectangle using 3 different pieces of one, two, or three squares. It's working correctly in its basic form but now I want to add some additional constraints that limit how the pieces can fit together. I want the solutions to adhere t... |
$\text {Could someone please help me with this proof: }$
$L:=\left\{a^{n} d^{m} b^{k} | n, m, k \in \mathbb{N} \wedge m \text { is a prime number}\right\}$
$\text {Maybe we can say, that } w=a^{n}d^{m_s}b^{k} \text { and } d^{m_s} \text{ is a prime number with } |w| \ge n. \text{And we choose xyz arbitrarily with } w= ... |
Prove that grammar $G$ with productions:
$S \to aSc|\epsilon | bBc$
$B\to bBc | \epsilon$
Generates language $ L = \{a^ib^jc^{(i+j)}$ | $i,j \ge 0 \} $
Step 1. Prove $L(G) \subseteq L$
.
We are inducting on the number of steps in derivation $S \xrightarrow i w$ where $i\ge 1$.
Base case: For $i=1$ is trivial and wor... |
Given:
- List of rectangles (height x width).
- Maximum width and height of result.
Arrange the rectangles, without changing the order of the list, to be as close to a square as possible. The items should go top down, left to right. If all items can't fit within the width and height result, then ignore the max widt... |
Is there a class which is to APX what BPP is to P?
I'm looking for a definition that is like the following:
"For $r > 0$, an $r$-RPCA (randomized polynomial-time constant-factor approximation) algorithm for a function problem $T : \Sigma^* \to \mathbb{N}$ is a probabilistic Turing machine $A$ with the following propert... |
We have an array of N size. We have to perform Q queries on it, in which each Query contains and Index I for which we do:
for j=I+1 to N:
if A[j]<A[I]:
A[j]=0
The Queries are not independent of each other so we need to use the changed Array everytime.
I have given a lot of thought but was able to come up only wi... |
So I was watching this mock interview by an Airbnb engineer on interviewing.io (https://youtu.be/cdCeU8DJvPM?t=1224) and around ~20:11 seconds he raises an interesting point.
The question that the interviewee was trying to solve was -
Array 1 has all unique integers.
Array 2 has the same integers as array 1, except one... |
I understand following about recognizable (aka recursively enumerable) and co-recognizable languages:
Definition 1: Recognizable language is one which have one-to-one correspondence with the natural number with the additional property that we could specify an algorithm to enumerate the language elements.
For recogniza... |
Even if programming by itself is not an integral part of computer science,
I would bet any B.Sc. student learns fundamentals of binary code, fundamentals of assembly code and at least one high programming language (above assembly).
What programming languages always learned in computer science B.Sc.?
I define programmin... |
I came across following therem:
There exists a recursively enumerable language whose complement is not recursively enumerable.
Now, I know following definitions:
Recognizable language is one which have one-to-one correspondence with the natural number with the additional property that we could specify an algorithm ... |
What is the number of spanning trees in an undirected simple graph?
My attempt:
Let $m$ be the number of edges in a simple graph, and let $n$ be the number of vertices.
Then number of spanning trees is $\binom{m}{n-1}$ minus the number of cycles of length $n-1$.
I read on Wikipedia that the number of spanning trees i... |
I am currently reading about local search techniques. I understand that local search algorithms tend to get stuck in local optima and therefore usually do not find globally optimal solutions. Thus, there are more sophisticated approaches that enable us to leave local optima and may improve the overall solution quality ... |
The Subset Exercise taken from LeetCode:
Example: For Input nums = [1,2,3] Return Output:
[
[3],
[1],
[2],
[1,2,3],
[1,3],
[2,3],
[1,2],
[]
]
has as backtrack solution:
public List<List<Integer>> subsets(int[] nums) {
List<List<Integer>> list = new ArrayL... |
By way of example, suppose I know that $X + a = b + Y$ where $X$ and $Y$ are variables standing for regular expressions, then $(X, Y) = (b, a)$ is a solution to this set of equations.
Generalizing over all such equations, is there a computable (decidable) procedure for calculating the regular expressions which the vari... |
In the 4th edition of his Data Structures textbook, Weis gives a proof of part of the Master Theorem. This proof says "Let us ... ignore the constant factor in $\theta(N^k)$ ... I don't understand why it ignoring that constant is valid. (I know that the real Master Theorem is broader than the version presented in t... |
I'm learning about time complexity but all the cases we did in class were rather simple. Now I'm working on my home work and the cases our teacher let us have was: $$f(n) = 4n(n + 2 \log^2 n^2) + e^{−n} + 8 \sin(2πn/256). $$
Is there a simple way how a I can determine which one of this is the true one? Because this loo... |
In the CLRS book it says that "relabel to front" algorithm, which solves the maximum-flow problem, maintains a list of topologically sorted vertices in the admissible network and that vertices with zero excess flow are moved to the front of the list.
I do not fully understand what is the meaning of it. I would imagine ... |
I'm having trouble understanding what constitutes a "minimal sum section" of an integer array. My book defines it as the following:
Let $a[0],\dots, a[n-1]$ be the integer values of an array $a$.
A section of $a$ is a continuous piece $a[i],\dots,a[j]$, where $0\le i \le j < n$. We write $S_i,_j$ for the sum of that... |
In AI we can classify a problem in 3 classes, ignorable, recoverable or irrecoverable problems. Now while reading Water jug Problem
I am wondering in which of these 3 class it should fall? It should reside under recoverable right? As we can go back to the previous state in Water Jug Problem by altering the water leve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.