instruction stringlengths 35 29.1k |
|---|
Is there some examples of candidate problems that have Turing reduction from SAT but no known Karp reduction?
Conversely is there some examples of candidate problems that have Turing reduction to SAT but no known Karp reduction?
|
I did some quick math on how much data is contained on a screen at any given instant and I ended up with a number well beyond what I thought was possible. 256 colors for Red, Green, and Blue each define a pixel and there are currently 1920x1080 pixels on my screen so..
256 x 256 x 256 x 1920 x 1080 bits = 4.35 Terabyte... |
I'm wondering which of the dynamic object-oriented (or prototype-oriented) languages (like JavaScript, Ruby, Python, etc.) can be considered as the closest to Abadi and Cardelli's untyped sigma calculus?
|
When I studied computer science 10 years ago, it was still an open question whether $\mathsf{L}$ and $\mathsf{NP}$ are truly different classes. Is that still the case or has the inequality been proven in the meantime?
(I know this is a somewhat stupid question, but there's nothing about it in the complexity zoo, and go... |
The perhaps most widely known algorithm converting finite automata into rational expressions is usually known as Kleene's algorithm. However, Sakarovitch in his book Elements of Automata Theory ascribes the algorithm to McNaughton and Yamada, who have indeed described it in their paper.
It might appear like a standard... |
$P^{\#P}\subseteq P^{PP}$ and $\#P\subseteq FP^{PP}$ are known and usually handwaived as exercises. I could not find proofs of these two results.
What is a rigorous proof for $P^{\#P}\subseteq P^{PP}$ and $\#P\subseteq FP^{PP}$?
How is having an oracle to $\#P$ at most as powerful as having an oracle to $PP$?
|
A regular grammar is a mathematical object, $G$, with four components, $G = (N, Σ, P, S)$, where. $N$ is a nonempty, finite set of nonterminal symbols, $Σ$ is a finite set of terminal symbols , or alphabet, symbols, $P$ is a set of grammar rules, each of one having one of the forms. $A → aB$.
I want to know what's Pr... |
Wikipedia lists exactly two problems as $\mathsf{NL}$-complete - 2-satisfiability and St-connectivity (although stating that there are "several"):
https://en.wikipedia.org/wiki/Category:NL-complete_problems
My old literature on complexity (from study) also has no additional examples. And the complexity zoo also lists t... |
I have multiple numbers (e.g. [1, 4, 2]) where each number can be one of a specified range of numbers (e.g. [0-1, 0-5, 0-3]). I think one can represent my so chosen numbers by seeing them as digits of a number in the mixed radix numeral system with different bases for each position. In the above example, the bases woul... |
Suppose that I have a boolean function of size $k$ with $n$ inputs. I would expect to be able to evaluate it on all possible inputs in time $O(k*2^n)$ simply by calculating all the intermediate values for every possible input. Is it possible to do this faster in general, for example in time $(k+2^n)$?
In the special ca... |
I am interested in any research that reviews the state of affairs when it comes to browsers today, be it their concurrency models, their performance, or anything relevant to such topics. Specifically, I am interested in whether any effors are being taken in academia to take on the shortcomings of browser design current... |
Given a word $w$ and a language $L$, we want to check if $w\in L$. This is called the membership problem. Why is the membership problem important?
|
Given two sorted arrays of length m,n, how do I find the median of the union of these two arrays in O(min(log(n),log(m)) time?
I've been trying to come up with an algorithm (and a proof) for several days.
It's the same known question about finding the median of two sorted arrays but in O(min(log(n),log(m)) time insted... |
I faced some problem that involves arithmetic over asymptotic functions. These are as follows:
Let f(n)= Ω(n), g(n)= O(n) and h(n)= Ѳ(n). Then [f(n). g(n)] + h(n) is:
(a) $Ω(n)$
(b) $O(n)$
(c) $\Theta(n)$
(d) None of these
Solution to this was discussed as follows:
Let
$n = 5$
$f = 6$ so that $f = Ω(n)$ and
... |
I have been learning about data-flow analysis and have come across the idea of approximations and that the data-flow analysis should be able to under and over approximate a situation. For example, when using available expressions, we under under-approximate if we aren't sure if we can do something by not doing it. I ju... |
I'm reading Karger 1993's "Global Min-cuts in RNC, and Other Ramifications of a Simple Min-Cut Algorithm" (link).
It states that a single round of contractions yields a min-cut with probability $\Omega(n^{-2})$ and concludes that $O(n^2 \log n)$ independent contractions are sufficient to find a min-cut with high probab... |
Given a directed graph, consider the problem of finding the largest number of edge-disjoint paths from a source node $s$ to a destination node $t$. I know this can be done in polynomial time, for example by reducing it to a max flow problem.
The question I am wondering about is a slight variation of this: you can have ... |
Assume a complete problem for a class $\mathcal C$ is in $P/poly$ and at each $n$ assume that the advice string is $s_n$ of length $n^c$ for a fixed $c>0$.
Assume that $SAT$ of $n$ length input Turing reduces to the following problem
Given $a\in\Bbb N$ is $s_n>a$?
then does ${NP}\in P/poly$ hold?
If it Karp reduces t... |
I already understand that Distributed Computing is the breakup of having multiple clients rely on a single source, and having each client utilize other clients for information. But my confusion comes from a type of distributed computing, where one type is the client server model. From what I know, the client server mod... |
What's the asymptotic running time of the fastest algorithm for adding two $n$-digit decimal numbers on a Turing machine? To specify, the input is of the form $a_1+a_2$ where $a_1$ and $a_2$ are written out in the usual decimal expansion, and the output on the tape is just the result, $a_1+a_2$ (there is no need to kee... |
I am having troubles understanding Levin's universal search method. In Scholarpedia, http://www.scholarpedia.org/article/Universal_search, it is claimed that “If there exists a program $p$, of length $l(p)$, that can solve the problem in time $t$, then Universal Search will solve the problem in a time $2^{l(p)+1}t$ at ... |
Couldn't find much online on how an interactive system is different from a time-sharing system, or the different traits of both.
My understanding of a time-sharing system is many people at terminals being able to use the system at the same time, and the CPU's aim is to maximise response time not CPU time (unlike a mult... |
I know this should be a fairly simple concept but I have been Googling a lot and can't seem to find a definitive definition.
If we had the following random population:
[12,2,3,99,73,32,53,8]
And a tournament size of 3. What could be a possible outcome?
Is there lots of variations of Tournament Selection?
|
Let's say we are given measurements of some sort.
In many cases, it is safe to assume that noise is white noise, serially uncorrelated, and zero mean with some finite variance.
But in other cases, "red noise" exists such that the noise is correlated in time. What does one do in this case? Perhaps a Gaussian Process c... |
What is the trend over time for the size of registers of x86 CPUs? I know that we have today 512-bit registers, but is there a kind of Moore's Law to predict the size of registers in the future?
Thank you very much.
|
Can someone help me to determine and prove if the following language is decidable or not?
I tried to think on some reductions but I can't figure it out...
$$A=\{\langle M\rangle|\text{$M$ is $TM$ and there is a state $q$ in $M$ that $M$ never visits}\}$$
my try:
I built mapping reduce $E_{TM}\le_{m} B$:
$<M>\rightarro... |
Consider 3COL (three colourability), Travelling Salesman, 3SAT and 2SAT. Which of these problems can be solved in polynomial time if we happen to live in world 3 (Pessiland).
My Thinking - We know that 2SAT is a P problem and so we can solve it in polynomial time even though we are in Pessiland however I am unsure on w... |
I was asked to find the O-complexity of the algorithm accepting the language {0^(2^k) | k>=0} meaning the length of a string in the language will be of a power of two. (using a turing machine)
$
The algorithm is:
1 With the head starting at the beginning of string, the headmoves right, marking every other 0.
2 ... |
For $f(n)$ to be in $O(g(n))$, there must exist a $c > 0$ and $n_0 > 0$ such that
$$0 \leq f(n) \leq cg(n) \text{ for all }n \geq n_0\,.$$
I found a solution to a question where my $c$ is in terms of $n$, but my friend says you can't have that. I'd like to understand why.
My thought process is: if I am given an $n$, I ... |
Are there any kind of graphs where Bidirectional Dijkstra would expand more than Dijkstra?
I tried to come up with an argument like this:
Let node $n$ be expanded by Bidirectional Dijkstra. Now there are two possibilites:
Node $n$ was expanded in the forward search
Node $n$ was expanded in the backward search
If $n$... |
When discussing the worst case runtime $T(n)$ of an algorithm, we attempt to bound $T(n)$ above by some simple function $g(n)$, so that $T(n) = O(g(n))$. When discussing the best case runtime $T(n)$ of an algorithm, we also attempt to bound $T(n)$ above and use $O$ notation.
Why don't we instead attempt to bound the be... |
Just like my previous question concerning 'hash'; what exactly is an (or the) "offset?"
Is it a value or data type? Or is it an address location? I have heard it used in different contexts within the computing world. Of course, I have come across it while mounting a disk image; but does it have any other usage than tha... |
Consider the problem in which we have an (undirected) graph $G=(V,E)$, weight function $w:E\to\mathbb N$ and a pair of vertices $s,t\in V$, and are required to determine whether there exists an MST $T$ such that $dist_T(s,t)=dist_G(s,t)$, i.e., $s$ and $t$ are connected by a shortest path.
How would you approach this p... |
From my CS course, the Peterson's Algorithm and the Bakery Algorithm both are solutions which satisfy the 3 requirements of any solution to the critical section problem. a) What are their adv/disadv over each other , and b) if they already solve the critical section problem, why do we need semaphores?
|
If the OS is scanning from one edge of the disk to the other, doing so from behind the Logical Block Addressing (LBA) abstraction, although it may aim to service requests in an elevator-like way, what guarantee do we have that the physical mapping correlates to what we see as the OS?
i.e. Could it be that servicing req... |
I have an optimization problem. There are a few quantities, call them $a, b, c$, that describe how good a solution is. However, they all have different priority, from highest to lowest: $a, b, c$.
The goal is to minimize the values of $a, b, c$. The difference in priorities means that the solution with identical value ... |
Given a DAG (directed acyclic graph) $G=(V,E)$ without multiple edges, i.e., edges with the same source and target vertices, we define:
A vertex $v_j \in V$ is a diamond-join ($\Diamond_J$) vertex if there exists some other vertex $v_f \in V$ such that there are at least two vertex-disjoint paths (except $v_f$ and $v_j... |
Give the point cloud of a closed surface(triangle mesh models), how to judge whether a point is inside the closed surface? As we know, in 2-D situation, there are some algorithms to do this.
|
A player playing the Minimax strategy should choose moves which minimise their maximum loss.
What should happen when draws can happen? Should we class the draw as a win because we aren't losing? Or should be class it as a loss because we are trying to win the game and a draw isn't a win? Or should we just class a draw... |
Below is a saying from this article.
Regular expressions sit just beneath context-free grammars in descriptive power: you could rewrite any regular expression into a grammar that represents the strings matched by the expression. But, the reverse is not true: not every grammar can be converted into an equivalent regula... |
I'm little confused by computing a time complexity for Dijkstra algorithm. It is said that the complexity is in $O(|V|^2)$ - Wikipedia - Dijkstra, which I understand. It's because for each node, we could theoretically relax edges going to each vertex so it is $n * n$ times, respectively $n(n-1)$.
On the other hand, I ... |
I am wondering on how to approach a specific problem I am struggling with. I am not understanding which way to approach it and how to solve it.
Show language $L$ is context free, where $L = \{\text{all strings where middle two symbols are the same}\}$
|
The best-, average-, and worst case time complexity of Heapsort for $n$ distinct keys are all $\Theta(n \lg n)$.
What are the worst-case inputs for heapsort?
|
I have a two hidden-layer MLP. I am trying to teach it classification of the sine function. For instance, if there is an [x,y] point above the sine function, the ANN should classify that point as a 1. Otherwise, it should be classified as a 0.
It should end up like this. Points above y=sin(x) should be blue. Points bel... |
The introduction to Nielsen and Chuang has an Euler diagram of the suspected relationships between various complexity classes which shows $\text{BQP}$ extending slightly outside of $\text{NP}$. Is $\text{BQP} \not\subset \text{NP}$? Are there any specific problems known or suspected to be in $\text{BQP}$ but outside o... |
To be safe, let me start this question by giving the definition of a TM I will be using: A TM is some $M = (Q, \Sigma, \Gamma, q_0, \delta, q_F)$, where $Q$ is the finite state set, $\Sigma \subset \Gamma$ are the input and working alphabet, $q_0, q_F$ are the initial and final states, and $\delta : Q \times \Gamma \ti... |
I was wondering if there is a name for the construct described below:
Given $N$ integers $n_0, ..., n_{N-1}$ we construct a tree of height $N$ levels such that:
each node of level $0$ (i.e the root) has $n_0$ children.
each node of level $1$ has $n_1$ children.
...
each node of level $N-1$ has $n_{N-1}$ children
also... |
Can anyone help me with this test question ? I am not really expert on this.
Assume $1000$BASE-LX network. Communication is using sliding window protocol with $15$ frames, each frame with $1000$ data bytes. The trace is $100$ km long and there is $3$ routers between sender and receiver. Calculate maximum possible data... |
I want to encode a message using byte stuffing where every frame delimited by a flag byte 'F' at both ends and escape code equal to the character E. I am trying to encode the message 'DEEP-FRIED-FALAFELS' while the maximum window size is 10bytes.
What I am unsure about is, what happens when I try to escape a 'flag' or ... |
Given a string S of length n that contains exactly $\lceil\frac{n}{3}\rceil$
b's and $\lceil\frac{2n}{3}\rceil$ a's:
Suppose the charge is 2 for each non-overlapping occurrence of aaa, and 1 for each non-overlapping occurrence of aa. Note the occurreces of aaa cannot overlap the occurrences of aa. Also, note that the p... |
Following is the excerpt from wiki
If numerical data are represented in terms of digits (or bits), then
the naive algorithm also entails storing approximately $2n$ times the
number of bits of $x$ (the evaluated polynomial has approximate
magnitude $x^n$, and one must also store $x^n$ itself). By contrast,
Horner's met... |
Comparing an ordered pair (x,y) to an unordered pair {x, y} (set), then information theoretically, the difference is only one bit, as whether x comes first or y requires exactly a single bit to represent.
So, if we're given a set {x,y} where x,y are two different 32-bit integers, can we pack them into 63 bits (rather 6... |
According to the definition, the productions of a right linear grammar should have the form of $A\to xB$ or $A\to x$,
does $A\to B$ or $A\to xy$ count as productions of a right linear grammar? $A\to B$ can be written as $A\to \epsilon B$ though...
|
I am interested in denotational semantics of object oriented languages. Namely, what are the common/typical denotations of objects used in the literature? Is this an interesting topic these days?
The most comprehensive article I've found dates back to 1993. That made me think that I might be missing something. Am I?
|
I read a question and I don't understand it, is the set consisting of: production rules of Grammars that are CFGs, itself a regular set? The only thing I know is that the type 3 is under the type 2 in CNF.
|
Assuming $P \ne NP$, is there a problem such that is NP such that:
There is always a solution
Alternatively, there is asymptotically almost surely a solution
On average, it takes exponential time to solve
The probability distribution can be any distribution which can be sampled from in polynomial time.
Also, what ... |
Let $f$ be a boolean function with minimum degree real polynomial representing it be of degree $d$.
Is there a relation between number of zeros $f$ or $1-f$ and degree $d$?
|
I have nodes a, b , c,d,N, and e in an adjacency matrix. If I follow the order as a,b,c,d,N,and,e , I get 100010(the question does not matter because I'm asking about the order) for b.But if I follow the order a,b,c,N,d,and e, I get 100100 which was done by my TA in the class. Does the order really matter? If so then i... |
If you are given a memory address $n$ bits long, then you need to at least process those bits. Hence, if you have $N$ memory available, addressed by $n$ bits, it would take $O(\mathbf{log}(N)) = O(n)$ time to access a given memory location, at best. I can see why it might be convenient to assume $O(1)$ memory access t... |
I suppose the calculation should not be done by only two factors (average reading speed/words per minute, and word count). But at least by a third parameter, that in my opinion should measure the difficulty of the used vocabulary with some kind of text analysis.
I suppose it would be something like this:
totalWordCount... |
Let $G(V, E)$ be a edge-weighted directed connected graph and $v_1, \dots, v_n \in V$ be some vertices. Let $d(a, b)$ denote the length of the shortest path from $a$ to $b$, for $a,b \in V$.
I need to find a vertex $v \in V$ such that $$\sum_{i=1}^n d(v_i, v)^2$$ is minimal. What is the most time-efficient algorithm to... |
I want to make folders of images of users in a meaningful way. The images have only the timestamp of creation associated with them. Each folder can have a maximum of k images.
I can use median or mean as a way of deciding which images were taken in a definite time period.
What approach should I use to group these image... |
Say, I wanted to create my own programming language. Assuming that I have made all of the decisions about how I want it to look and act, do I just need to write a compiler for it?
For example, is the high-level Java code anything other than just text and this text is in the correct format for the compiler to accept it... |
How would one verbally say ~~R where R = my program is correct? The tildes are negation symbols. I'm not sure if it just cancels out and comes out as 'my program is correct' or if it's something else.
Thank you!
|
What is an example of a context-free language that runs in NP-time? I've done searches but cant find one. Frankly, I do not know how to determine when a CFL is P or NP. Can someone tell me, please?
|
I have a collection of labelled directed trees, and from these input trees I would like to generate permuted trees that have the same node set but whose edges and labels have been permuted with some probability $p$, such that if $p=0$ the output trees are identical and if $p=1$ the trees are random. The string version ... |
Standard (right) regular grammars have three kinds of rules:
A <- ""
A <- "a"
A <- "a" B
This is OK for a theoretical point of view, but a big inconvenience to be usable in practice. A practical regular grammar should allow us to use commodity operators (|,*,+,?,.,(,)), character sets and group multiple rules in a sin... |
Suppose that I have a bipartite graph $G=(A \cup B, E)$ and $A = \{1, 2, \dots, n\}$, $B = \{1, 2, \dots, m\}$.
After a virtual sink $s = 0$ and a source $t = n+1$ is included into the graph, I want to implement Ford-Fulkersen max flow algorithm.
To the algorithm, we need a symmetric adjacency matrix, therefore $O((n +... |
I want to make a small model of A.I. which can learn itself. I am inspired by 1000+ monkey theorem which states that if 1000+ monkey bangs a keyboard for enough long, then they will eventually produce a Shakespeare's play. So, if you give a banana to one monkey when he produce a correct word, then he would eventually l... |
I am studying operating systems and was going through Copy On Write mechanism.
From Wiki:
When one process modifies the memory, the operating system's kernel intercepts the operation and copies the memory; thus a change in the memory of one process is not visible in another's.
It says a particular virtual page is re... |
In network science, we can take sample a complex system and derive from this sampling a representative network (or graph) that describes the system to some extent. A model of a network, is a powerful mathematical abstraction of the observed system. The model can be used to generate networks similar to the observed netw... |
Show, that every context free grammar can be transformed into equivalent context free grammar ( with possible loss of $\lambda $ ) where $a \in V_t$ and $A,B,C \in V_n $ with rewriting rules of following type:
$ A \rightarrow a $
$ A \rightarrow aB $
$ A \rightarrow aBC $
My thoughts are that I need to show that ever... |
Consider a hash table with $m$ buckets, with chaining as collision resolution policy. Given the set $S$ that will be stored in the hash table, let $X_i$ be the number of buckets whose chain length is $i$. Then the cardinality $s = |S|$ of the set $S$ is
$$ s = X_1 + 2 X_2 + \cdots + i X_i + \cdots \enspace. $$
Clearly ... |
The Busy Beaver problem is to find the largest number of non-blank characters that are printed by a terminating Turing machine of no more than a given size on the blank input.
The usual Busy Beaver machines run on a blank tape that is infinite in both directions.
Is there any research (and/or experiments) on Busy Beav... |
This was inspired by Bradshaw's question originally posted on Math.SatckExchange.
EVEN PALINDROME:
Input: Given a list of strings $[v_1, v_2, ... ,v_n]$ where $\Sigma |v_i| $ is even number.
Question: Is there a permutation $\sigma$ such that $w=v_{\sigma(1)}v_{\sigma(2)}... v_{\sigma(n)}$ $\in \{uu^R \in \Sigma^* \}$.... |
Whilst I was reading CLRS I came across this:
When TRANSPLANT replaces the subtree rooted at node u with the subtree rooted at node v, node u’s parent becomes node v’s parent, and u’s parent ends up having v as its appropriate child.
TRANSPLANT(T, u, v)
1 if u.p == NIL
2 T.root = v
3 elseif u == u.p.left
4 ... |
I have a directory structure in which each directory can have multiple parents (IOW, a cd .. is ambiguous). AFAICS this means this is equivalent to a directed acyclic graph.
Now, a set of directories (aka vertices) is given. I need to know all directories which are below all of those given directories. Thus, I need ... |
I'm trying to write a regular expression for the language $L\subseteq\{0,1\}^*$ of strings that begin with $0$ and contain an equal number of occurrences of the substrings $01$ and $10$. Substrings can overlap, so $010$ is in the language but, e.g., $01101$ is not.
I've worked on a DFA where I can move on to create the... |
Give Context-free Grammar for the language $\{a^i b^j c^k d^h \mid i,j,h \ge 0, k>0, i+j \le h\}$
This is a training exercise, for which we don't get any answers, in a course I'm taking. I have found similar examples, but nothing that touches on the i+j≤h part of this. My biggest trouble is that it is ordered, so I h... |
So lets consider the following grammar
$$
\begin{align*}
S &\to 0 \mid 0A \\
A &\to 1
\end{align*}
$$
would the string "1" be accepted by the language or must the language start with $S$?
|
Tournament method have this structure to found min and max (function getMinMax):
mid = (low + high)/2;
mml = getMinMax(arr, low, mid);
mmr = getMinMax(arr, mid+1, high);
/* compare minimums of two parts*/
if (mml.min < mmr.min)
minmax.min = mml.min;
else
minmax.min = mmr.min;
/* compare... |
The vast majority of known interesting quantum algorithms are probabilistic. The only deterministic quantum algorithms that I know of (which aren't trivially equivalent to a classical algorithm) are (a) Deutsch's algorithm, in which the quantum speedup is pretty trivial, (b) the Deutsch-Josza algorithm, which solves a... |
In lambda calculus, one can prove that two expressions compute the same function if they are equivalent under both beta reduction and eta conversion, where eta conversion consists of eta reduction,
$$
(\lambda x.A x) \to A \qquad\text{if $x$ is not free in $A$}
$$
and eta expansion,
$$
A \to (\lambda x.Ax) \qquad\text{... |
Lets say there is a turing machine $M$ where
\begin{align*}
M &= (Q, \Sigma, \Gamma, \delta, q_1, q_{accept}, q_{reject}) \\
Q &= \{q_1, q_2, q_3, q_{accept}, q_{reject} \} \\
Σ &= \{0, 1\} \\
Γ &= \{0, 1, U\}
\end{align*}
with transition functions
\begin{align*}
\delta (q_1, U) &= (q_1, U, R)\\
\delta (q_1, 0) &= (q_... |
The definition of the entropy is
$$H(Y) = -\sum p(y_j)\log_2 p(y_j)\,.$$
Now my text book says to compute the entropy for each attribute we consider the grouping of the data by that attribute now in each group we calculate the entropy (with respect to classes in each subgroup) and do a weighted sum. In this way the at... |
I have a point cloud of N points in D-dimensional space with periodic boundary conditions, where N can range from 500 to 10^8 and D can range from 1 to 20. The distribution of points varies wildly, from completely uniform to very clumped together, however, each dimension is restricted to the range [-pi, pi). For each p... |
Let's consider two context-free grammars $G_1$ and $G_2$ and ask the following question: Is $L(G_1) = L(G_2)$, that is, are the two grammars equivalent?
In general, this problem is undecidable. However, if both $G_1$ and $G_2$ are left-linear (or right-linear) grammars, then the problem is decidable, because both gramm... |
I understand that in a D latch, whenever the clock signal is high, Q matches D, and while the clock signal is low, it holds the previous state of D. For a D flip-flop, Q will hold whatever value D is at the exact moment C goes high, and will hold that same state until C goes high again. I am able to draw the clock diag... |
I think I understand how supercomputers work in general, but I would like to know how they are configured. It seems to me that supercomputers have a separate computers at each node, each with it's own processor, memory, storage, networking and operating system. It's all that really necessary? Why isn't each node given... |
So I have a language:
$$
L = \{a^{n^2} \mid n > 0\}
$$
I need to prove that this language isn't context-free using the pumping lemma. I have a vague thought process as to how to do the proof but I'm sort of doubting its validity.
So I take a pumping length $p$ such that a word $a^{p^2}$ can be split into 5 parts $uvxyz... |
Do "machine code" and "byte code" terms refer to the available instruction set to the CPU and virtual CPU and their encoding (the language specification) or do they refer to the "encoding" of the current program's instructions after compilation?
The definitions I found in wikipedia seem to lean towards the notion of "i... |
Does anyone know of an algorithm that could be used to determine the next action to take to reach a desired state when trained on time-series data?
For example, a robot starts at a certain state, then takes an action to get to another state. This occurs continuously for many iterations (imagine the robot is randomly e... |
I'm trying to find a regular expression for the language
$$L = \{w\mid n_a(w)+n_b(w)\equiv 2\pmod3\}\,,$$
where $n_a(w)$ is the number of $a$s in $w$.
I can see that this would generate strings of length $3n-1$ and
I can write the expression for a string of whose length is a multiple of three: $(( a + b )^3)^*$. But th... |
Suppose Alice asks to use Eve's quantum computer. Alice loads her hidden quantum state into the computer, then gives Eve a program to run. The program will apply unitary operations and measurements to Alice's state, and Eve will report the measurements to Alice.
Eve wants to make an approximate clone of Alice's final ... |
We'll say the alphabet for the languages is finite, say {0,1}.
|
I need to find the runtime of this function:
$$T(n) = 8T(n/3)+nlogn$$
I try to use the "Master Theorem" when
$$a=8,b=3$$
$$n^{log_ba}=n^{log_38}$$
$$f(n)=nlogn$$
And I define:
$$\varepsilon = -1.5+log_3 8$$
the first option in "Master Theorem" it`s that (when $\varepsilon >0$):
$$f(n)=nlogn=O(n^{log_3 8-\varepsilon})$... |
Disclaimer: there are many questions about it, but I didn't find any with requirement of constant memory.
Hamming numbers is a numbers $2^i 3^j 5^k$, where $i$, $j$, $k$ are natural numbers.
Is there a possibility to generate Nth Hamming number with $O(N)$ time and $O(1)$ (constant) memory? Under generate I mean exactl... |
Andrew Ng, Daishi Harada, Stuart Russell published a conference paper entitled Policy Invariance Under Reward Transformations: Theory and Application to Reward Shaping.
There is a specific example there that I am extremely curious/interested about. It is in Figure 2(a) of the paper:
It is about a 5x5 gridworld with st... |
Question: Find out next increasing value of each element in this below array.
int[] array = { 5, 2, 7, 10, 4, 12}
e.g)
5's nextIncreasingValue: 7
2's nextIncreasingValue: 7
7's nextIncreasingValue: 10
...
12's nextIncreasingValue: -1
Implementation:
for(int i = 0; i < array.length; i++) {... |
This is how I see threads. Please do correct me if I'm wrong:
A thread is a part of a process that runs a sequence of program code. There can be many threads within a process that run different parts of a program (one thread manages keyboard input, one manages auto-saving, one manages printing etc.).
The process allo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.