instruction stringlengths 35 29.1k |
|---|
Given what we know, which of the following scenarios are possible:
There exist algorithms which are in-fact Ptime algorithms for NP-Complete problems, but which cannot be proved to work.
and there are no Ptime algorithms for NP-Complete problems which can be proved to work.
and it cannot be proved that P $=$ NP.... |
The proposirional logic is based on 3 schema of axioms of which (A1) is
B ⇒ (C ⇒ B). Then, for any 2 axioms p and q, p ⇒ (q ⇒ p) is an instance axiom of (A1). We can have q ⇒ p by a step of MP as we have already p. We can have p ⇒ q in the same manner. So, we have p ⇔ q, that is, all axioms are equivalent. But can we a... |
Reference from here If a Language is Non-Recognizable then what about its complement?
There exist complementary languages of unrecognizable languages that are recognizable, and there exist complementary languages of unrecognizable languages that are undecidable.
If a language is unrecognizable, then it must be undecida... |
I have frequently seen two different definitions of polynomial-time reduction. In the following let $A, B \subseteq \Sigma^*$ be decidable problems. I will try to formulate the definitions in my own words:
Definition 1: $A \le_{p_1} B$ iff there exists a polynomial-time computable function $f\colon \Sigma^*\to\Sigma^*$... |
Suppose directed graph $G=(V,E)$, let $\delta(u,v)$ as the shortest path between any pair $u,v\in V$. Also there is no negative cycle in $G$. Can we conclude that
$$\sum_{u\in V}\sum_{v\in V}\delta(u,v)\geq0\;\;?$$
I try to find a counter example but I guess that it's true because if $\sum_{u\in V}\sum_{v\in V}\delta(u... |
I'm studying algorithms on the very famous book "Introduction to Algorithms" by Cormen, Leiserson, Rivest, and Stein.
and I'm looking at the algorithms for finding the maximum and minimum elements in a binary search tree .
In the book obviously such a tree is described as follows:
"We can represent such a tree by a li... |
Let's say we are looking at the decimal language $L_6$ where $$\Sigma = \{ 0,1,2,3,4,5,6,7,8,9 \}$$ and $L_6$ accepts an integer w if w is a multiple of 6. I'm trying to find the regular expression for this regular language or prove that it is non-regular.
I think that the language is regular since this is an intersec... |
Admittedly I haven't fully wrapped my head around the paper yet, but I'm curious if this algorithm can be adapted to say, a one dimensional cellular automata with two states, and an even sized neighborhood, there are references in the paper to "neighbor radius" and neighborhood size of 2r+1. But the reversibility of ne... |
Most constructs / schemes in programming serve an essential purpose (sometimes more than one), for instance :
Structs in essentially C's solution to the problem of providing user defined data types.
Classes in C, Python, generalize the concept and allow for OO programming.
Templates or type parameters or generics (C++... |
I need to create an implementation of a directed weighted multigraph with dynamic edges:
The edges will be changing during the pathfinding, in the following way:
Summary of the pathfinding:
Pathfinding starts at S.
S -> V1 (through edge with weight 3)
V1 -> V2 (through edge with weight 7, as edge with weight 3 is not ... |
There are n jobs each consisting of two parts: a and b.
There are two people:
person A is completing part a of each job (one at a time), and
person B is completing part b of each job (also one at a time).
Constraint: part a of each job must be completed before part b
We are given for each i:
a[i] : the time that i... |
Consider the following optimisation problem that its size is parameterised by $n$ (width) and $m$ (depth):
Find $w_1, w_2, \ldots, w_n$ that minmises:
$$
\min \Big[w_1x_1^0 + w_2x_2^0 + \ldots + w_nx_n^0 \Big]
$$
Subject to:
$$
b^1_{\min} \le w_1x_1^1 + w_2x_2^1 + \ldots + w_nx_n^1 \le b^1_{\max}
$$
$$
b^2_{\min} \le w... |
I have a sampled function sruface
$$
z = f(x, y)
$$
represented as a grayscale raster image. How to find the upper convex hull of that surface. That is I am looking for the minimal
$$
g(x, y)
$$
such that
$$
g(x, y) \geq f(x, y),
\text{Eigenvalues}(\text{Hessian}(g)) < 0
$$
It is possible to convert the image into a 3d... |
I am an undergraduate student in mathematics. I have a fair bit of experience with deep learning in computer vision research and am willing to dabble into NLP. I hope that things won't be very disjointed and some of the knowledge can be transferred.
I wanted to know if y'all can recommend some YouTube playlists that st... |
Let $G=(V,E)$ be a flow network with two vertices $s,t$ also each edge has its capacity equal to $\infty$. Our goal is to transfer a flow of size $C$ from $s$ to $t$ so that minimize an edge that has highest flow value in it.
I guess by $O(1) $ times using the Ford-Fulkerson we can minimize such an edge. First let $k$ ... |
I was wondering about a solution for the following problem:
Given a directed graph $G=(V,E)$ and a subset of vertices $U \subseteq V$ suggest an algorithm that finds if there is a directed path that visits every node in $U$. The path can revisit vertices/edges. The path can visit vertices not in $U$ repeatedly as well... |
I'm trying to create an algorithm that finds the minimum number of swaps to convert array A into array B. In this case the arrays can only contain the numbers 0, 1 or 2.
So for example: given a = [0, 2, 1, 2] and b = [1, 2, 0, 2]. The minimum number of swaps to convert a into b is 1, namely swap a[0] and a[2].
I've tri... |
Suppose I have a rank-$k$ matrix $A \in \mathbf{R}^{m \times n}$. Now suppose this matrix has its elements shuffled by an adversary to maximize the rank. Is there a way to reverse this permutation and recover the low-rank structure? As follow-ups, what about with sparsity assumptions on the matrix or when $k$ is very s... |
Let's say if we have an infinite process that never yields such that other process dosent get to run. Since FCFS is a non preemptive scheduler does it leads to starvation
|
From the NumPy documentation:
"NumPy arrays have a fixed size at creation, unlike Python lists (which can grow dynamically). Changing the size of an ndarray will create a new array and delete the original."
To my understanding, this would make the numpy array immutable, but from what I've seen, they're actually mutab... |
I am using the book Elements of the Theory of Computation (2nd edition), which has been fine until now. However, I am stuck trying to grasp the Machine Turing conveyed in Example 4.1.8 (pages 189-190). I cannot make sense of the copying machine portrayed in Figure 4-8. Can someone help me understand with an input word ... |
With the following recursive code to count leaf nodes of a binary tree, is there any way to make it faster or parallel-computing optimized in time?
Python code - (mag(P) = number of leaf nodes of tree P depth H, left(P) = produces left subtree and right(P)= produces right subtree, not given here, reduce the tree P to ... |
Which algorithm do I use and how much does it cost if I have to:
Calculate all distances in an undirected and unweighted graph from two sources to all nodes.
I think the most appropriate algorithm is a BFS(G,s) with cost T(n)= O(V+E) where V= (number of nodes) and E=(number of arcs). The algorithm is the one in the fig... |
$$(\lambda x. x \text{ } x ) ( \lambda x . x \text{ } x )= (\lambda x. x \text{ } x) ( \lambda x . x \text{ } x)$$
Source
I am a bit confused on how this composition was done. When I do it, I get:
$$ \lambda x. (\lambda x. x \text{ } x) (\lambda x . x \text{ } x)$$
On what basis do I drop the exterior most $\lambda... |
I am trying to understand how operating systems work because I would like to write my own version of Unix. Anyway, I have some doubts about some mechanisms that allow the applications to communicate with the kernel. In particular, according the several sources on the web, when we compile a program, it is OS dependent a... |
I am really confused about it. I think 32 bits = 4 bytes but 32 bit address is only 1 bit.
|
L1 and L2 are two lists which only consist of X's and Y's. L1 and L2 have the same length.
How many sublists of L1 contain the same number of X's as the sublist of L2 in the same position? The empty sublist is not counted.
For example:
L1 = X
L2 = Y
=> return 0
L1 = Y, Y
L2 = Y, Y
=> return 3
L1 = Y, X, Y
L2 = X, Y,... |
I implemented the $O(n^2)$ convex hull algorithm. That is:
Find a triangle known to be in the hull (by finding the lowest point, a point connected to it in the 2D convex hull, and the point that makes the widest angled triangle relative to all other triangles with thsoe 2 points).
Add the 3 edges and the triangle nor... |
I have to express the solution of the recurrence equation T(n) = T(an) + n where a is a constant, 0 < a < 1, in terms of θ using the iteration method. I am unsure of how I calculate the cost of each level and the number of levels because of the constant a.
|
Lets assume dir a has dir b which has dir c.
In a recursive deletion of these directories we can't "just delete" dir a. We must first delete dir c (and any file it has, if it has), then dir b (and any file it has, if it has) and only then could we delete dir a.
This seems to me "from bottom to top", time and again.
Is ... |
Random number generators commonly found in default libraries are actually pseudo-random number generators. Nevertheless, more sophisticated options exist to gather entropy from "truly"-random sources such as atmospheric noise, thermal noise, electromagnetic and quantum phenomena.
Speed of random number generation is im... |
Given a matrix A, let Aij denote the element of the i'th row and j'th column.
$$ A_{i,j}\in \{0, 1\}$$
Find the number of sub-matrices with all ones.
1 <= #rows, #columns <= 150
P.S. This apparently can be solved in O(#rows x #columns) using dynamic programming and stack. I just can't wrap my head around how this can b... |
There are papers that describe how generalized algebraic datatypes (GADTs) are encoded in core Haskell (System FC)[1][2], but I could not find any documentation on how OCaml formalizes/implements/encodes GADTs and how does it compare to Haskell GADTs.
Question: How are GADTs formalized/implemented/encoded in the core l... |
I am building an analyzer that takes in text and numbers the lines;
taking in
hello how are you
i'm fine thanks
as input and using the code:
%{
int i=0;
%}
%option noyywrap
%%
.* {i++;printf("[%d] %s \n",i,yytext);}
%%
void main(){
yylex();
}
this yields:
[1] hello how are you
[2] i'm fine thanks
there's... |
I'm trying to figure out the pumping length of (a+b)(a+b)*
From what I understand, this means that there is some A or B followed by any number of either A's or B's e.g
ABBBB
or
AAAAA
but AAAABA wouldnt be in the language.
Firstly I'm not sure if my assumption above is correct.
Using the decomposition rule.
Suppose L is... |
Being C a complexity class, if C is contained in its complementary class, does it imply that the C = coC?
So far I tried to prove $C \subseteq coC \implies C \subseteq coC \land coC \subseteq C$.
I can assume that $C \subseteq coC$, but how can I prove that $coC \subseteq C$?
I came up with this:
$ L \in coC \rightar... |
I need to create a DFA for a sequential order of states e.g.
A -> B -> C -> B -> A
and so on, where 'A' is the start and finish state,
1 is a transition to the next state and 0 just loops back to the current state.
1 and 0 are the only inputs
The only way I've found I can do it in this order is by having 2 B states,
Is... |
I need to find the shortest path between two nodes in a directed, positively weighted graph that migt contain cycles. All weights are either zero or one. If it was not weighted, I'd use breadth-first search. Dijkstra's algorithm should solve this, but is there a more appropriate algorithm?
|
given array of size n, and a function called FindPivot which returns the median with a time complexity of O(n^(1.1)).
what is the worst case time complexity of quicksort using the given func to find pivot?
the answer given by the teacher is theta(n^(1.1))
I thought it should be theta(n^1.1logn)
please explain
|
I was tasked with writing a function that finds the value of an element that is the first duplicate in an array to be encountered. For the array
[2, 1, 3, 5, 3, 2]
The answer is 3, not 2.
for an array like this:
[5, 3, 8, 2]
(no dups) the answer is -1.
I wrote this function:
def solution(a):
# return if no dups
... |
question is:
given an unwighted nondirected graph G=(V,E) portrayed as an adjacency list,
a special arc is defined as an arc (u,v) where both u and v has the same distance from source vertex s.
i need to give an algorithm to find all of the special arcs for a given s node.
the teacher's solution is:
run BFS from s and... |
For language $L = \{a^n\, b^m\: |\: m \:\%\: n = 0 \}$, that is, is a multiple of .
I'm trying to find a proof that it isn't a context free. I know it isn't regular, but it also doesn't seem to be context-free to me. However, I am not sure how I would go about proving that it isn't context-free with pumping lemma. My ... |
I am reading Tanenbaum's Modern operating systems. I am not able to understand what he means by last line in the attached image. He says that the run may straddle word boundaries in the bitmap. What does he mean by that? Can someone explain it to me?
|
According to the answer provided by Janoma, there are several methods to determine the regularity of a language.
Theorem
Let L ⊆ Σ∗. The following conditions are equivalent:
L is generated by a regular expression (i.e., the definition of regular language).
L is recognized by a nondeterministic finite automaton (Kleene... |
I am making some notes on order theory for my own self study (and certainly anyone else that wants to read them).
I'm impressed with what mermaid can do out of the box, but unfortunately I will need to make directed network diagrams with certain choices of embedding rules. Mermaid will choose an embedding that is aesth... |
I have a set of $n$ elements, and a binary relation between these elements. However, this is not guaranteed to be an equivalence relation. (Specifically, the elements are line segments in a plane, and the relation is intersection: if $A$ intersects $B$, and $B$ intersects $C$, $A$ may or may not intersect $C$.)
I would... |
I haven't seen anything online that covers this specific case:
I run a camp which has about 8 teams of kids, and every day there are 2 sports activities. Teams play each other in different sports throughout the summer.
I need to manually create a schedule with the following constraints:
2 Teams should not play each ot... |
The 3-co-SAT problem consists of deciding whether if a 3CNF formula, has an unsatisfiable assignment of variables, i.e., assignment of variables that evaluates to 0.
We know that 3-co-SAT is in coNP, however, I do not understand why it is also not in P? It seems to be very easy to check whether if there exists an unsat... |
I came across the following problem while doing my Formal Language class assignment and hope someone can give me some hints:
I have $\Sigma = \{0,1\}$ and $L=\{x0a \mid x \in \Sigma^*, a \in \Sigma\}$, namely $L$ contains all strings whose second-to-last character must be a $0$.
I have found that there are four equiva... |
It is claimed that "lambda calculus is a universal model of computation that can be used to simulate any Turing machine". How can I, using this universal model, simulate an algorithm of calculating an algebraic sum of two numbers? How will this algorithm look, according to the grammar of the calculus, which does NOT in... |
I.e. is it right to say "a PTAS parameterized by sth"?
Is it unusual, and is it correct?
|
In lambda calculus, $\lambda xy.\phi$ isn't in general equivalent to $\lambda yx.\phi$. However, it seems possible to imagine a calculus which replaces application with something like specification, where order of specification is unimportant (at least when the substitutions target different variables):
$$\mathit{Term}... |
I have a set of closed curves (not convex, not planar) in 3D.
The goal is to produce A mesh (any will do) that is manifold and contains the closed curves as boundaries/holes.
For example like this drawing:
In the case of 2 boundaries you would get something close to the general cylinder described by the 2 boundaries.... |
I was thinking what if you just started with the node with lowest non-zero degree $u$ (only count undirected edges) and picked random edge that is connected to that and direct that inwards. EX: undirected edge $uv \to (v,u)$. Then repeat, ignoring nodes that have reached the at-most-one limit. At the end, you check to ... |
For my MSc thesis, I need to prove rigorously that $\log x = o(\sqrt{x}).$ How can I do it?
|
Example of function f(x) such that it is true that f(x) = Ω(g(x)) but that it is not true that f(x) = ω(g(x))
|
I was wondering if it is possible to list all subsets of size $k$ of the set $\{1,...,n\}$ by performing at most $C \binom{n}{k}$ operations for a fixed constant $C$.
I did find a way to compute these subsets more efficiently than by just listing all subsets of size $k$. An example is starting with $[1,...,k]$, increas... |
Question is add minimum number of edges so that this given graph consists an eulerian path (but not necessarily an eulerian circuit). Why do edges less than these given edges won't suffice?
As I solved this question, it turns out that an eulerian path can exist by removing more than one edge. Does it work as a contrad... |
In Harper's Practical Foundations for Programming Languages, page 19, rule (2.9) defines the $sum$ function inductively.
$$
\frac{b:nat}{sum(zero;b;b)}\tag{rule 2.9a}
$$
$$
\frac{sum(a;b;c)}{sum(succ(a);b;succ(c))}\tag{rule 2.9b}
$$
Then the author introduced Theorem 2.4 to prove $sum$ is indeed a function, that is, $c... |
The example says that C is unreachable, but there is the production S-> aBC so C is clearly reachable. This is an error right? or am I missing something.
|
given array A of size $n$ which is made of $logn + 1$ sub arrays which are sorted,
I need to sort ASAP.
example of array : $A[500,501,3,8,100,1,2,9]$ as you can see, sub arrays are :$[1:2][3:5][6:]$
my solution was:
merge all logn + 1 arrays together, simultaneously.
so like I compare : $1:3:500$ >> append 1 to sorted... |
I know that finding the optimal solution to One Way TSP (TSP but the salesman does not have to return to his original city) is NP-Hard, but is it NP-Complete? I ask this because I recently found a solution to Open TSP but can't find a good resource to tell me whether or not One Way TSP is NP-Complete.
|
An edge cut of a graph $G$ induced by a partition of $G$'s vertices into sets $X$ and $Y$ is the set of all edges with one endpoint in $X$ and another endpoint in $Y$.
An edge separator is a set of edges whose removal will increase the number of connected components in the graph.
Note that these are two distinct conce... |
I learned that Y fast tries support amortized loglog(u) time insertions , deletions. and loglog(u) time membership, successor and predecessor operations with O(n) space. So when n is closer to U in dense big data environments Y fast tries seem better than B trees.
But most database systems use Btrees internally. I was... |
In a personal project of mine, I have been faced with the following problem. I have an $n \times n$ matrix $T$ where an entry $t_{ij} \geq 0$ denotes an arbitrary metric between two points $i$ and $j$ in the 2D Euclidean space.
What I would like to do is create a graph $G=(V,A)$ which can approximate matrix $T$ where $... |
Let's suppose we are given the following inequalities:
3x + 7y <= 71
4x + 9y <= 21
...
and so on, in the above format. The coefficients and the value generated (71,21 ...) would be positive, and x and y would also be positive. The input would be inputted as follows:
3 7 71
4 3 18
...
and so on, in the above for... |
This variant of #Positive 2-SAT is defined as follows :
We are given a set of variables :
(a,b,c,d,e)
we can form our 2-literal clauses from these set of variables but we want the input in this variant such that for example if we are given a clause (a,e) then this input must contain every possible 2-literal clause from... |
Consider a set of $N$ vectors (each of Length $L$) with positive integer as elements. Given a target vector $T$ of length $L$.
Objective: Using the given set of vectors (by addition or subtraction) reduce $T$ to the form $T'$ such that:
all entries in $T'$ are either 0 or 1.
the first entry of $T'$ is 0.
How do we ap... |
I am trying to solve a problem to show equivalence between two regular expressions, and simplifying one of them I got $R.L^* + L^*$ in the end which I am not sure how to simplify further.
I want to equate it to $R + L^*$. Is this equivalence correct or is there a way to derive it?
|
Given string P with length n, and a function A on P [n] --> [n] that does the following:
For every 1 <= k <= n
A on P [k] = { the maximum index i such that P[1...i] = P[k...k+i-1]
Write an algorithm that's optimal as possible that given string P calculates the value of A on P [k] for every 1<= k <= n
|
while solving some questions about network flow I was wondering about the following statement:
Given a network flow (a graph $G=(V,E)$ with a source $s \in V$ and sink $t \neq s \in V$) > and an arbitrary vertex $v \in V$, how can we find if the vertex $v$ belongs to any minimum cut?
A vertex $v$ belongs to a minimum... |
Let's assume, I have a grayscale image that every pixel represented with 8 bits. I want to quantize (decrease color depth) the image into 2 bits. Hence, I need a function as $f:A\rightarrow B$ where $A\in \left[0,255\right]$ and $B \in \left[0,3\right]$. Simplest way to define function $f$ is
$$
f(x) =
\begin{cases}
0,... |
I am figuring out separation logic and trying to run simple examples in CVC5 smt solver. I am missing some core understanding of how pointers and values are treated there and I don't know where to look for more information.
I am sorry for the long snippets, but they are very simple.
First query
(set-logic QF_ALL)
(set-... |
I recently learnt that a subset of a regular set may not be regular. This is causing me confusion as I imagined if a set is regular then every string longer than $p$ can be pumped in the language. So does a non-regular subset have strings only length $<p$? But if they have length $<p$, can't they be trivially pumped?
|
Consider this language:
$K=\{xy \mid x=\{a,b\}^*, y=x^R \text{ or } y=x\}$
I know that these languages are non-regular separately:
$K_1=\{xy \mid x=\{a,b\}^*, y=x^R\}$
$K_2=\{xy \mid x=\{a,b\}^*, y=x\}$
But what about their union?
|
Suppose we have a metric space $(X,d)$ and we call $r$ to be a root vertex and then there are $n$ clients(i.e. $n$ vertices/nodes) who need packages delivered to them from $r$. The $i$th client demands a package of weight $w_i$ and is $d(r,i)$ distance away. Two clients $i,j$ are $d(i,j)$ distance away. Initially, all ... |
In this youtube video, the instructor explained some basic code in RISC-V assembly, but i didn't understand why in the first line, he is shifting i by 3. Why do we have to multiply it by 8??
I feel like it has something to do with the fact that LOAD IMMEDIATE operations can load values up to 12 bits only, but I couldn'... |
How to design Push Down Automata for a language that has equal number of a's and b's where $n \ge 1$?
I got how to do it for $n \ge 0$, not able to get it for $n \ge 1$.
|
I was reading this question on CS stack exchange called How important is initial state for local search optimisation?
I would like to extend it with the following example:
I have been reading about optimisation techniques and noticed that if a random initial state is provided to a genetic algorithm, it may still find a... |
I was reading David J.C. MacKay's Information Theory, Inference and Learning Algorithms(pdf available in the link), and in section 16.4 of Chapter 16: Message Passing, he writes about how only separable problems can be solved using a message passing approach. One of the non-separable problems he mentions is:
the size... |
Describe the language accepted by the DFA shown above
|
(sci-fi-esque question inspired by Counterpart).
A portal between our world (called $A$) and a parallel world that's exactly the same (called $B$) opens up. Bob sees himself through this portal.
$A$-Bob says hello, but since he's in the exact same circumstance, $B$-Bob also says hello at the exact same time. Basically,... |
I have been studying the necessity of a WHILE loop when defining the Ackermann Function.
I am looking to write a program to compute the Ackermann function in a high level language such as Python or JavaScript to compare it to the WHILE language.
The Ackermann function is defined recursively, and recursive calls do not ... |
After accepting the command entered by user,the shell generates a readily executable simple command line by parsing it evaluating variables(if present),performs command substitution,interprets metecharacters like * and ?(if present) and identifies the PATH.
Can anyone explain to me in simple terms the parsing part and... |
I am looking for book references on combinatory logic. Is there a book focused on how combinatory logic is applied in the context of pure functional languages like Haskell?
I found "Combinators: A Centennial View" by Stephen Wolfram (2021), but it has too much advertising in it. Every second page Wolfram tries to sell ... |
I am reading the following paper:
https://arxiv.org/abs/2301.06941
The authors in Eq.(8) have obtained a relation which has the mutual information, $i$, in the exponent of the exponential on the RHS of the 1st line. At the end of this equation, it seems mutual information is replaced by minus conditional entropy.
How d... |
I am trying to understand how KD-tree works when we insert a node and how it splits the xy plane, please. Below $[5, 4]$ splits the xy-plane into left and right parts while $[2,6]$ splits it into top and bottom. Why don't we say that $[2,6]$ again splits the space into left and right?
|
Contiguous arrays with variable length, such as C++'s std::vector, have been a major sequential container for languages whose evaluation is eager. However, it has been commonly considered that contiguous arrays do not mix well with lazy evaluation. Indeed, Arrays that Haskell provides are strictly evaluated for its ent... |
Suppose, I have a list of lists where multiple lists can have same elements. In my final output, I just want one list with the same element. An example is the following:
Input: A=[[1,2,0], [0,1,2], [2,1,0], [4,5,6], [6,5,4]]
Desired Output: $[[0,1,2], [4,5,6]]$
Can someone help me with an easy function for doing so? Th... |
The question is the following:
Construct CFG for the L = {w ∈ {0, 1}∗ : w is a palindrome and |w| is divisible by 3}.
I am able to construct CFG for the set of all palindromes as below:
S --> aSa | bSb | a | b | ϵ
I am not able to figure out how to make |w| divisible by 3 in my CFG.
|
I am a bit confused on what the difference between a "function problem" and a "search problem" is.
The specific problem I have been studying is known as End-Of-The-Line:
Given two functions, $P(x)$ and $N(x)$, a value $v$ is said to be balanced if $N(P(v)) = P(N(v)) = v \lor N(P(v)) \neq P(N(v)) \neq v$. Given that $0... |
You have $n$ questions in an exam. Question $i$ is answered correctly with probability $p_i > 0$. If question $i$ is answered correctly, you get $R_i$ marks. You can choose to answer
the questions in any order. As long as you are giving correct answers, you can
accumulate all the marks. However, whenever your answer to... |
forgive me if my question is vaguely phrased.
I’m fishing around for a PRNG algorithm which generates numbers of a constant length, regardless of the seed.
I tried experimenting with a LCG but obviously the output for that is 0<=Xi+1<=m. Plus points if the algorithm is reversible (like you could get the seed back from ... |
In a directed, weighted graph with non-negative weights we are asked to find a path from a starting node s to node t that weights $\leq W$. In our given graph there is no such path but we have the ability to skip as many edges as we like.
How can I create an algorithm that calculates the number of minimum skips needed ... |
The setting is the following: There are n players that want to compete in a specific game over the course of an event. A game is played between 2 teams of 2 players each (so a 2v2). Each player as a general rating value based on the ELO-System and it is assumed that the combined rating of a team is the mean of the memb... |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its alias command, which allows one command to invoke others. It may allow recursion (i.e. running alias freeze freeze will cause inputting freeze to freeze the engine), but does not allow parameters (i.e. running "alias define ... |
I had asked a question here about this before but it had a lot of vagueness to it, so I'll rephrase the entire thing.
I'm trying to create a PRNG that would replicate Borge's Library of Babel, i.e. 3200 characters made of 29 individual characters (26 alphabets, space, comma and period). Yes, I know libraryofbabel.info ... |
In Boolean Satisfiability of CNF formulae we have $k$-SAT where each clause has at most $k$ literals. It is well known that $k$-SAT is polynomial time reducible to $3$-SAT. It is also well known that $2$-SAT is solvable in polynomial time whereas $3$-SAT is NP-Complete (and therefore $k$-SAT $(k \gt 2)$ is NP-Complete ... |
For an Algorithms course we are studying propositional calculus. As an excercise we are given formal statements which we are to explain in natural language first and then evaluate with specific values. As a very simple example, which will serve us to clarify matters of notation, statements are of the form
$$\langle \su... |
In Gödel, Escher, Bach Chapter XIII: BlooP and FlooP and GlooP, Douglas Hofstadter states that:
This puts us in the uncomfortable position of asserting that people can calculate Reddiag[N] for any value of N, but there is no way to program a computer to do so.
How come this is true? What if Reddiag[N] = 1 + Reddiag[N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.