instruction stringlengths 35 29.1k |
|---|
Everybody knows the Chomsky-hierarchy for describing formal languages and big-O notation for describing time and space complexity of a function.
We know, that each class in the Chomsky-hierarchy corresponds to an atomata, that can recognize any language in the corresponding class.
The question is: What is the worst-cas... |
I'm given an instance of a planar graph and should construct a FPT algorithm for dominating set. The task looks like this:
Dominating Set on Planar Graphs
Instance: A planar graph G and an
integer k.
Parameter: k.
Question: Does there exist a dominating set
of size at most k in G?
Fact: Every planar graph has avera... |
How to show that the shortest simple path problem between two vertices $s$ and $t$ (finding a minimum weight path between $s$ and $t$) in a graph is NP-complete? I saw the following proof in a combinatorial optimization lecture, which I didn't understood (I stressed the moment that I didn't understand).
Let $P_1$ be th... |
We are teaching an artificial intelligence class and we need a different case study other than geographical maps (the popular example is the map of Romania) to explain the difference between Breadth-first search and Depth-first search solutions. We plan on giving it to the students to use as a semester project.
|
Computers and programming languages tend to be deterministic and predictable. Yet progress bars seem the opposite, especially if the operation is complex. Even for world class professional products, some progress bars do little to reflect the real progress of an operation. I've seen them go from 10% to 90% in one le... |
I have a program that calculates the first year some two events happen on the same day. I have not calculated any upper limit for the year. The time complexity of the program would be equivalent to O(Years), where Years is the result of the algorithm.
Is such a notation possible?
If yes, can I call the algorithm "line... |
Does transforming a CFG to Chomsky normal form make it unambiguous?
And if not, is there a technique to convert a CFG G to an equivalent CFG G', so that G' is both unambiguous and LL(1)?
|
If $f(n) = O(g(n))$ and $g(n) \neq O(f(n))$ than can we say that $f(n)$ and $g(n)$ will never intersect?
|
Currently, I'm reading Data Structures and Algorithms in Java, 6 edition by Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser link, particularly a chapter about recursions.
There is an example of algorithm which uses a recursion to calculate sum of all elements of the array:
public static int binarySum(int[ ... |
I've applied a Heuristic to a puzzle where I need to move all off the B's the the right of the W's. my Heuristic is the total distance of the B's from the right most W's. my initial state is (B,B,B,*,W,W,W), where * represents a blank space. A piece can move into a blank space and can jump over one or two other pieces ... |
Given that, there are 10 children standing in a circle, 8 of them stand next to a boy, and 4 of them stand next to a girl.
If 7 boys and 3 girls stand in the following order: GBGBGBBBBB, then 8 children stand next to a boy:
(G -> B G -> B G -> B -> B -> B -> B -><- B)
and 3 children stand next to a girl:
(-> G B -> G ... |
Given two Turing Machines M1 and M2, we build a new machine M that does the following on input x:
Run M1 on x. If M1 accepts x, then go to an accept state.
Run M2 on x. If m2 accepts x, then go to an accept state.
What would be the language of such a Turing Machine? My first intuition was that $L(M)=L(M1) \cup L(M2)$... |
I came across following excerpts while reading about regular expressions identities:
The regex associative laws are:
$$(L+M)+N=L+(M+N)$$
$$(LM)N=L(MN)$$
Some important implications out of associative laws are:
$$r(sr)^*=(rs)^*r$$
$$(rs+r)^*r=r(sr+r)^*$$
$$s(rs+s)^*r=(sr+s)^*sr$$
$$(LM)^*N*\neq L*(MN)*$$
... |
So, I have a graph G with a property called influence. The property sounds like : ∀v ∈ V (G), if v is influenced then he changes his opinion ov which he has on ¬ov, and any neighbor w of v in G (w∈NG(v)) changes his opinion too(from ow to ¬ow).
Also, if all nodes of graph have the same opinion o, then there exists a ... |
I am developing a computer program that solves the Rubik's cube. It is not anything advanced nor fast. It solves the cube by the Friedrich method, using algorithms that I use in real life to solve the cube. Because of that, the output solving algorithm is quite a long one and I was wondering is there is a way to transf... |
In genetic algorithms, we have a function called "mutation". Before we call this function, we choose parents.
In my version of the algorithm, when i mutate the child, i don't change the bits which are the same as the given input.
By that, I mean :
Imagine we want to reach the string "ABCDE".
The algorithm first genera... |
A 2-clause is a clause with at most two propositions (clauses?) : $(p \wedge q,\neg p \wedge q, \neg p,...)$. I have to show that the folllowing problem is $\in$ P:
2-SAT:
Input : A conjunction $\Phi$ of 2-clauses.
Question : Is it satisfisable?
For each set of 2-clause $C$ we associate $G_C$ defined as
$V_{G_C}$ con... |
Is there anything interesting to say about an "almost BST" with directed edges?
Is there a domain where this structure naturally arises? I'm imagining a tree like the one below, but it would of course be more interesting if the tree were deeper with just a few of these strange edges.
I found this article on circuit ra... |
I am currently writing a State of Art about technologies used for distributed communication (like CORBA for example). I want to structure the document in way that I don't leave any subset of this technologies out of the research. My proposed solution is to structure the document by Communication Paradigms:
Interproces... |
In my super non-rigorous class on optimization, the prof defined NP as the class of decision problems that cannot be solved in polynomial time. By definition, P is the class of decision problems that can be solved in polynomial time.
Then what is so called co-NP? Does co-NP = P in the sense of 'complement' of a set as ... |
Suppose we define a CFG such that it is possible to produce strings of the form $a^nb^n$ (in this case, I would think, we would need epsilon-productions).
Then one such $L(CFG)$ is $a^nb^n$.
However, let's say it is also possible to produce strings not of the form $a^nb^n$ from this grammar.
Can we still call $a^nb^n... |
I'm describing the semantics of a new optimization for Java using Operational Semantics but I'm not sure how to define the transition system.
I found this link :http://www.irisa.fr/celtique/teaching/PAS/opsem-2016.pdf where in slide 20 the transition system is defined but I don't get it.
|
In Kruskal algorithm, I decided to use it to construct a minimum spanning tree for a set of N = 100,000 points. Since my hardware does not allow me to keep all the distances between pairs of points, I decided to define the potential edges of the graph in batches of k * N edges (starting of course with the K * N shortes... |
Is
$$L = \{ \langle M \rangle \mid M = (\{Q_1, Q_2, . . . , Q_{100}\}, \{0, 1\}, \{0, 1, \_\}, δ, Q_1, Q_2, Q_3) \text{ is a decider}\}$$
decidable?
I know
$$HALT_{TM}= \{ \langle M \rangle \mid M \text{ is a decider}\}$$
is not decidable, but in the case we are given a specific Turing Machine that has 100 states, ... |
I'm working through CLRS, Chapter 17 on Amortized Analysis. One of the problems I attempted to solve is 17.2-2 (described below), but my answer differs from the one in the instructor's manual, so I thought I'd solicit your feedback. I appreciate any help with this.
Problem. We have a data structure supporting some numb... |
We are given an undirected graph $G=(V,E)$, $|V| \leq 50$. We are also given a starting vertex $s$. Each vertex $v$ of the graph is associated with a natural number $N_v$. Initially our profit is $R=N_s$.
Now we have to traverse the graph beginning from $s$ in an order. We can visit each vertex or edge any number of t... |
Recently I've run across the "Two eggs, 100 floors" problem:
You are given two eggs, and access to a 100-story building. Both eggs are identical. The aim is to find out the highest floor from which an egg will not break when dropped out of a window from that floor. If an egg is dropped and does not break, it is undamag... |
Let $A$ be a polynomial time algorithm which receives a graph $G$ and returns a stable set $SA(G)$ of $G$ with the property: $\alpha(G) - |SA(G)| \leq k$, for some constant $k$.
Prove that $A$ could be used to determine, in polynomial time, a stable set of maximum cardinality in a certain given graph.
I have tried by... |
This might be very basic but I am interested in evaluating the algorithmic complexity of an estimator of the form:
$$\hat{\theta} = \text{argmin}_{\theta} \;\; Q_n (\theta)$$
where $Q_n(\theta)$ denotes some objective function of interest (e.g. - log likelihood) computed on a sample of length $n$. $\hat{\theta}$ is ass... |
Coming from a C++ background I don't understand why one needs types / type expressions as first class citizen?
The only language I know that supports this feature is Aldor.
Does anybody have some literature about types as first class citizen or know some reasons why it's useful?
|
Let us say there is a Turing Machine $M$ and a string $x$. So now I want to know if $M$ accepts or rejects the string or loops on it. So, I feed the string to $M$. So, if $M$ is accept or reject the string it would halt after a finite time and I would get my answer. But how do I know if the machine loops on the strin... |
A library uses a relational database to store data about library books, their members and lending (books, which are currently borrowed). The database relations of this system are given below. Lengths of attributes are given within brackets.
Book(bookno(13), title(20), author(30), edition(7))
Member(memno(4), name(26)... |
I am trying to do thesis work in Computer science and the data mining in time series is the relevant theme, however the analysis of time series is not (it is mathematics subject). What is the fine line? Analysis is about discovery and parameter estimation of the (stochastic) model of time series, but it seems to me tha... |
We have a graph $G$ with binary values on it's vertices. If we flip
the value of an vertex $v$ $ \forall v \in V(G)$ (that is, from $o_v$
in $\neg o_v$, where $o$ is the value of the vertex $v$). And the
values of it's neighbors will flip as well, so the value of $w$,
$\forall w \in N_G(v)$ will flip from $o_... |
In this paper [1], "treaps" and "randomized search trees" are introduced. The idea is to guarantee logarithmic update and query operations by assigning uniform random priorities to the keys being inserted into the tree.
The authors assume that randomness is "hidden" from the user:
All expectations are with respect to ... |
I need to write a blog post on a problem that can be solved algorithmically. I need to do two things:
1) I need to decide what the naive brute force method would be and touch on it's time and Space complexities.
2) I need to come up with a more elegant/ideal method to solve the problem, then discuss tradeoffs with the ... |
I want to find the total external and internal fragmentation. What I understand is that external fragmentation occurs when processes are loaded and removed from memory, causing memory to be broken into little pieces, and that internal fragmentation is the unused memory internal to a partition.
As an example, say I had... |
I want to build an expert system that runs on android. I am using Android Studio as my development tools and I already started to build the knowledge base using SWI-Prolog. I want to take the result from the prolog and show it in the android program. Do I need API or there is a direct way that I can communicate between... |
Consider the following problem, called BoxDepth:
Given a set of $n$ axis-aligned rectangles in the plane, how big is the largest subset of these rectangles that contain a common point?
Say we proved these two statements:
There is a a polynomial-time reduction from BoxDepth to MaxClique.
There is a polynomial-time a... |
For my science fair project, I implemented an optimization to Python's sort routine. The idea is to move the safety checks that have to be carried out during each comparison, e.g. type checks and character-width checks, outside of the sort loop and just get them all done in one pass. An optimized comparison function is... |
I'm only just starting to learn about the PCP, and I'm especially interested in the Bounded version. From Wikipedia:
One of the most important variants of PCP is the bounded Post
correspondence problem, which asks if we can find a match using no
more than k tiles, including repeated tiles.
I am not sure I underst... |
I'm familiar with applying the sutherland hodgeman algorithm for convex polygons(and even concave polygons with a slight modification) against convex clipping windows.
However, if I am to modify the sutherland hodgeman algorithm in such a way that I can clip a concave polygon against a concave window, is that possible?... |
would be really thankful if someone could clear this up.
In reinforcement learning, When we use basis like the fourier or say polynomial basis, and say we have 4 actions, theta will then be a N x4 dimensional vector, where we dedicated each column to each action right..so q(s,a) would be theta[:,a]*feature(s)
how would... |
I have been assigned the question:
Let $G$ be a flow network and $f^*$ be the maximum flow computed by the Ford-Fulkerson algorithm. Consider a new flow network $G'$ constructed by increasing the capacity of exactly one of $G$'s edges by one.
Using the maximum-flow and minimum-cut theorem, argue that if we run the For... |
I'm wondering if it already exist LSH or an alternative to apply a fast segmentation of binary/categorical data and how to implement it.
|
I'm planning to develop an application in C# programming language for user authentication.
Target platform = Newer Windows versions such as Windows 8/10.
Your kind answers will be much appreciated. Cheers!
|
It has been shown that the decision problem
$\{(G, s, t)~\mid~ G\text{ is an undirected forest and there is a path from }s \text{ to } t \}$ is complete for logspace (and therefore in $L$).
But the proof involves a series of reductions which didn't seem very intuitive to me.
Is there any natural algorithm that directly... |
In the data link layer, the Sliding Window is used for flow control.
There are two link utilization formula that can be use. They are :
U = 1, for N > 2a + 1
OR
U = N/(1+2a), for N < 2a + 1
In both formula, N denotes the window size and a = Propagation time / transmission time
I am not really understanding which formul... |
I want to know which problems are harder than Job Shop Scheduling so I can reduce JSP to them.
Sorry I am new to these problems and looking for a source to know what are problems, what are their hardness variations and more ...
|
When looking through a few questions at StackOverflow¹ that all ask for algorithms to select k distinct random numbers out of N, I've become confused about how to compare the answers in terms of time and space complexity.
each algorithm has two parameters, N and k
and returns k elements
In terms of Big O notation, al... |
I have an algorithmic problem.
Given an array (or a set) $T$ of $n$ nonnegative integers. Find the maximal set $S$ of $T$ such that for all $a\in S$, $a\geqslant |S|$.
For example:
If $T$=[1, 3, 4, 1, 3, 6], then $S$ can be [3, 3, 6] or [3, 4, 6] or [4, 3, 6].
In $T$=[7, 5, 1, 1, 7, 4], then $S$ is [7, 5, 7, 4].
I ha... |
Given a family of sets $F=\{S_1,...,S_m\}$, where $S_i{\subseteq}\{1..n\}$, with the assumption that the maximum size of any set $S_i$ is at most $k$ ($|S_i|{\leq}k\ {\forall}i\in\{i..n\}$).
I'm tasked with finding a hitting set $H$, a set that contains at least one member from each set $S_i$ ($H{\cap}S_i\ne\emptyset\ ... |
Almost realtime pushdown relation pop a symbol for each empty step.
Realtime pushdown relation does not perform any empty step.
What do they mean by empty step?
|
I was investigating why computers use binary instead of ternary and, from what I understand, found it's for precision. We want to avoid getting the wrong answer when computing math, and if we were to look at a bit at the wrong time in, for example, a base-10 system we might accidentally catch it switching states and ac... |
In other words, what algorithms have been demonstrated to have the fastest big O notation time/asymptotic complexity for, assuming two real numbers $x$ and $y$:
$x + y$
$x \times y$
$\frac xy$
$x-y$
$x^y$
|
Below, we have given you four different sequences of addresses generated by a program
running on a processor with a data cache. Cache hit ratio for each sequence is also shown
below.
\begin{array}{|c|c|c|}
\hline
Sequence No. & Address Sequence & Hit Ratio \\ \hline
1& 0, 2, 4, 8, 16, 32, 64, 128 &0.50\\ \hline
... |
Is $\overline{\text{BPP}}$ different from $\text{co-BPP}$? I am having trouble understanding the "co" part of these complexities.
I think yes and here is what I think: It seems given that $\text{BPP}$ is the class of languages decided by PTMs with error probability 1/3, then this is equal to $\text{co-BPP}$. But $\over... |
While reading a paper Nominal Unification from a Higher-Order Perspective, in the abstract I noticed something feel bit confusing,
Nominal Logic is an extension of first-order logic with equality,
name-binding, name-swapping, and freshness of names. Contrarily to
higher-order logic, bound variables are treated... |
The formal descriptions of ropes I’ve found use very small numbers like 4 or 8 characters per leaf node as the maximum size. Some also mention that this (obviously) is not a very efficient rope size for use in real life, but makes it easier to see the tree in a demonstrative diagram.
The trade-off is between speed of m... |
We have n deck of cards. To shuffle i-th deck we need a(i) seconds. Our task is to give a greedy algorithm, which will merge two decks until we have one deck.
My idea is to create a priority queue. At top of the queue we have a minimum value of a(i). And then shuffle Q.top() with the next Q.top() while Q.size() > 1.
Co... |
Cause applying H (hadamard gate) on a state |0> will evolve to 50% |0> and 50% |1>, assuming we are meausring along the vertical axis (Z-axis).
While applying a measurement along a horizontal axis (e.g. X-axis), will force the state to "evolve" (destroied) and let it be perpendicular to the vertical axis. In another w... |
In the his paper A simple and fast incremental randomized algorithm for computing trapezoidal decompositions and for triangulating polygons (Computational Geometry: Theory and Applications, 1:51–64, 1991), Siedel discusses following algorithm for finding out trapezoidation and query structure cost.
Generate a random o... |
One of the requirements for a coherent memory system is write serialization - "two writes to address X by any two processors are observed in the same order by all processors". I am not sure how this condition would be met when the CPU cores have a store buffer into which stores are retired before updating the memory hi... |
I am having trouble wrapping my head around the Stacking Boxes dynamic programming problem, and understanding how it has optimal substructure and overlapping subproblems. If it has the optimal substructure and overlapping subproblems, then I can use dynamic programming to solve the problem. How do I know that the stac... |
My thoughts process: let number of elements in heap be $n$, total height of binary heap be $H$, height of node be $h$, and let number of nodes with height $h$ be $x$.
Then number of nodes with height $H-1 \le 2^1, H-2 \le 2^2, ... => x \le 2^{H-h} = 2^{\lfloor \lg n \rfloor - h} = \frac{2^{\lfloor \lg n \rfloor }}{2^h}... |
I have a homework problem that is perplexing me because the math is beyond what I have done, although we were told that it was unnecessary to solve this mathematically. Just provide a close upper bound and justify it.
Let
$$f(n) = |\{w ∈ \{a, b\}^n : aa \notin w \}|. $$
Provide an asymptotic upper bound on $f$ as... |
Let $A$, $B$, $C$ be Turing-recognizable languages over an alphabet $\Sigma$. Assume that
$A\cup B\cup C = \Sigma^*$, and
$A\cap B = A\cap C = B\cap C = \emptyset$.
Prove that $A$ is Turing-decidable.
So far I've tried the following but it really hasn't gotten me anywhere.
Suppose $A$ is recognizable but not decida... |
i am trying to formulate an algorithm for syntax checking for simple boolean expression like (var1 = 10) or (var2 > 100).
evaluation part seems to be easy as i will convert infix to postfix and evaluate postfix without 'paren()'.
i am not fully sure which method should i be using.
can any one point me to a book with a... |
Random Forests is a bagged ensemble of CART learners. The following is what I've found, but am not sure if I'm completely right.
CART (Classification and Regression Trees) uses the Gini index for splitting (whereas Shannon's Entropy function is used in ID3). From what I know, it's asymptotic complexity can be represent... |
Is there an efficient algorithm which computes the (possibly approximately) shortest $n$-edge path between two points $A$ and $B$ in a weighted complete graph? Dijkstra won't work because it will just give the trivial answer of $A\to B$. I'd like to find an $n$-edge path (e.g. for $n=4$, find $C$, $D$ and $E$ which min... |
I'm trying to generate random numbers that would be distributed according to a sample curve that I provide in the shape of vertices.
I came up with this:
function curve_map(curve) {
// convert to sorted points
var points = [];
for (var x in curve) { var y = Number(curve[x]);
points.push( {'x' : N... |
what is an easy but efficient way to evaluate Boolean Expression. I have been searching a lot in google but not really finding a good book or site which has working algorithm.
Input string (A=100) and B > 4)
Expected output to be either True or false.
regards
Deb
|
My question is fairly simple, however I am not entirely sure if my solution is correct.
In this case we are using direct mapping. I know the value of byte-addressable memory and I know the block size and the number of cache lines. I need to find the cache size.
I've calculated the length of the memory address. Cache ha... |
I ask patience to help me to have clarity because I tend to equivocate between formal rappresentation like
like operator is a token
bit
it is determined which operation is to be performed and how to get the operands, according to a function whose domain consists...
and what is physically-electronic-logic rappresenta... |
I am stuck on a problem involving PDA's and CFG's. The problem is as stated:
Give a CFG and a PDA for the language of regular expressions over the
alphabet $\{a, b, c\}$. Give the formal tuple definition of each. You may use the
shorthand for pushing a string in the state diagram of your PDA, but not in the
tu... |
I've read two interesting research papers on face recognition and I'd like to understand the relation between them.
"Learning to Disentangle Factors of Variation with Manifold Interaction" by Reed et al.
"Tensor Analyzers" by Tang et al.
In Reed et al. they say "Our approach is complementary [...], and is also capabl... |
Lets say I have a random number generator that spits out uniform numbers from 0 to 1
Next, I have a shape defined by a series of vertices, like { [0, 0.4], [0.5, 0.2], [1, 0.4] }
In those vertices, the first value determines the position and second the distribution weight in that point (interpolated in between).
Now I... |
I know the fact that you cannot run the same machine code on two different machines,
so the software must be machine dependent (i.e Arm program cannot run on either powerpc or x86).
but in reality the software is OS dependent (i.e linux programs cannot run on windows or mac).
how does this happen? my best guess for now... |
Given a multiset $X=\{x_1,\dots,x_n\}$ where every element $w_i$ is a power of two, and given an integer $M$, I'd like to determine if there is any subset of $X$ that sums to $M$.
(This question is based on a previous question about the subset problem where every number in the set is a multiple of two, but this time $X... |
I am reading Algorithm's Design Manual by S.Skiena and I have a hard time understanding and proving the correctness of algorithms. I should use proof by induction and when we talk about summations and proving their formulas I can do it, I have no problem understanding why it is correct. When I get a loop on the other h... |
I am using a sensing board able to detect magnetic signals between the board and a display.
I have a set of objects that are represented (each of them) by a unique set of points (magnets) with a particular shape. For example: object #1 is made by three points that form an equilateral triangle with side length 1cm; obje... |
I'm a freshman in Computer Science and I'm studying bioinformatics sequence alignment algorithms.
My understanding of a greedy algorithm is one that takes the best decision for a particular instance in order to find a general best decision. By that definition, would the basic dynamic programming pairwise alignment algo... |
I recently saw this question somewhere and thought a lot on it but was unable to find an efficient solution for it.
Asked on Stack Overflow but got no solution there.
The Problem is as follows -
Given a tree with $X$ number of nodes we need to assign values to each node.
You are also given two arrays A[] and B[] each... |
I was reading the symbolic model checking, So there it has mentioned that we can represent the set of states and transition relations of any transition system with the help of ROBDDs.
I was trying to understand how the below would have executed step by step.
$$
\exists_{f({v'})}[\,\underbrace{f({v'})}_\text{ROBDD of... |
I'm studying program verification and came across the following triple:
$$ \{\top\} \;P \; \{y=(x+1)\} $$
What's the meaning of the $\top$ symbol on the precondition? Does it mean $P$ can take any input?
|
The input is: Given a matrix $\mathbf{A}=\left[a_{ij}\right]$ of nonnegative integers for all $i\in\{1,\ldots, m\}$ and $j\in\{1,\ldots, n\}$ (where $n<m$). Nonnegative integers $V_j$ for all $j\in\{1,\ldots,n\}$.
The question is: Find $n$ disjoint sets $S_j$ of $\{1,\ldots,m\}$ such that
$$\bigcup\limits_{j=1}^{n} S... |
I think that these two classes should be the same, but I can't find any literature about this and have a limited background on the topic.
This is my reasoning, and I would like to know if (1) this is already known or (2) I misunderstood something or (3) I just found out something useful:
$P_{CTC}$ is the class of probl... |
Hey guys sorry I'm new to cs and I'm trying to find the running time of algorithms... could you tell me about the algo given how much time is needed in terms of complexity? The actual algo I created is the same as below but the sum must be more or equal to 2^(n-2).Thank you]1
|
I am trying to learn CS fundamentals and I am confused by static vs dynamic allocated arrays. My only programming experience is JavaScript and all online resources I am using refer to C language.
A dynamic allocated array is made when the application starts and it cannot be resized. So how is this different from stat... |
As my title points out, I don't understand how do you show that, in general, the diameter of a MST (minimal spanning tree) can be bigger than the diameter of G, by the factor $\Omega(n)$. $(n:= |V|, G =(V,E)) $.
And I don't understand, how big is $\Omega(n)$ and why $\Omega$?
I made a example where the distance of two ... |
I am doing some research where I have a List containing numbers. For example
{5,10,98,22,13,15}
What is a fast algorithm to calculate all possible sums and differences from these? Eventually I will want to do the same thing for a list of 400+ numbers.
Some examples in the final set
index0+index1=5+10=15
index0+index3+... |
In Chris Okasaki's paper "Flattening Combinators: Surviving Without Parentheses" he shows that two combinators are both sufficient and necessary as a basis to encode Turing-complete expressions without the need for an application operator or parentheses.
Compared to John Trump's encodings of combinatory logic in "Binar... |
This question is about a common optimization in the basic sieve of Erathostenes.
If we look at this paper (page 3, footnotes), the author says:
If we start crossing off at $p^2$ rather than $p$, the number of composites
we cross off is $\frac{n}{p}−p+1$, but it makes no significant difference to our
sum, because ... |
I am learning from this video: https://www.youtube.com/watch?v=eHZifpgyH_4
at 21:17 he talks about his definition of NP-Hard.
The definition is: X is NP-Hard if every problem y which belongs to NP reduces to X.
I watched that part of the video several times but don't understand it. In particular, here's one thing I ... |
Is it possible to use Mizar Mathematical Library for the specification of algorithms at the same detalization level as the implementation of the algorithm in industrial programming language? Mizar should be able to describe constructive proofs in maths and therefore I guess Mizar should be able to specify algorithms as... |
Given $n$ time slots that $k$ people want to buy. Person $i$ has a value $h(i,j)\geq 0$ for each time slot $j$. Each person can only buy one consecutive block of time slots, which could be empty.
Is there a polynomial-time algorithm to compute the maximum value the seller can achieve?
Without the consecutiveness con... |
I am currently watching a lecture on Bloom filters, and the professor is doing a heuristic analysis of Bloom filters.
It's all based on the following assumption:
All $h_{i}(x)$'s are uniformly random and independent (across different $i$'s and $x$'s)
Setup:
Bloom filter of length $n$ bits.
Data set $S$ is inserted i... |
How to prove that standard Turing machine is equivalent to a variant model where a string is accepted if the machine enters an accept state during computation? However, the machine may leave the accept state, and this action does not change the acceptance outcome.
|
The internet is full of algorithms to calculate the modulo operation of large numbers that have the form $a^e \bmod p$. How about numbers with unknown factorization. More precisely, let's say I have a 4-byte sized modulus prime $p$, and a large number $a$ stored in memory as an array of bytes, that is, $a = [a_{k-1}, a... |
I wonder how to tackle such problem, to be more specific:
Given a set and an integer $k$, find the $n$th lexicographically smallest permutation (with repetitions allowed) of the set. We will say that the permutation is valid if its length is up to $k$ (inclusive).
Here's an example: $S$ = {a, b, c}, $k$ = 4, $n$ = 15... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.