instruction stringlengths 35 29.1k |
|---|
In computability theory, computable functions are also called recursive functions. At least at first sight, they do not have anything in common with what you call "recursive" in day-to-day programming (i.e., functions that call themselfes).
What is the actual meaning of recursive in the context of computability? Why ar... |
I have an exercise about cache memory, first the cache is empty :
I have a cache memory with 16 lines and each lines have 16 octet, the address is 16 bits
So I know that the INDEX will be composed of 4 bits and the offset will be composed of 4 bits too
So i will have this :
bits number :
(15 ... TAG... 8)(7.. INDEX..... |
A recent question made me think about an obvious approach for circumventing the "algorithm is allowed to do anything" problem, when proving lower bounds. Instead of starting with a simple looking NP-complete problem, start with a powerful looking logical deduction system.
Then try to find a reasonable general term expr... |
There are $n$ students that share the same apartment. At each evening, one of them must prepare dinner for everyone. There are $m$ evenings to schedule, with $m \geq n$, and you have to assign any singular evening to one student at a time.
In particular, student $i$ is disposed to accept cooking for $c_i$ evenings, wi... |
Which of the following regular expressions generate a language that is different from the rest?
(a+b)$^*$a(a+b)$^*$(a+b)$^*$
b$^*$ab$^*$a(a+b)$^*$
(a+b)$^*$ab$^*$ab$^*$
b$^*$ a(a+b)$^*$ab$^*$
RE 1 generates a language that contains the string 'a' which no other language among 2,3,4 contains, so can I sa... |
I am reading this material to understand the basics of number system.
I am stuck at a point in that material where it writes the algorithm to convert a decimal number to binary number.
The heading of that part where I am stuck is Decimal to Base
The algorithm (may be presented less than faithfully, please refer the lin... |
Are the following two sets equal? One the set of regular expression over an alphabet, and the other set is the set of all strings which can be generated by using the symbols of an alphabet(Σ*)?
|
We know that for 3 variables (A=0,B=1,C=1), f$_1$ = (A XNOR B XNOR C) = 1, since the input has even number of 1's.
But if we were to do this step by step, f$_2$ = (A XNOR (B XNOR C)) = (A XNOR (1 XNOR 1))
Now, 1 XNOR 1 = 1. So, f$_2$ = (A XNOR 1) = 0 XNOR 1 = 0.
Why is f$_1 \neq$ f$_2$ ?
Also, which is true : "XNOR op... |
I am a little bit confused with the concept of using the Weibull distribution or other distribution for fault model. As I understand, in simulation this distribution is often used for modelling a fault in components.
On the other hand when designing systems we often assume some components might become faulty and we use... |
I want to ask just a quick question. If I have an array, which sorting method will have a complexity of $n \log n$ if I compare two objects in that array? I can't decide between divide-and-conqueror insertion-sort. And how would the iterative solution look like in pseudocode?
|
A greedy algorithm for finding a minimum feedback vertex set
is to pick and remove a vertex with minimum $w(v)/\delta_H(v)$, where $H$ is the current graph, until there are no more cycles left. (That is, the algorithm looks at the lowest cost per cycle space decreased node picks it and continues to do so as long as t... |
I see that modern SW basically dominated by recursive descent parsers. These parsers try grammar production and back track to an alternative one in case of failure. Suppose BNF is
program = (declaration)* "begin" (statement)*
declaration = type_declaration | variable_declaration | function_declaration
type_declaration ... |
I am trying to create a DFA and a regex for this kind of exercise:
$A = \{w ∈ \{0, 1\}^* |\text{length of w is a multiple of 2 or 3}\}$. I tried to do one for $2$ and one for $3$ and then combine them, but it didn't seem to work cause I miss some cases for example $6,7$ or so. Any help would be gratefully received :D
|
You are given $N$ numbers. Remove contiguous subsequence of those numbers, so the remaining numbers will create a sorted sequence. For example, if the sequence is $5$, $7$, $8$, $2$, $1$, $9$ then we have to remove subsequence $2$, $1$. I am only interested in the minimal amount of numbers removed. If this task wasn't... |
I'm dealing with some simple randomized and on-line algorithms, both kind produce some lower/upper bound on quality of the output instance.
For example, there's a simple randomized algorithm for the MAX-E3SAT problem, where there are $m$ clauses each consisting of three distinct 3 variables in $\{x_1, ..., x_n \}$.
Th... |
I've got a 2D cubic spline (Bézier) and I have the polygon-line that's a discretization of that spline.
Is there an efficient and simple to implement a way to calculate the maximum curvature of the spline either by using its smooth representation or the discrete poly-line? It doesn't have to be exact since it's for a ... |
Due to curiosity regarding possible extensions of Schaefer's dichotomy theorem,
I wound up considering the "promise constraint" with 3 boolean inputs that's given by
$C(x,y,z) = \hspace{.1 in}\begin{cases} \hspace{.19 in}\text{ True} & \text{ if exactly one of } \hspace{.02 in}x,\hspace{-0.03 in}y,\hspace{-0.03 in}... |
I'm currently working on a compiler backend for a custom architecture which has some unusual constraints. The architecture has several super-registers with aliasing between the sub-registers, and none of these special registers can be spilled to memory. The code is initially constructed to ensure that registers can be ... |
In research articles (e.g. this one's abstract), I often see the complexity of an algorithm expressed using a somewhat ambiguous notation:
$\log^2(n) = ?$
$\log(n)^2 = ?$
$(\log n)^2 = (\log(n)) \times (\log(n))$
$\log(n^2) = \log(n \times n)$
$\log \log n = \log(\log(n))$
The last three case are easy enough to under... |
Minhash is said to estimate the Jaccard coefficient - supposedly because it's faster to compute. Given two sets $A$ and $B$, minhash (with k hash functions) takes $O(k*(|A|+|B|))$ time to compute.
But isn't it possible to also compute the Jaccard coefficient $\frac {|A \cap B|} {|A \cup B|} $ in $O(|A|+|B|)$ time by si... |
Does a definition of primitive recursion exist for the untyped lambda calculus? Does the definition of primitive recursion require typing for natural numbers?
The only definitions I can find are for the typed lambda calculus: http://www.math.nagoya-u.ac.jp/~garrigue/lecture/2013_tenbo/recfun_en.pdf. Perhaps if I just i... |
So I am working on a problem where I have a set of (labeled) nodes and I have a tree structure (rooted) over that set of nodes. The goal for me is to automatically generate that tree structure. To find the performance of my algorithm, I am trying to use the score as the fraction of edges that I have common in the gener... |
I have given an undirected graph of which I want to associate every vertex with a (random) binary vector. I can chose the dimensionality of the vector but it has to be identical for every vertex. The main constraint is that the closer two vertices are in the graph, the lower the Hamming distance between the two associa... |
An answer on Programmers.SE characterizes an essay by Cook (Objects are not ADTs) as saying
Objects behave like a characteristic function over the values of a type, rather than as an algebra. Objects use procedural abstraction rather than type abstraction
ADTs usually have a unique implementation in a program. Whe... |
What are some of the books for "computer organisation and architechture" which are best for self study. Such a text that one can grasps the big picture, and understandhow various things are fitting with each other.
Topics include: machine instructions and addressing modes, ALU and data path , cpu control design, memory... |
"Let $G\left ( x \right )$ be the generator polynomial used for CRC checking.What is the condition that should be satisfied by $G\left ( x \right )$ to detect odd number of bits in error?
a) $G\left ( x \right )$ contains more than two terms
b) $G\left ( x \right )$ does not divide $1+x^{k}$ , for any $k$ not exce... |
int fun (int n)
{
int x=1, k;
if (n==1) return x;
for (k=1; k<n; ++k)
x = x + fun(k) * fun(n – k);
return x;
}
What is the value of fun(5)?
I find it difficult to realize a recurrence tree when the functions are called inside loops so I decided to go with the recurrence relations.
This is what I came u... |
I'm having a hard time getting my head around smoothing, so I've got a very simple question about Laplace/Add-one smoothing based on a toy problem I've been working with.
The problem is a simple Bayesian classifier for periods ending sentences vs. periods not ending sentences, based on the word immediately before the p... |
I am new to python programming. I am now trying to build a program which convert every element in a list of numbers of base 10 into its base 4. For example here, say i have numbers from 0 to 20 or more, I want to convert every number starting from 0 to numbers of base 4. The result should be like this
[[0,0],[0,1],...[... |
For every non-universal computable program $P$ that takes input of type $D$ does there exist some total computable function $g$ that takes an input $I$ of type $D$ and decides successfully whether $P$ halts on $I$?
Some concrete definitions:
A program $P$ that takes some data type $D$ as input is computable iff there e... |
I read here that "a randomly initialized filter acts very much like an edge detector!". I want to know if there are any papers describing and explaining this phenomenon.
|
I want to implement an insertionSort-algorithm. Let's say I have these pseudocode.
function insertionSort(F)
for i <- 1 to n - 1 do
j <- findInsertPosition(F, i, 0, i - 1)
insert(F, i, j)
end for
end function
Now I want to implement the findInsertPosition function. Say I give this function my list, which ... |
We were talking today, in Intro to Programming, about machine language. I know it's a bunch of 0's and 1's. Let's say I compile the following C++ program on an x86 machine:
#include <string>
#include <iostream>
using namespace std;
int main()
{
cout << "Enter something";
string input;
cin >> input;
return 0;
}
Now, ... |
If I have a weighted graph $G=(V,E)$ and three subgraphs $T_1$, $T_2$ and $T_3$ in $G$ which are trees and all unconnected from each other.
What is the best way to connect these three trees such that the resultant connected tree is of minimal cost?
If it helps, I have already used the floyd-warshall algorithm to calcul... |
I've been thinking about pi and Kolmogorov complexity (Kc).
As the digits of pi are randomly distributed (and infinite) , they can't be compressed with a typical compression program. Through the prism of Kc, it would seem that a generating program (e.g. Gauss-Legendre algorithm) is much smaller than the output seque... |
I'm curious on how to type a dependent pattern matching in a functional language. What should the rule for typing
match e with
| C_1 a_1_1 a_1_2 ... a_1_n1 -> e_1
| C_2 a_2_1 a_2_2 ... a_2_n1 -> e_2
| ...
| C_m a_m_1 a_m_2 ... a_m_nm -> e_m
end
be, where e is of type T, which has constructors C_i for each i.
I think t... |
I have a human body point cloud taken through a Kinect (v1). Now, I want to segment the point cloud into different parts, namely hands, lower arms, upper arms, torso, upper legs, lower legs, feet and head.
Here's the method I'm currently using:
I get the approximate skeleton from the point cloud using OpenNI
I take t... |
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.
P1() {
C = B - 1;
B = 2 * C;
}
P2(){
D = 2 * B;
B = D - 1;
}
The set of distinct values that B can possibly take is ?
My understanding: Say P1 executes first , then B=2, after that ... |
I'm currently studying fast-forward multi-layer neural networks with back propagation, in the book I see that all query and target vectors are binary-encoded, this makes me believe that this is the only allowed encoding, yet all other neurons in the hidden layers and output layer can take on any real value between 0 an... |
I had an interview question once which asked for an algorithm to ensure a Roomba vacuum cleaner visited/vacuumed every "cell" in an unknown shape/size room with unknown obstacles. Depth first search can do this, but I was left wondering if you could minimize the backtracking.
I looked into how it's actually done for Ro... |
We have two sorted arrays of integers.
Without using additional memory we need to merge these two arrays such that the smallest numbers are in the 1st array and the remaining numbers are in the second array.
For instance, if your two arrays are $A=[1,3,9,14]$ and $B=[2,4,15]$, the result should be $A=[1,2,3,4], B=[9,1... |
A subnet mask in class C can have _______ 1s with the remaining bits 0s.
MyApproach:
Class C subnet is 255.255.255.0.So, accordingly it has 9 1s on first byte,9 1s on second byte and 9 1s on third byte.etcSo total 27 1s but the Ans is 25
@Edit
For 255 it has 8 1s on first byte,8 1s on second and 8 1s on third.=24 Ho... |
Polynomial identity testing is the standard example of a problem known to be in co-RP but not known to be in P. Over arithmetic circuits, it does indeed seem hard, since the degree of the polynomial can be made exponentially large by repeated squaring. This question addresses the issue of how to work around this and ke... |
Our college would like to determine if a transcript contains classes that satisfy every general education requirement. What makes this nontrivial is that while a single class may in theory satisfy multiple graduation requirements (e.g., writing, quantitative literacy, and art), each class may only count for up to two g... |
I have a $2 \times n$ matrix of positive integers, where the elements are denoted by $a_{ij}$ for all $i$ in the set $\{1,2\}$ and for all $j$ in the set $\{1,\ldots,n\}$.
I would like to select a subset $S$ of the columns that maximizes the ratio $$\left(\sum_{j\in S}a_{1j}\right) / \left(\sum_{j\in S}a_{2j}\right)\,.... |
Every single online resource I've looked up on Akra-Bazzi method appears to skip over the same step: They say you have to solve for $p$ without explaining how. If you look up the various PDFs and webpages online, they all basically say "Here's the equation. Solve for $p$. It equals (whatever). Moving on now to the inte... |
I'm currently studying for an AI computer-science course.
One thing is difficult for me to grasp and somewhat vaguely explained in my course-material:
I understand that with search-methods like e.g. beam search, hill-climbing... you can search based on a certain knowledge about the problem which can tell you in each st... |
If two people are lost in a maze, is there an algorithm that they can both use to find each other without having previously agreed what algorithm they will be using?
I think there are some characteristics that this algorithm will have:
Each person must be able to derive it using logic that makes no assumptions about w... |
$\Delta_2^P =P^{NP}$, is the set of all languages decidable by a polynomial Turing machine with access to a SAT oracle. I came across a definition of $\Delta_2^P$ as the set of all languages $L$ such that there exists $L_1\in NP, L_2\in coNP$ where $L=L_1\cap L_2$.
I'm trying to prove that a language in $P^{NP}$ can b... |
I was wondering if there was a method that can be used to generate a Regular Expression for a language.
Take the Language $L$ as an example where:
$L= \{w \in \{0, 1\}^{\ast} \mid \text{length of } w \text{ is a multiple of } 2 \text{ or } 3\}.$
Can you show the step by step method to make the RE for this language?
Che... |
I was learning converting DFA to regex.
I came across Arden's method which solve given DFA as follows:
Ardens method
Let us form the equations
$q_1 = q_10 + q_30 + є$
$q_2 = q_11 + q_21 + q_31$
$q_3 = q_20$
Solving the eq_uations
$q_2 = q_11 + q_21 + (q_20)1 = q_11 + q_2(1 + 01)$
$q_2 = q_11 (1 + 01)^*$
So, $q_1 = q_1... |
I recently learned about the rolling hash data structure, and basically one of its prime uses to searching for a substring within a string. Here are some advantages that I noticed:
Comparing two strings can be expensive so this should be avoided if possible
Hashing the strings and comparing the hashes is generally muc... |
i think that it's true that AM is contained in $\Pi_2$ but I'm not sure how to prove it. How do I prove that $AM \subseteq \Pi_2$?
|
Take a group filled with an arbitrary number of random integers. Is there any way of finding out whether it is possible for the sum of the integers can equal a certain number, with the condition that any of the integers can (but do not have to) be multiplied by 0 or -1?
The only possible solution I could think of was t... |
I'm interested in how you might detect similarities in tree structures. For example, in these three JSON documents;
(a) { name="foo", length=23 }
(b) { name="boo", length=99, redundant=true }
(c) { quux="baz", a=44, b=66, c=99 }
it's obvious to the human eye that (a) and (b) are more similar, in content and stru... |
I am reading about agent logics and especially affective agents. There are BDI logics and combination of logics called KARO framework that considers those questions. All those logics seem to be specified and evaluated rather completely - so - are there implementation of this logics as solver or reasoner software.
If th... |
I am studying for a test in Logic right now, and saw the symbol $\underset{x}{=}$, which is used like this: $I \underset{x}{=} I'$.
I've seen it in the solutions of questions like this one:
Prove that $\lnot \exists E \mathrel{=\!\!\!|} \forall x \lnot E$.
The theme is 'Satisfiability'. There is an exercise in which... |
I've recently been working on creating a neural network to classify handwritten digits. I implemented 1-of-N encoding such that there are the same number of output nodes as possible digits (The expected output is 0 for all digits' nodes except for the digit that was inputted, which would be 1).
Because this is a classi... |
If linear programming suggests that we need $2.5$ trucks to deliver goods, why can't we round up and say $3$ trucks are needed?
If linear programming suggests we can afford only $3.7$ workers, then why can't we just round down to $3$ workers?
When can we not use this rounding technique?
|
While tracing the history of the BREAK and CONTINUE statements found in popular languages, I ran into a dead end right around ALGOL.
Algol _? -> CPL -> BCPL -> C -> C++ -> Java -> JavaScript
What was the first programming language to introduce the feature of being able to break out of a loop from the body?
This feature... |
I have a question in Logic:
If I am asked to construct a formula, using the '=' predicate, that shows that there are exactly n objects, I need to show that there are no n+1 objects, right?
For example, to show that there are exactly 3 objects, I will show that there are no 4 objects.
Also, I need to show that there exi... |
I have a requirement to reduce the size of the request / response XML by compressing repetitive productID data in compatible tag.
My request / response xml looks something like below
<products>
<id>
2XZ
</id>
<compatible>
2TR,07N,2TS,082,084,2TT,2TU,2TV,2TW,2TX,2TY,2TZ,2U0,2U1,2U2,2U3,2U4,081,083,2U5,... |
How can I prove whether irregular languages are infinite?
I thought about proving it by the definition of regular language but got stuck.
|
I'm interested in the way artists use lines to indicate shape in drawings. Strictly speaking, my question is about human vision — how our brains interpret certain lines — but I'm asking it here because those working in shape perception might be able to suggest an answer. It concerns what my visual system thinks it's se... |
I am reviewing some old papers for a final tomorrow, and there is a question that I'm not sure about.
If a language A is Turing-Recognizable and Undecidable, what can be said of the Turing-Machine that recognizes the complement of A?
To my understanding this turing machines accept states, are all those that were of t... |
The protocol is defined here, but I'll give a summary here.
Okay, so a number of agents want a certain public good to be constructed (a public good is something like a book, a program, or a statue, something that can optionally benefit everyone once constructed.) It costs $P$ to construct this good. The agents each giv... |
From this main picture explaining how skip lists work from Wikipedia, we see that some nodes carry different amounts of pointers to other parts of the list:
Wouldn't it make more sense to have every node carry 4 pointers (since this is the height of this specific example)? For instance, node with value 2 would also ha... |
I need a structure that resembles an RSS feed of items, but each item is on a different network machine. Users cannot insert in the middle of the feed but only at its head. Deletions are possible.
The first idea was to implement a basic linked-list where each item of the list is an RSS item. Being on the network, this... |
Suppose you're given the list of $2^{2n}$ complex coefficients defining the state of a $2n$ qubit register. You want to compute the $2^n \times 2^n$ density matrix of the first $n$ qubits.
Is it possible to compute the result in $O(4^n)$ time? That would be optimal, since the output has size $\Theta(4^n)$.
It's easy to... |
If I want to represent all the base 10 integers that are multiples of 9 as a language how do I do so?
Alphabets are finite sets.
|
Suppose $q_0$ is the start state, does this mean that if it's the accept state, then the machine must accept the empty string since it cannot have a transition with the empty string?
|
I made the following (ungolfed) Haskell program for the code golf challenge of computing the first $n$ values of A229037.
This is my proposed solution to compute the $n$th value:
a n | n<1 = 0
| n<3 = 1
| otherwise = head (goods n)
goods n = [x | x <- [1..], isGood x n]
isGood x n = and [ x - ... |
While reading Sipser, in computability I read about many to one mapping reducibility and Turing reducibility,the latter one being a more general form of reducibility. But in the introductory chapter about complexity, where the book shows examples of NP-Complete problems,the polynomial reductions used are only many to o... |
If i have a graph $G=(V,E)$, a subset of vertices $S \subset V$ and a second set of vertices $S' \subset (V\setminus S)$, what is the best way to find the shortest path connecting the two sets? That is, we are looking for a shortest path among all $S$-$S'$ paths. We can also assume all edge weights are positive.
Here i... |
I am study this paper "Relating Proof Complexity Measures and Practical Hardness of SAT". Here the authors propose to use pebble formulas to find a relation between these and practical SAT performances using as measure the space of resolution. My question is is it to possible to extend that relation beyond of pebble fo... |
I have a matrix of size $N \cdot M$ filled with integer values $A[i][j]$. I want to choose some numbers so that their sum is maximal. But there is one very important constraint. If I choose numbers in the $i$-th row from interval $[a, b]$, then I have to also take the interval $[\max(1, a - 1), \min(b + 1, M)]$ in the ... |
I have a K-Map and I need to figure out which expression isn't equivalent to the provided K-Map.
$f(w,x,y,z) = \sum(3,7,9,11,13,15) + \Phi(4,5,6)$
We know that both options (a) and (b) are equivalent, and both represent the K-Map's function.
Option (c) however, turns to $(x)(x+w)$ if we make a subcube of size 8 using... |
Let there be a (unsymmetric, directed, weighted) graph ( $\mathbb{G}$, capacity $m$ ) and an array ( $\mathbb{A}$, fixed capacity $n$) of objects ($m>>n$). The array contains references to a number of vertices. The problem is to pick a single vertex ($\mathbb{V}$) from the graph, that is not in the array, fulfilling th... |
I am studying Brandes' betweenness algorithm for weighted undirected graph. I am not sure that, in Algorithm 1 (which is based on Dijkstra's shortest path algorithm),
If a node is first encountered, then we have to check d[neighbor_node] < 0.
But if not, do we have to check d[neighbor_node] > d[current] + length(curr... |
Both virtual memory and job pools store the processes temporarily on disk and bring them to memory at some later stage, so what is the actual difference in between them?
What I guess is that when a process is just created, it first goes to the job pool and then it is sent to the ready queue. Virtual memory is only used... |
How to find the longest (in terms of sum of weights) simple path with at most $k$ edges in a tree? Weights of edges are integers, so they can be negative. I thought about using Bellman-Ford, but it would take too much time. Is there any faster algorithm than $O(V \cdot E)$?
|
Let $p \colon \mathbb{R}_{\geq 0} \rightarrow \mathbb{R}_{\geq 0}$ be a one-dimensional function that fulfills $p(0)=0$. Moreover, we are given some value $u \in \mathbb{R}_{> 0}$ such that $p$ is strictly convex, increasing, and continuous on the interval $[0,u]$.
Assume that we can compute $p(x)$ on $[0,u]$ and the i... |
I have a quick question.
The maximum matching problem is an easy problem but not a trivial one. I was wondering that if the bipartite graph was complete, is it a trivial problem?
I think we can just select an arbitrary edge $\{u,v\}$ and remove the vertices $u$ and $v$ from the graph and continue until there is no vert... |
The best known algorithm(s) for matrix multiplication of $n$-dimensional matrices take $O(n^{2.37})$ time. However, that's for matrices with totally independent contents. When the two matrices are related to each other in some known way, it's sometimes possible to get a speedup. For example, computing $U \cdot V$ is qu... |
Anybody could let me know what exactly the PDT is and where does it come from? it comes from predictive modeling or decision tress?
I read some articles and websites like: this and this
but both of them are about predictive modeling. I think PDT comes from decision tree rather than predictive modeling.
|
While solving Recurrences of type $T\left ( n \right ) = a\cdot T(\frac{n}{b})+c$ using the recursion tree method, number of levels in the recursion tree is equal to $\log_{b}n$ when $b$ is a constant.
But when $b$ is dependent on $n$, can we say that number of levels are still $\log_{b}n$?
For example, in
$T\left ( n ... |
What's the difference between generative and transformative algorithms in relation to algorithmic composition of music?
As I understand the basic idea of the algorithms themselves, generative uses past candidate values (output becomes input) as progenitors (parents) for the next output, i.e. by combining them under cer... |
I have data stored in N-dimensional matrixes (i.e. Arrays nested N layers deep). Is there a good standard solution - other than brute force - to the following two problems
I want to swap 2 dimensions for each other e.g. a 6 x 5 x 4 x 3 matrix will become a 6 x 4 x 5 x 3 matrix
I want to raise a dimension to being the... |
A language $L$ is regular if and only if it is definiable by a sentence in monadic second order logic (MSO) over strings (J.R. Buchi, Weak second-order arithmetic and Finite automata; Z. Math. Logik Grundlagen Math. 6 (1960) 66-92).
Are there proofs of non-regularity of a language $L$ (e.g. $L = \{ a^n b^n \}$) that ... |
When I talked with students about pseudo-random number generation, I mentioned that you should not blindly use subsequent outputs of a pseudo-random number generator (PRNG) to form tuples as they may not be uniformly random then; a famous example is RANDU.
The natural follow-up question is: what do you do? I can imagin... |
I am trying to prove that with language L, (L^R) ^R =L
So that the reversal of the reversal of the language is the original language L.
I have proved that before with a string not language (let's call it a string 's').
(s^R)^R = s.
Proof by induction on the length of s.
Base: |s|=0. s=ε. (s^R)^R =(ε^R)^R =(ε)^R =ε=w.
... |
I have an optimization problem in which I need to sum pixel values in an image over a rectangular region. This is a core component of the optimization so it will be done often and the naive solution is not fast enough.
The region can be rotated arbitrarily so that I can't use an integral image; integral images only wo... |
I'm curious about the general question of whether any combinatorial optimization problem with polynomial time solution can necessarily be reformulated as minimizing a submodular function.
The answer is probably negative.
But my problem at hand is simply the shortest path problem.
Consider a graphical model with two var... |
I have recently discovered term rewriting when I watched this video - https://channel9.msdn.com/Series/Beckman-Meijer-Overdrive/Beckman-Meijer-Overdrive-The-Lambda-Calculus-and-Food-Nutrition
It seems that term rewriting is a generalization of which lambda calculus is an instance. A couple of the programming languages... |
Is it possible for Heapsort to work in time $o(n\log n)$ on certain inputs?
For example in case of Insertion sort it is possible, however when it comes to Quickssort it is not possible. What about Heapsort? I tried to find an input array such that Heapsort will be working in $o(n\log n)$.
I ask you is it possible? Som... |
Let's consider these four function types : Polynomial, Exponential, Logarithmic and Trigonometric.
Considering that both input and output values are floating point numbers.
How do they rank in terms of time complexity (of computing an output value for a given input value) ?
|
Ok, I've been told for years that during the old days, a program written on a certain machine would run only on that machine but now, programs run on multiple types of computers.
What does this really mean? I mean, does it mean that programs were written for certain instruction sets of the processor and would not run ... |
If two languages L1 and L2 both are reducible to each other in polynomial time then which of the following is false?
A L1 is decidable and L2 is undecidable.
B L1 is recursive and l2 is RE
C both
D none of these
I know that both need to belong to NP or NP hard if they are reducible to each other.
simply solving ... |
Let f(n) = Ω(n),
and g(n) = O(f(n)).Then g(n) = _______.
I thought of it this way, since f(n) is Ω(n),then f(n) belongs to the set of functions defined by Ω(n), ie,{n,$n^2$,$n^3$ ....}. So g(n) will change accordingly , ie , g(n) will be of complexity O(n),O($n^2$),O($n^3$) ...etc. Is it correct to directly substitu... |
Problem
I want to implement an optimization algorithm for my file transfer program.
The program buffers data in a local file before uploading to central server periodically and it compresses the files before transferring.
I would want the program to intelligently predict the time and size thresholds before transferring... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.