instruction stringlengths 35 11.4k |
|---|
I'm trying to find an algorithm that finds an optimal matching between $A$ and $B$, where each element $a$ of $A$ provides a preference order $\prec_a$ over $B$. I will notate the index of an element $b$ in $a$'s preference order as $i_a(b)$, where if $b$ is most preferred then $i_a(b) = 1$. This mapping needs to satis... |
The construct of a cell (an ordered pair with pointers to either another cell or an atom) and atom (an indivisible sequence (of bits) (i.e. a natural number)) is a fundamental data structure for many programming languages. It's also quite a versatile one, with which you can build arbitrary structures - lists, trees (li... |
I am Implementing a Queue using circular arrays in C language .The Implementation uses one empty position to indicate that the queue is full.That is if the rear is two position behind front. The condition is we cant use a variable to count the entries in the queue as we insert or delete . I have created this function t... |
I am reading about the address calculation formulas for one and two-dimensional arrays. I have two related doubts concerning it.
In one of the problems, we are asked to calculate the location of B [1700] for an array B [1300....1900].
Now, I understand that B [1700] is actually the 401th element in the arra... |
Let $m, n \in \mathbb{N}$ and $n \le m$. Given $k$ subsets $X_1, X_2, \dots, X_k$ of $\{ 1, 2, \dots, m \}$ and $k$ nonnegative integers $a_1, a_2, \dots, a_k$, find all subsets $Y$ of $\{ 1, 2, \dots, m \}$ satisfying the following conditions:
The set $Y$ contains exactly $n$ elements: $|Y| = n$
The set $X_i$ has exa... |
Suppose I have a min-heap SH stored inside an array. I can perform the operations:
view-min(SH) in $O(1)$
extract-min(SH) in $O(\log n)$
insert(SH) in $O(\log n)$
is-empty(SH) in $O(1)$
If I want to build a max-heap BH from the first one, the naive algorithm I can implement is obviously
BH <- build-heap()
while not ... |
We know from Immerman-Szelepcsényi theorem that $coNL=NL$. But, what about:
If problem is $coNL\text{-}complete$, is it $NL\text{-}complete$? And why?
|
I was reading Perceptron's by Minsky's and Papert's book and there is a part where they discuss symbolic systems and one part of it says:
Symbolic systems yield gains of their own...Above all else they offer
us the prospect that computers share: of not being bound by the small
details of the parts of which they a... |
We have an $n\times n$ grid of squares, each square has a non-negative integer. Two distinct squares are neighbours if they share a row or column. A selection of squares is good if every selected square has a number of selected neighbours less than or equal to its number.
Is there a known way to find the maximum number... |
I'm trying to build a P2P web application using Paxos to obtain a consensus value.
How well does Paxos scale? linearly? or what kind of distribution can you expect? E.g. in using 10 to 10,000 users in the network.
If not, are there consensus algorithms that scale well?
|
I am reading the textbook algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani
The authors state in page $67$:
The preceding formula implies an $O(n^3)$ algorithm for matrix multiplication: there are $n^2$ entries to be computed, and each takes $O(n)$ time. For quite a while, this was widely believed to be... |
I have a doubt with this affirmation, I like to know if is true or false and why
$$\log(n) ∈ O(n^{1/2})$$
|
I am having to solve integer programming problem that has the following property:
For feasible solution $x$ maps to a large set $S(x)$ or other admissible solutions and I can find the best solution of $S(x)$ is polynomial time.
What is the best way exploit this property?
The only thing that comes to my mind is: every t... |
Question
I want to analyse Dijkstra Algorithm by using different varieties of Data Structure.
My solution
Adjacency matrix to Store the Graph and Binary heap for Priority Queue.
$O(V\,\,log\,V+V^{2}\,\,log \,\,V)=O(V^{2}\,\,log \,\,V)$.
Explanation-:
In Binary Heap we have $O(log\,\,V)$ for both Extract... |
I'm having trouble understanding Pumping Lemma for $RL$ , i know that $0^{2n}$ is regular and we can design a FSM for it.Here's my pumping Lemma statement
Let $p$ be the pumping length and my string is $0^{2p}$
1. $z=|0^{2p}|=> 2p > p $ (Satisfied)
2. $z=uvw$ such that $|uv|\geq p$, I'm choosing $|u|=n-p$ and $|v|=p$ s... |
Prove that $P/poly$ is closed on $^*$. Please help me with that because I cannot deal with that.
|
Suppose you are given an array of $n$ integers with duplicates in non-decreasing order. The goal is to find the locations where a value is different from its neighbor.
For example, given the array $arr={3,3,5,5,5,200,200,200,200,209}$, the output would be: ${2,5,9}$.
Obviously, this can be done in linear time. I am try... |
I was hoping to determine if a particular graph was toroidal. My first instinct was to use Forbidden Minors, just as I would use the Kuratowski subgraphs to determine if a graph was planar. After doing some digging I discovered The Robertson Seymour theorem which seems to entail that such forbidden subgraphs do exist... |
We know that coNL = NL. But, is this also true?
If A is NL-complete then complement of A is also NL-complete?
I don't see a reason for that it could be true.
|
I'm pretty new in this field and I need some advice for my first professional challenge.
I'm trying to create a sort of client segmentation from a my company's sales log which has the peculiarity that the clients has a pretty long-term relationship and a periodic behavior.
Based on when does he has bought (Ex: Twice a... |
Time hierarchy theorem states that $DTIME\bigg(o\Big(\frac{f(n)}{\log n}\Big)\bigg)\subsetneq DTIME\big(f(n)\big)$.
However space hierarchy theorem is stricter in that point since it states $SPACE\big(o(f(n))\big)\subsetneq SPACE(f(n))$. Is the same result suspected for deterministic time hierarchy?
I think I can show ... |
In "Engineering: A Compiler" 2nd ed. by Cooper and Torczon,
in 2.4.1 "Nondeterministic Finite Automata" of Chapter 2,
section "Equivalence of NFAs and DFAs"
discusses the upper bound of a NFA's configurations number.
Here
NFA stands for Nondeterministic Finite Automata
DFA stands for Deterministic Finite Automata
NF... |
I want a system to learn what is "normal" in a home-automation(KNX) environment.
I have data like, address/group address, timestamp,... is there a matching machine learning algorithm I could use in that situation?
I started to read a book abt Machine learning, but I'm not quite sure which kind of algorithm I need
If ma... |
A problem is defined to be in NP when it can be reduced to another NP problem in polynomial time.
In Karp's 21 NP-complete problems, the most famous ones are presented. However, I wonder (and could not find a reference) for some of them, what happens if we "relax" the objective function.
For instance, say Hamiltonian ... |
I adopted a feedforward net to approximate the following hybrid function:
$$
output=
\begin{cases}
f(x,y) & \text{if}~~~ z=1\\
g(x,y) & \text{if}~~~ z=2
\end{cases}
$$
where $x \in R,y \in R,z \in \{1,2\}$ are inputs. With a simple example where $f(x,y)=c$ and
$$
g(x,y)=
\begin{cases}
c' & \text{if}~~~ x<x_0,y<y_0\\
c... |
Give two functions that is in O(n^2) but not in o(n^2).
The answer is nlogn and n,But I think a lot but can't understand why answer are them.I doubt answers is wrong.
And this question,Give two functions that is in big-omega(n^2) not in
little-omega(n^2)?
The answer is n^2logn and n^3.But I think a lot but can't under... |
I am trying to fully understand the meaning behind the self-information of events. While I totally understood how to calculate it, all explanations I find online lack of an explanation why less likely events have more self-information.
I can't figure out what consequences this has and can't put it into perspective lik... |
How does it possible that $ZPP=RP\cap coRP$ ?
After all, it must be that $RP\cap coRP = \emptyset$
Where Am I wrong ?
|
2QBF is a problem of determining whether formula $\exists X~\forall Y:\varphi(X,Y)$ is valid. $X$ and $Y$ here are sets of variables. Next, 3QBF asks if formula $\exists X~\forall Y~\exists Z:\varphi(X,Y,Z)$ is valid. But what I can't understand is following:
Can't we change order of quantification? E.g. isn't followi... |
Let $f(n) = O(g(n))$, but not $f(n) = o(g(n))$. That's a nice property, because it means that we cannot replace $g(n)$ with a substantially smaller function. Is there a name for this choice of $g(n)$?
Obviously this covers more cases than just $f(n) = \Theta (g(n))$. It requires the existence of $c > 0$ such that $f(n... |
In C.A.R Hoare's Communicating Sequential Processes (1978), he presents the SQUASH problem:
Replace every pair of consecutive asterisks "**" by an upward arrow "↑". Assume that the final character input is not an asterisk.
The given solution is:
X :: *[c:character; west?c →
[c ≠ asterisk → east!c
▯c = asterisk →... |
In synchronization, when one process is in a critical section & another is busy waiting, both are using CPU. But in a uni processor system, in the same clock both cant get the CPU. So there must be a scheduling algorithm for them. Should we consider these while solving synchronization problem or should we think both a... |
According to this paper,a family of intervals is said to be canonical if the coordinates of the endpoints of the intervals are distinct integers between 1 and 2n where n is the number of intervals.
Here is the example
Original intervals = {[2,5], [3,11], [6,9], [7,13], [8,18], [12,16], [15,19]}
Canonical form of interv... |
Reading this answer to this SO question: Why do we not combine random number generators?, it talks about
very high-quality PRNG (Pseudo Random Number Generator)
so it makes me wonder what constitutes a high-quality PRNG, I assume you can sum it up as it being "more random", but
Question1: Which qualities of a PRNG... |
I have read in this book, simulated annealing, on page 40-41, if temperature $t$ tend to $0$, then the stationary distribution will be distributed among optimal solutions. What i can not understand here is that, if with temperature $0$, the stationary distribution will be distributed among optimal solutions, so why we ... |
I noticed that in many books calculation of midpoint for binary search uses this:
int mid = left + (right - left) / 2;
Why not use
int mid = (left + right) / 2;
instead?
|
I was wondering what is the most efficient way to find the a number in an array with the following conditions:
Array $A$ of size $n$ divided into even parts in the size of $k$
every element in each part is bigger than all the elements in the part
before (Lets say in the left)
every element in each part is smaller t... |
From Programming Language Pragmatics by Scott,
Figure 3.14 Deep binding in Python. At right is a conceptual view of the run-time stack.
Referencing environments captured in closures are shown as dashed boxes and arrows. When
B is called via formal parameter P, two instances of I exist. Because the closure for P ... |
The naturals $\mathbb{N}$ can be encoded with a binary unary code such as
$$
\begin{align}
1&=0_b\\
2&=10_b\\
3&=110_b\\
&...
\end{align}
$$
The length this the encoding grows linearly with the natural number it represents. For example the length of $110_b$ is 3 and it also represents the number 3.
I am... |
What would be the implications for complexity theory if you could compute the Kolmogorov complexity of a string generated by a psuedorandom generator?
|
and sorry if this is a duplicate of some sort, my poor technical vocabulary doesn't get me very far with google.
I am trying to implement some well-known PRNG algorithms. For the time, the algorithm in themselves do their job very well (generating 16/32/64/128 random bits). I am now trying to create a uniform distribut... |
The statement sais the following
Design a function to partition an AVL tree such that, given an AVL tree and a key $x$, it returns two AVL trees, one containing the keys lower or equal than $x$, and the other containing the remaining keys. The complexity must be better than $\mathcal{O}(n)$ (being $n$ the cardinality ... |
What was the first turing-complete language? Know about the first machines
and computers, but not the programming language.
|
I am working on a music synthesis. I have to generate certain musical notes and let us say total number of notes equals to $t$.
I have $m$ number of methods (functions) named $m_1, m_2, m_3, \cdots$ and each of them generate specific kind of musical phrases (group of musical notes) consisting of $x_n$ musical notes.
L... |
Let suppose that there exists deterministic polynomial algorithm $A$ that approximates the probability that a given boolean circuit $C$ accepts random input with an error at most $\frac{2}{5}$. More precisely, for a boolean circuit $C(x_1, .., x_n)$, $A$ computes a number $A(C)$ such that
$$|\Pr[C(U_n) = 1] - A(C) | \... |
The subtleties of the correspondence between type theory and category theory are outside my ken. However, by my naive understanding of the relationship between the two historically convergent disciplines, the latter entirely subsumes the former. If this is so, can the language and formal/graphical descriptions used by ... |
It is known the fact that $NP$ class is closed on sum and intersection. But, what about another complexity classes?
Ok, I have to make my question more precise:
For example: Let $C$ be any complexity class $L_1 \in C, L_2 \in C$.
Is it possible that
$$ 1) \ L_1 \oplus L_2 \not \in C, \oplus \text{ is a symmetric diff... |
I am trying to solve a problem with regards to a DFA. What is the minimal number of states for the following language:
$$L:=\{x\in\{a,b\}^n\ \ | \ \ |x|_a=|x|_b\}$$
where $|x|_a$ denotes the amount of $a$'s in the word $x$. I have done some calculations and got $3\cdot2^{(n/2)}-1$. Is this the correct number of states?... |
I was reading some research paper where for hypergraph of bounded rank $k$ they have given moderately exponential algorithm. The runtime of the algorithm is $e^{ \mathcal {O}(k^2\sqrt n) \cdot poly(n)}$. Here $k$ is the rank of the hypergraph, and $poly(n)$ means polynomial in variable $n$.
What is the meaning of mod... |
I read now several articles about RISC and CISC architecture. Most are rather exuberant enumerating all the differences between these architecture, but not necessarily why things are the way they are.
One point that struck out to me the most was about the RISC's feature of using hard wired parts in its processor and in... |
I was thinking that we can create algorithm for sorting that will work faster than $O(N\log N)$
Let's say we have given array $A$ consisting of $N$ integers, where $N = 10^6$. Our task is to sort this given array. The clear solution is to sort the array using the classic merge sort algorithm, which works in $O(N \log N... |
We say that a boolean circuit is boring if it returns the same
result for $>\frac34$ possible input, where we have $n$ input gates.
Hence, boring circuit returns the same output ($0$ or $1$) for
$>\frac34 2^n$ inputs. Prove that checking if boolean circuit is boring is NP-complete
Can you help me? I have no i... |
Does there exist a language which is PSPACE-complete and regular? (reduction is polynomial with regard to time).
Correct answer here is "unknown". I can't prove it. Can you help me?
|
If a bitstring is incompressible, then its minimal Kolmogorov sufficient statistic (MKSS) is zero, since the bitstring is best represented by a structure function that enumerates bitstrings, and thus the size of the index in the set is the bitstring's length.
However, if a bitstring is compressible, this is no longer t... |
There doesn't exist an algorithm which decides on the following problem:
Does a given Turing machine work in time limited by $5n$? $n$ is the length of $w$. $w$ is an input word.
The answer is:
No, because if it was true then we would decide on problem: Does an universal machine accept a word $w$.
I don't understand ... |
Suppose there are $m$ items, and each item has a price. We order the subsets of items according to their price. For example, if the price of $x$ is 1 and the price of $y$ is 2, then the order is:
$$
\emptyset < x < y < xy
$$
What is an algorithm for enumerating all orders of subsets that can be generated by such prices... |
So basically, in my government class, we are simulating a presidential election. Our grade comes from the presentation of our candidate, but as an added challenge our teacher has a running count of electoral votes garnered. How it works is like this:
there are only 18 states amounting to 286 delegates, so 144 needed ... |
Given a directed conected graph which representation is its adjacency matrix $A$, design an algorithm to detect a sink in $\mathcal{O}(V)$ time, being $V$ the number of vertices.
As definitions can vary, in this context, a sink is defined as a vertex with $0$ exit degree and $V-1$ enter degree.
Obviously, the problem... |
It seems correct that any single given algorithm must either have polynomial runtime or not. Is there a specific algorithm that (does or does not actually lie in $P$, but) can neither be proven nor disproven to do so?
Is there a decision procedure for "$\in P$"?
Do we know $P$ vs. $NP$ to be decidable? Could it be pro... |
We have a language $L \in PSPACE$. Is it possible to reduce it with $f \in LOGSPACE$ to $L'$ and $L' \in DSPACE(O(1))$?
Why/why not?
|
An k-input LUT (look up table) takes in atmost k-inputs and gives 1 output (which is a function of the k inputs). I need to devise an algorithm to find the minimum number of k-input LUT's required to express a n variable boolean function.
For example : - n=8 and k=4 8 input variables are a0,a1...a7
1) f1(a0,a1,..a7)= a... |
I have defined an Inductive in Coq for binary representation of natural numbers as follows:
Inductive bin : Type :=
| Z : bin
| T : bin -> bin
| M : bin -> bin.
and two recursive functions to convert between nat and bin types as:
Fixpoint nat_to_bin (n : nat) : bin :=
match n with
| O => Z
| S n' => in... |
It is an open question that whether $\mathsf{DFS\text{}}$ can be done in $O(m+n)$ time and $O(n)$ bits of space, where $n,m$ represent the number of vertices and edges in a undirected graph. see this for DFS
DFS for directed graph is known to be in RNC i.e. randomised NC. $\mathsf{DFS\text{}}$ also known to be $\mathsf... |
In case 3 of the master theorem, which is applicable when most of the work is being done at the top node (roughly speaking), we also need a regularity condition that the work done at the topmost level is greater than that at the bottom levels, in addition to it being greater than work being done at last level. However,... |
Why this case exists in Thompson's construction algorithm?
Isn't just a special case of:
where the symbol a is replaced by ϵ?
|
$A$ is NP-hard iff $\overline{A}$ is $coNP$-hard, where $\overline{A}$ does mean complement of $A$.
I can't figure out why it is true. Let $A\in NP-hard$. I know that each problem in $NP$ is polynomially reducible to $A$. So, let's "negate" $A$, then by definition: $\overline{A}\in coNP$. However, I am not sure why... |
Show that if $$NP ⊆ BPP$$ then $$NP = RP$$
Solution: It is enough to show that if $NP ⊆ BPP$ then $3SAT∈ RP$.
Let $A$ be a $BPP$ algorithm for $3SAT$. Given a formula $ϕ$ with n variables,
we first run $A$ on $ϕ$. If $A$ rejects, we reject. Otherwise, we try to
construct a satisfying assignment for $ϕ$ one varia... |
Check if $NP ⊆ BPP $
I know that if $NP ⊆ BPP $ then $NP=RP$, which is not known fact. So, we don't know if $NP ⊆ BPP$.
Maybe some other explanation of this exercise ?
|
Check if class $PSPACE$ is closed under polyonomially space reduction
Any ideas ? It is fairly difficult to prove it, because I don't understand exactly what it does mean that problems are closed under space reduction.
|
I have a proof but I don't know if the assumptions I did are correct.
I know that $g(n)$ dominates $f(n)$, since $g(n) = \omega(f(n))$ and I did the assumption that $g(n) + f(n) = g(n)$. So, by reflexivity, $g(n) = \Omega (g(n))$.
Is this correct?
|
Check if $P^{NP} = P^{coNP}$
To my eye answer is "unknown".
I would try to show that it implies that $coNP=NP$, what is unknown fact.
Lets suppose that $P^{NP} = P^{coNP}$. Then we use simply deterministic turing machine $M\in PTIME$ which use oracle. Lets launch both oracles on the same arbitrary instance. It is ... |
$$T(n) = T\left(\frac{n}{2}\right) + T\left(\frac{n}{4}\right) + T\left(\frac{n}{8}\right) + n$$
How do you solve this recurrence?
|
By bucket sort I mean on dividing numbers between 0 and 1 into $n$ buckets and performing insertion sort on all the buckets.
1| n ← length [A]
2| For i = 1 to n do
3| Insert A[i] into list B[nA[i]]
4| For i = 0 to n-1 do
5| Sort list B with Insertion sort
6| Concatenate the lists B[0], B[1], . . B[n-1] together... |
Suppose I want to generate all graphs satisfying some properties (specifically 2-connected graphs on 30 vertices with degree sequence $(4, 4, 3, 3,3, \dotsc, 3)$). Unfortunately, there are an enormous number of such graphs. Probably the fastest way to find all of them would to use nauty, but it is too slow.
Is there a ... |
Problem. Given 2 functions $f,~g$ of the same length $n$, decide if we can change variables in $f$ such that it will be identical to $g$. There are exponentially many non-isomorphical functions (as number of total assignments is bounded by exponent).
Example. $f=(x\land y\land z)\lor(\overline x\lor z)$. $g=(x\lor\over... |
Given the following algorithm for finding the second largest element in a vector:
2ndMAX(v):
n = length of v
largest = 0
second_largest = 0
for i in 1 to n:
if v[i] > largest:
second_largest = largest
largest = v[i]:
else if v[i] > second_largest:
second_largest = v[i]
return second... |
I read this sentence on mit.ocw and don't understand why this completely random function would need $|U|\log n$ bits to be described?
Unfortunately, if we choose a hash function h that happens to be a
completely random function from U to [n], we would actually need $|U|\log n$ bits to describe it.
|
Consider the following problem:
$L$ is the language of regular expression $00^*11^*$. $DM(L)$ is the language obtained from $L$ by throwing away every even-length string belonging to it and for each odd-length string, removing the middle character. Determine what $DM(L)$ is, and tell whether or not it is regular.
Well,... |
My question is related to the exercise 4.28 in the book of Nielsen and Chuang (Quantum Computation and Quantum Information). Here is the exercise
For $U=V^2$ with $V$ unitary, construct a $C^5(U)$ gate analogous to that
in Figure 4.10, but using no work qubits. You may use controlled-$V$ and
controlled-$V^{\dagger}$ ga... |
This question is about computation/computational physics.
Imagine that you want to solve $10^6$ equations of motion, and you have $10^6$ degrees of freedom (position of the particle).
How many RAM memory would you need (theoretically) to do this?
(I am not interested in the final answer, I am just interested in the thi... |
Look at solution to exercise 2, please.
Exercise and solution is derieved from:
https://people.eecs.berkeley.edu/~luca/cs172-07/solutions/sol8.pdf
$$ShortestPath = \{(G, k, s, t)| \text{the shortest path from $s$ to
> $t$ in $G$ has length $k$}\}$$ (a) Prove that $ShortestPath$ is in
$NL$.
(a) Solution: We constr... |
Disclaimer:
By asking this question i'm assuming that "memory" on a quantum computer works similarly compared to a regular computer in the sense that you can store information deterministically and when needed, retrieve it in the same way.
I'm also assuming that n qubit has 2^n "states" that can be set/read independent... |
I was interested in writing a program that given the number of variables and the degree of the multivariate polynomial, it was able to output the multivariate polynomial itself or evaluate it at a specific point (in reality I will feed it vectors with a value for each polynomial and I want to evaluate the polynomial). ... |
For a degree sequence $(d_1,\ldots, d_n)$ with $\min d_i \geq k$ pick a graph with that degree sequence uniformly at random. What's the probability that the graph is k-connected?
I know that for Erdos-Renyi graphs the k-connectivity threshold coincides with with the appearance of degree k vertices, but that doesn't say... |
Let $A$ be a problem. I would like to solve $A$ in $NL$. So, I am trying to construct Turing machine working in $NL$:
Let $w$ be a input of length $n$. Firstly, we run machine $M_1$ that working in $LOGSPACE$. It produces a output $o$ of length $P(n)$ where $P$ is a polynomial.
Secondly, a machine $M_2$ working in $NL$... |
Lets consider $$ACYCLIC = \{\langle G \rangle | G \text{ is acyclic}\}$$
We are going to prove that $ACYCLIC\in NL$. I know that the easiest approach for this task is to use the fact that $coNL=NL$. However, I wonder if correct answer is following approach:
The idea is to check each existence of each length of cycle.... |
What is differences between deterministic and nondeterministic Turing machines? Different but equivalent models of NDTM. In particular, what is this frequently used phrase "nondeterministically guess"? How to use it right, and examples of wrong usage. My goal is to create a reference question.
|
Consider $L = \{(M_1,M_2):\text{the set of words accepted by both TM at the same time is finite}\}$. I want to determine if this language is decidable, semi-decidable or not semi-decidable.
My thoughts
My intuition tells me this is a nonRE language. Before, I showed that the same language considering the condition "th... |
I understand the notion of the universal Turing machine ($U$), which receives a pair of Turing machine ($M$) and an input to $M$ ($x$). If $M$, which obtains $x$, outputs $y$, $U$, which obtains $(M, x)$, outputs $y$ as follows:
$M: x \mapsto y \\
U: (M, x) \mapsto y$
My question is whether there is a theory of another... |
Design a Monte Carlo algorithm that checks in constant time if a given element $x$ is in a $n$-dimensional vector $V$. Calculate the probability for a correct answer. Then suppose $n=10$, how many times the algorithm must be executed so the probability for a correct answer is greater than $0.9$?
Thats what I tried. L... |
According to the counting argument, most bitstrings are incompressible or only slightly compressible. However, the counting argument does not work in the opposite direction, since there are an infinite number of bitstrings that are longer. So, the counting argument does not tell us whether most bitstrings will or wil... |
This may be too philosophical for this stackexchange.
Chaitin's constant $\Omega$ is the probability that a bitstring will halt when run on a universal Turing machine. It is uncomputable due to the halting problem.
My thought is that if $\Omega<\frac{1}{2}$ then most likely nothing would exist. So, since something do... |
There is a convex polygon $X$ contained in another polygon $Z$ (which can be non-convex and even have holes). I would like to expand $X$ to a larger convex polygon $Y$ such that:
$X\subseteq Y\subseteq Z$
$Y$ is maximal, i.e, there is no other convex polygon $Y'$ such that $Y\subsetneq Y' \subseteq Z$
NOTE: $Y$ does ... |
Let $a$ be a large string of bits that is transmitted over a channel that introduces errors (insertions, deletions or substitutions) where the probability of an error happening is $p=0.01$ for each bit. Suppose also that each type of error has a probability of $1/3$ being chosen each time that an error is introduced to... |
Let $a$ be a large string of bits that is transmitted over a channel that introduces errors (insertions, deletions or substitutions) where the probability of an error happening is $p=0.01$ for each bit. Suppose also that each type of error has a probability of $1/3$ being chosen each time that an error is introduced to... |
For every two languages $L_{1}$ and $L_{2}$ over the alphabet $\{ a,b,c,d \}$, we define the language
$$L_{1} \operatorname{op} L_{2} = \{ \alpha\beta \mid \text{$\alpha \in L_{1}$ and $\beta \in L_{2}$ and $|\alpha| \le |\beta|$}\}.$$
1) If $L_{1}$ and $L_{2}$ are CFL then is $L_{1} \operatorname{op} L_{2}$ always ... |
Consider a finite set $X$ and the boolean algebra $\mathcal{P}(X)$ of the subsets of $X$. While I focus on $\mathcal{P}(X)$ in this question, the problem could be expressed more generally in any boolean algebra.
I have $n$ elements $P_1,P_2....P_n$ of $\mathcal{P}(X)$. I am interested in the unions of any combination o... |
Binary puzzle
Binary puzzle is an puzzle played on a $n × n$ grid; intially some of the cells contain a zero or a one (fixed cells); the aim of the game is to fill the remaining empty cells according to the following rules:
Each cell should contain a zero or a one.
No more than two si... |
I was watching the "Five Stages of Accepting Constructive Mathematics" by Andrej Bauer and he says that there is two kinds of proof by contradiction (or two things that mathematicians call proof by contradiction):
Assume $P$ is false... blah blah blah, contradiction. Therefore $P$ is
true.
Assume $P$ is true... blah ... |
sum = 0;
for (int i = 1; i <= n; i++ )
for (int j = 1; j <= i*i; j++)
if (j % i ==0)
for (int k = 0; k < j k++)
sum++;
I am trying to find out time complexity of this above program.
First "for loop" will run n times.
Second for loop will execute overall n^3 times
The innermost... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.