instruction stringlengths 35 29.1k |
|---|
I can't find this anywhere online. Is bitcoin mining NP-Hard?
If so, how would we be able to prove a reduction from a known NP-hard problem? I am a bit lost.
|
I am a bit confused about how the logical addresses are generated in a paging memory architecture and where and when a program is split up into pages.
I understand how logical addresses are translated to physical addresses and everything that happens after that. I just don't understand how a program is split into disti... |
How is a conditional branch instruction implemented in hardware? The instruction checks the sign bit, how does it decide to load pc with the branch address or increment pc to the next sequential address?
|
I have faced the following problem in an entrance examination, and need to verify a few results plus a question part that did not manage to get in time.
Given an array $A$ of length $n$ which contains all integers $1,\ldots,m$, the goal is to find a consecutive subarray of $A$ containing the integers $1,\ldots,m$ which... |
Given a network flow and there exists (u,v) edge with positive capacity and there is not path from $s$ to $u$. and $(u,v)$ is with full capacity in some maximal flow.
I've had this questions with true or false and I thought it was false but apparently it is true.
Can someone please explain me how this is possible?
|
This question seems to be causing a lot of debate and I'm wondering whether my working is correct.
A computer with a single cache (access time 20ns) and main memory (access
time 500ns) also uses the hard disk (average access time 0.01ms) for virtual
memory using paging. If it is found that the cache hit rate is 95% an... |
To begin with, consider two persons(Px and Py) are playing a game. Px is the organiser of the game who has n sticks of distinct lengths and displaying them one by one to Py in a random order, with each order being equally likely. Given the fact that the lengths of sticks are not known to Py in advance. On each step, Py... |
I have an example: m = n = p = (-1) ^ (m + n + p) * (m + n + p);
I don't know what to do with multiple "=". Should I treat them as a sign with the lowest priority or just put them in end of the answer?
That's what I get when I treat them as sign with the lowest prioryty:
M,N,=,P,=,1,NEG,M,N,+,P,+,^,M,N,+,P,+,*,=
Could ... |
Given an undirected graph $G=(V,E)$ a Gomory-Hu tree $T$ for $G$ has the following properties:
$T$ has a node for each vertex in the graph G and each edge in the tree corresponds to a minimum cut separating the corresponding pair of vertices of G.
$T$ has the property that the minimum cut between vertices $s$ and $t$ ... |
I have found an exercise where it tasks to provide a grammar and a pushdown automata for
$L = \{ 0^x1^y0^z1^w | x+w=y+z\}$
While finding a pushdown automata for it is quite easy (four states and two stack symbols $p$ and $t$, where $0^x$'s push $p$, $1^t$'s and $0^z$'s pop $p$ or push $t$ if there are no $p$'s, and $1^... |
I know the working of 2-opt and 3-opt local search algorithm. But I could not find any example where solution improvement is not possible using 2-opt but 3-opt. I am looking for a proper explanation along with diagrams where TSP solution is not improved by 2-opt but 3-Opt can improve it.
|
I am amazed by the many discussion regarding the existence of any linear and in-place sorting algorithm, and variants, see e.g.
is-this-implementation-of-bucket-sort-considered-in-place
is-counting-sort-in-place-stable-or-not
sorting-in-linear-time-and-in-place
can-a-counting-sort-be-considered-in-place-when-the-proble... |
Does the cpu interface with a memory controller to read the cache? What happens when data is not in the cache, a cache miss, does it automatically fetch the data?
|
In a cpu with segmented memory, can an address only be accessed with a segmented address, or can a normal virtual address also be used?
|
Suppose there is a polynomial time reduction from problem $A$ to $B$.
Why is the following false?
If $B$ is NP-hard then $A$ is NP-hard.
Can some explain this intuitively?
|
I know some basic machine learning and deep learning. Now a days deep learning solve many types of problem. I working working optimization problem like np, np hard problem. Is there any hope to solve np hard problem using deep learning
|
Depending on the API/language you use, splitting the string "ABCD" using "" as a delimiter gets you:
["A", "B", "C", "D"] in Java, Javascript, and Go
["", "A", "B", "C", "D", ""] in Rust
["ABCD"] in C#
Fails with an Exception in Python3
From the perspective of formal language design, what is the correct result of suc... |
https://en.wikipedia.org/wiki/Type_inhabitation
The wiki article above says,
To be sound, such a system must have uninhabited types.
What is the definition an uninhabitated type? Do all programming languages have uninhabited types? What would be an example in Haskell? Or C? Or Java? Or Python?
|
As far as I know, finite languages have a finite number of strings or words, while context-free languages are generated by context-free grammars. I don't know which aspect should I know that they are correlated with. All I know is that finite languages are regular, and regular languages are context-free. How should I k... |
The types of problems I am trying to solve are as follows:
Given a set of co-ordinates such as: (1,2), (3,3), (6,2), (7,1), a value of k such as k=3 and an initial set of centroids such as c1=(2,2) and c2=(5,4), perform the k-means/median algorithm.
Now, with samples that small, I can easily work it out on paper. Howev... |
We have the following operation $\text{IF} \ x_i =0 \ \text{THEN} \ P \ \text{END}$. I want to simulate this using a $\text{LOOP}$ program. Here is what I have:
$$\text{IF} \ x_i = 0 \ \text{THEN} \ P \ \text{END} \ ≙
\begin{cases}
x_j := 1; \\
\text{LOOP} \ x_i \ \text{DO} \ x_j := 0 \ \text{END}; \\
... |
In this site here they have just said how to minimize a function using VEM. But no intuitive logic behind the same has been stated, making it too mechanical. And I am very bad at memorizing things, so an intuitive logic behind the same would help me a lot to solve problems using this problems independently.
|
I would like a review for my algorithm for the following question:
A flow network is a “balanced network” if for every $v∈V- {s,t}$ it holds that $c_in (v)=c_out (v).$
Let G be a balanced network in which in-degree(s)=out-degree(t)=0
Find max-flow for G.
My Algorithm so far:
We will define the following capacity-funct... |
From wikipedia:
In type theory, a theory within mathematical logic, the bottom type is the type that has no values. It is also called the zero or empty type, and is sometimes denoted with the up tack (⊥) symbol.
The "bottomest" types I can think of in js are undefined and null, both unity types.
Notice how in TypeScr... |
I have a simple graph $G = (V,E)$ and each vertex has a range $[a,b]$. Every two vertices are connected only if $[a_1, b_1]$ and $[a_2, b_2]$ have a common subrange.
Each range of vertex is rV1 = [0,5] rV2 = [1,3] rV3 = [2,10]
rV4 = [4,9] rV5 = [6,7] rV6 = [8,12] rV7 = [11,13]
Graph Created based on above ranges.
Based... |
I am quite new to python. I want to create a Python program to output the smallest palindromic number above a given input. But this input can be up to 20 digits. I tried finding all the palindromic numbers and adding them to a list. But it seems like for 20 digit numbers, it is a very long process. What python code wou... |
I want to make a facial recognition project but my coding ability is very limited so I am going to be relying on other peoples code but if i use their code even if i change the variables and make different functions to add their code under would that still be considered plagerism ?
|
I ran into an interview two days ago and came across one strange definition of safe edge.
We are given an undirected weighted Graph $G = (V,E)$ with all distinct edge weights. Assume that the graph is connected.
Safe Edge Definition: if an edge $e \in E$ is not contained in any cycle, we called it a safe edge
Followi... |
When we plan the motion of a robot we may apply the trapezoidal
decomposition of free space. While applying the trapezoidal
decomposition we add nodes to both the centers of trapezoids and
vertical walls.
When a robot wants to traverse between obstacles it avoids the obstacles
by following the nodes added. The nodes ... |
theoretically, the state is between the two kleene-stars of the work-alphabet
gamma* q gamma*
where q is the current state and each gamma* is the content of one of both stacks. But where is "the middle" with the state? Regarding the one tape of the classical Turing Machine it is obvious.
Yours,
von Spotz
|
Maybe the title is bad format but, I want to ask if is possible proof the Segment Tree complexity with the recursion tree.
In other words I'm making a simple report on segment tree and I want to try to prove with a simple image that the complexity time on each query is O(log N), so to do that I make a simple assertion ... |
I would like to double check myself.
As I understand time complexity of comparing two strings in the worst case is $O(n)$, where $n$ is the length of the strings (let's say they are equal length).
In case I have $N$ strings and I would like to know whether they are all different.
Is there an algorithm for this that is ... |
Suppose I have two sets of integers $A$ and $B$ and I have a sketch data structure described by a function $\mathsf{sketch}_n : \mathcal{P}(\mathbb{Z}) \to 2^n$ that returns a bitstring of size $n$. These sketches can be checked for disjointness with a function $\mathsf{disjoint}_n : 2^n \times 2^n \to 2$, where if $\m... |
I'm learning about computable functions. Our definition for computable function is as follows:
Informally, a computable function is a function f : A → B such
that there is a mechanical procedure for computing the result
f(a) ∈ B for every a ∈ A.
they go on to give the following non-example:
A function that takes an ... |
Since reproducibility is a major principle or basic norm of scientific experiments, simulations, and computations, what would you do or what to do if the author of a published CS article does not respond to code requests?
Thanks a lot!
|
Problem Statement: Given a string/pattern only consisting of '<' and '>' symbol, find the lexicographically smallest string that satisfies the pattern(made up of only lowercase english alphabets). Some examples are given below for better understanding.
Examples:
Input(String) - '>>'
Output(String) - 'cba' (because c >... |
is it correct to compute the average case time complexity of an algorithm by taking the mean of the best and worst cases ? My findings : for binary search, $\frac{\log (n) +1}{2}\in \Theta \left(\log (n )\right)\implies $ the average case is $\log (n).$
|
How we can prove that:
$$
\sum_{k=1}^{c \log n-1}\:k\cdot \left(\frac{1}{2}\right)^{\frac{k}{3}}\in O\left(1\right) \quad \mbox{?}
$$
|
I want to convert an IF statement for my optimization problem. I want to minimize the total price. I want 800 tones of salt and 3 suppliers offer me their prices.
Supplier $1$ offers me $100$ tones at $\\\$150$ a tone.
Supplier $2$ offers me $400$ tones at $\\\$170$ a tone, if I take $300$ tones (or more)the price drop... |
I'm not sure if I understand the difference between Turing Complete and Turing Equivalent programming languages.
A computational system that can compute every Turing-computable
function is called Turing-complete (or Turing-powerful).
A Turing-complete system is called Turing-equivalent if every function
it can compute... |
I have read (in this question) that this recursion can't be solved via Master Theorem.
But I couldn't find exact and complete proof why the Master Theorem does not apply.
|
I need to compress a string in my application but I am very limited in the operations I can perform. In particular, I cannot store data in any file and I cannot query any database. Also, I cannot call any library so I have to code my own data compression algorithm. What would be the simplest algorithm to achieve this g... |
Suppose I have a sorting algorithm that sorts a list integers. When the input size(the number of elements) $n$ is odd, it sorts using Bubble Sort and for even $n$ it uses Merge Sort. How do we perform the worst-case time complexity analysis for this algorithm?
The context in which this question came about is when I was... |
Is object oriented programming considered to be a declarative programming approach?
On Wikipedia, it is said that OOP tries to extend the imperative programming paradigm to a somewhat declarative programming approach, but what precisely makes OOP imperative or declarative?
|
I want to know how switch-efficient a multiplier can be. If I need to do many $N$-bit by $N$-bit multiplies, and each bit is determined by flipping a coin, what's the average number of transistor switches that will be required per multiply, in terms of $N$?
|
Can we design an algorithm to test if a infinite regular language is a code?
We have the S-P algorithm to determinate if a finite language is a code. But how about the infinite part of regular languages?
If we have a regex which describes our set of words, then is it possible to modify the S-P algorithm to work on an i... |
How can I convert a XOR statement into linear constraints for integer programming ?
The expression is $(x_1 \geq 1)$ XOR $(x_2 \geq 1)$ where $x_1$ and $x_2$ are integer. It means that if $x_1 \geq 1$ then $x_2 = 0$ and vice versa.
I started to linearize the statement by :
$(x_1 \geq 1)$ XOR $(x_2 \geq 1) = (x_1 \geq 1... |
I was reading Complexity: The Emerging Science at the Edge of Order and
Chaos and a certain passage got me really intrigued. When discussing
Chris Langton's explorations of artificial life algorithms, the author
paraphrases Langton stating the following about a certain set of
evolutionary algorithms:
This is the unde... |
Let $\Sigma = \{a,b,c,\ldots,x,y,z\}$ be the Latin alphabet, consisting of 26 letters. Consider the language $L$ of all words $\alpha$ over $\Sigma$ satisfying the following constraints:
If $\alpha$ contains $a$ then it contains exactly $4$ many $a$s.
If $\alpha$ contains $b$ then it contains exactly $8$ many $b$s.
..... |
So watching many youtube channels, the explanation to the impossibility of solving the halting problen involves assuming you can, doing the opposite, and feeding it back into itself to create a paradox.
What I don't get is why this is an (over)simplification. The logic seems to check out. What is the flaw in this reaso... |
I'm trying to prove the following reduction:
$$
t\{x:=u\}\{y:=v\} = t\{y:=v\}\{x:=u\{y:=v\}\}
$$
under the following assumptions:
$x \neq y$
$x$ is not a free variable of $v$ (in symbols, $x \notin \operatorname{fv}(v)$).
My idea is to do it by induction, but I'm a bit stuck with the base case. I would appreciat... |
I understand that we might need hierarchical paging to handle page tables with sizes greater than the size of one frame, but what is the use of Hashed Page tables then? I would understand if we were storing page-numbers and mapped frame numbers as $key-value$ pairs, because then hashing would make the process of access... |
Let $L_0 = \{ \langle M, w, 0 \rangle \mid M \text{ halts on } w\}$ and $L_1 = \{\langle M, w, 1\rangle \mid M \text{ does not halt on } w\}$.
In $\langle M,w,i \rangle$, the $i$ indicates a specific bit such as $0$ for language $L_0$ and $1$ for language $L_1$.
I want to prove that $L = L_0 \cup L_1$ is unrecognizable... |
I am just learning backpropagation algorithm for NN and currently I am stuck with the right derivative of Binary Cross Entropy as loss function.
Here it is:
def binary_crossentropy(y, y_out):
return -1 * (y * np.log(y_out) + (1-y)*np.log(1-y_out))
def binary_crossentropy_dev(y, y_out):
return binary_crossentro... |
PRE-WORK-POST is a theoretical programming language with the following structure, where P,Q and R are LOOP program:
$$\text{PRE} \ P \ \text{WORK} \ Q \ \text{POST} \ R \ \text{END}$$
First $P$ is executed. Then $Q$ is executed until $x_0 \neq 0$. Finally $R$ is executed. I have to prove that PRE-WORK-POST is Turing c... |
I'm currently studying Sequential consistency vs linearizability:
I know that SC has to be consistent with the order of how the individual client issued them, and for linearizability, it's with the real-time ordering.
What I don't understand is:
"The interleaved sequence of operations meets the specification of a (sing... |
If a decision problem is in P, is the associated optimization problem then also efficiently solvable?
I always thought that this is the case but according to Wikipedia page on Decision Problems the complexity of a decision and function problem might differ and to me a function problem was always a special case of an op... |
I'm trying to solve this problem - https://codeforces.com/problemset/problem/711/E
I've already found and proved that the result is equal to:
$$
1 - \frac{2^n (2^n - 1) \cdots (2 ^ n - k + 1)}{2^{nk}}.
$$
Now I need to compute it, and it's hard as $n$ and $k$ could both be as large as $10^{18}$. Computing $2^{nk}$ ... |
I have found a problem about proving whether $L^{|2|}=\{w_1w_2 \mid w_1,w_2\in L, |w_1|=|w_2|\}$ is context-free or not, knowing that $L$ is regular
So far I know that:
There are examples where $L$ is regular and $L^{|2|}$ is regular (for example $L=\{a,b\}$)
There are examples where $L$ is regular and $L^{|2|}$ is no... |
This is a rather well known solution to the $k$-th order statistic problem which requires us to find the $k$-th largest number in an unsorted array with $n$ elements where $1 \leq k \leq n$:
public int findKthLargest(int[] nums, int k) {
PriorityQueue<Integer> heap = new PriorityQueue<Integer>();
... |
How can I compare $(\log^*n)!$ with $(n\log n)^b$?
I know that $n^b<n!$.
|
I want to prove any AVL tree can be turnt into a red-black tree by coloring nodes appropriately.
Let $h$ be the height of a subtree of an AVL tree.
It is given that such a coloring is constrained by these cases:
$h$ even $\implies$ black height $=$ $\frac{h}{2} + 1$, root node black
$h$ odd $\implies$ black height $=$... |
For optimization problems, I found complexity classes analog to some classes for decision problems, e.g. PO and NPO, mirroring P and NP for decision problems in the sense that optimization problems in PO can be solved in polynomial time and verified in polynomial time, respectively.
Are there similar class definitions ... |
I know the proof that using nondeterministic TM, but as I understood there is another proof without nondeterministic TM.
If you answer please write with as much details as you can.
|
Suppose I am a bus transportation company. I have n buses. I want to change the bus routes so that the "average" commuter spends as little time on the bus as possible, while being able to arrive at as close to their final bus station at their desired time as reasonably possible.
Inputs: Origin bus stations, destination... |
Say we have two sets of points in vector-2 space (In actuality need to solve this problem in vector-3 space but decided to start with a simpler problem). The points in the second set are the result of transformation of the points in the first set. It's not known which point in the first set corresponds to which point i... |
I'm trying to build a scheduling app for a friend, but am stuck on how to sort the employees.
I have three holidays each with their own employee_need:
thanks_giving: 2
christmas: 3
new_years_eve: 2
I have employees who have a predetermined number of days they will work. The sum of the employee’s predetermined work days... |
For the function $f(n) = 100n + 5$, what is the asymptotic complexity of $f(n)$ in terms of Big O notation. I guess it is $O(n)$, but how can I prove it ?
|
Can we classify a supercomputer in more than one group? For example, Flynn's classification, classification according to topology, classification according to memory access.
For the Summit supercomputer, I have found no sources on these topics, except for Flynn's classification. How can I classify it in other categorie... |
Let us say you have a function $C_n = (-2)^n + 2^n$.
It would seem that it would be correct to assume that the running time of this algorithm would be $O(2^n)$.
However, how would I go about arguing this? The rule I had in mind would be that $a^n$ is $O(b^n)$ if $0 < a \leq b$. But since $a$ is $< 0$, this rule cannot ... |
I am approaching a problem where, among other things, I will have to repeatedly check if a point is within a (set of) polygon(s) in the 2D plane.
the polygons are either convex or star-shaped with a non-singular kernel
if multiple polygons, they touch each other (have at least a side in common with another polygon of ... |
I want to implement a recommender system based on collaborative filtering. Each user will have a set of visualized items (0-1's) and based on that similitude the recommendation will be generated.
In order to develop this, I was thinking of using the Jaccard similarity coefficient (if anyone has a better suggestion plea... |
In a relation R, if X is some set of attributes and Y is some prime attribute such that X uniquely determines Y is a non-trivial FD. Then is it true that R has at least two candidate keys?
For instance, take the relation schema R(Class_Id, Course_Number, Instructor_Name, Text). {Class_Id, Course_number} is a candidate... |
In our assignment we are given a grammar (called minipython) and we are asked to implement some phases of compilation (parsing, some semantic analysis).
One of the requirements is to be able to check for types in an arithmetic expression (arithmetic expressions are only defined for integers). For example in the below c... |
The sorting algorithms (merge-sort, quicksort...) are tought to have an absolutely hard lower bound which can not be outperformed by computation alone and this bound is $n*log_{2}(n)$,
The reason for this bound is that those algorithms are using the division by two devide and conquer method and as such they generate a ... |
Regarding the following languages $L_1$ and $L_2$, I want to prove that $L_1$ is decidable and $L_2$ is undecidable. I want to construct a turing machine which can decide $L_1$ and reduce the halting problem to $L_2$.
$L_1$:
On input $w$ the turing machine $M$ never moves it's reading/writing head left. Where $w \in \... |
Let $\langle M\rangle$ be the encoding of a Turing machine as a string over $\Sigma=\{0,1\}$, and consider the language $L=\{\langle M\rangle| \text{ $M$ is a Turing machine that accepts a string of length 2014} \}$
I want to use The Rice-McNaughton-Myhill-Shapiro Theorem (page 14 in this) to prove that $L$ is acceptab... |
I am trying to understand the Mahalanobis distance of a point from the plane given by this paper. The algorithm is given below:
Calculate covariance of point $S_{uu}$
Apply a whitening transform to the covariance matrix using SVD where $S_{uu} = RVR^T$. $R$ is the rotation matrix and $V$ is the scale $V = diag(a^2, b^... |
So I'm currently reading about neuroevolution (NEAT, WANN) and trying to make my own implementation just as an exercise. Now I want to test if my feedforward implementation gives the expected output. I'm doing this manually right now and it's starting to get tedious, specially since the resulting topology is kind of cr... |
There's a gacha RPG I'm trying to get better at.
I estimate there are about 10^15 states for the 3 opening rounds of a match for which I am trying to evaluate damage output.
The equations themselves aren't complicated: mostly linear ones, with the odd division and factorial with small integers (less then n=10) thrown i... |
I am looking for a pairing function with linear time complexity.
I found
one in Steven Pigeon's thesis (p 115, §5.3.6.3) described in English on MathOverflow that works by bit interleaving.
another from Regan's 1992 paper (p 289, last paragraph) that works by bit concatenation based on a state machine.
The one from P... |
Basically, it's this rosalind problem.
You're given a number of nodes and an adjacency list.
My initial guess was that the answer was the number of connected components minus 1, since by joining every connected component you would have a connected graph, and since it's stated that there are no cycles, that would be a t... |
In brief:
Here I have a cyclic graph above. I want to partition the graph vertices into 3 clusters. (With the mindset of cluster-wise "load balancing")
Constraint: All the vertices in each cluster should be directly connected.
Goal: the deviance of the cluster-sums should be as small as possible. (In other words, the... |
While reading a paper (On the k-coloring of intervals), I came upon the following description:
"Input: An integer k, and a set of n intervals sorted by right and left endpoints. The intervals are indexed in order of increasing right endpoint, and it is assumed that all endpoints are positive integers."
What does it mea... |
I want to calculate the RMS AC value of a signal made up of several thousand readings every second. The processor that I am using doesn't have enough memory to store a whole second of data, so I want to calculate it the sum of squares the fly.
This is the normal formula to calculate the RMS AC value, where you have to ... |
Make is a very common English word and consequently I cannot find the answer using google.
I am writing a script to automate all the data generation process, which resembles what GNU make does.
I am curious to know which type of algorithm GNU make uses under the hood. I suppose it is some sort topological sort with BFS... |
I'm studying for my finals and I came across this question from past exams:
Is the following language decidable?
$$ L = \{ \langle M_1,M_2,w \rangle \mid w \in L(M_1) \setminus L(M_2) \}. $$
How can I be sure of my answer? Is there any way to know for sure?
|
I am currently working on my Master thesis on the visualization of music structure and I'm looking to find an optimal description of repetitions found in a piece of music.
Problem Description
Given a section range in a song in seconds (or samples) , e.g. [10,20], I can look up where this section is repeated. Then we en... |
I want to check if I understood it in the right way.
In some example where $L\in RE$ the explanation deal with 2 cases: 1st when $L$ finite and 2nd when $L$ infinite. In the second case $L\in R$, isn't? Is it possible somehow that $L\in RE\setminus R$ be finite?
|
I read this paper obout simCLR and I didn't understand a few things:
What is the goal of the temperature parameter τ? How does it affect the loss?
What will be the value of the loss for a batch with 2N identical samples? Is there a mathematical formulation?
In that case (question 2), will different temperature values ... |
Give two Prolog implementations to calculate the sum of first N numbers divisible by 3. For example: N=4 -> 30 (3+6+9+12).
sum(N,I,C,C):-!.
sum(N,I,C,R):-
I mod 3 =:= 0,
C1 is C+I,
I1 is I+1,
sum(N,I1,C1,R).
sum(N,I,C,R):-
not(I mod 3 =:= 0),
I1 is I+1,
sum(N,I1,C,R).
I tried like this, bu... |
Is there a polynomial time algorithm to determine the number of reachable states in the subset construction of a NFA to a DFA without having to construct the entire DFA?
|
I'm trying to understand the reduction as a flowchart graph.
Let's say the boxes $A$ and $B$ are TMs/Functions and $x$ is the input.
Is this plot represent reduction from $A$ to $B$ ($A\le B$) or from $B$ to $A$ ($B\le A$)?
Or maybe it can be both of the way depending on the context?
|
It is well-known that the Sierpiński space, $\{F,T\}$ endowed with topology $\{\emptyset, \{F\},\{F,T\}\}$, is admissible. I tried to implement it in Haskell.
First I implement $\mathbb{N}$ (including zero; some topologists might prefer denoting it by $S_\omega$) by Peano definition:
data Peano = Zero | Succ Peano deri... |
Imagine I want to construct a total order from a set of elements, $E$, but the comparison function produces results that are non-deterministic. I produce a list of element pairs (e, e) through repeated application of the comparison function, such that each element in the set is represented at least once.
How can I use ... |
On an imperative programming language, let us consider the following program:
for i in 0..N { // N is the length of the arrays A, B, C.
A[i] = A[i] + B[i];
}
for i in 0..N {
A[i] = A[i] + C[i];
}
This program just sums three arrays $A + B + C$ component-wisely and store it to $A$.
We can easily transform this prog... |
For a research project, I tried to prove or disprove that a function called xxhash128_low is a bijection from 64 bit unsigned integer to 64 bit unsigned integer. I have shown that it is sufficient to prove that the following critical code is a bijection:
Input: a 64-bit integer x
0. Let c=0x9e3779b185ebcaa7
1. Let x_lo... |
I am trying to find a grammar for $L=\{a^nb^mc^rd^s| n+m<r+s\}$, which has the hint of it having "some similarity" to $L=\{a^ib^j|i<j\}$
This last one is quite easy to get ($S\to aSb | Sb | b$), but still I am unsure on how to proceed.
I expect to manipulate the language by differentiating cases, and for example I foun... |
Context
This question is related to the fact one can't use Bellman-Ford to find max weight paths in directed graphs with cycles. The reason is that giving a new graph $\tilde{G}$ with negative weights (e.g. $\tilde{w}_{ij} = - w_{ij}$) will result in cycles with negative sum, thus no minimum cost walk exists in $\tilde... |
My question is not about how arraylists or linked-lists work, but why there aren't other types of lists.
From my understanding, memory is accessed linearly by adresses. Thus, you have the choice to use property for your list or not to.
In the case of a arraylist, you know where an item lies by looking where the element... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.