Questions tagged [computation]

Computation is paramount to the discipline of computer science, and deals with the type and use of computing technology in information processing, in particular, in the context of an algorithm, or a protocol.

From Wiki

In the theory of computation, a diversity of mathematical models of computers have been developed. Typical mathematical models of computers are the following:

  • State models including Turing machine, push-down automaton, finite state automaton, and PRAM
  • Functional models including lambda calculus
  • Logical models including logic programming
  • Concurrent models including actor model and process calculi
404 questions
0
votes
1 answer

How do I find the roots of the function $f(\beta) = \gamma + [1-e^{-j\beta}]/[1-e^{(-j+1)\beta}]$, using python

I have the following equation which I cannot find a closed form solution for $\beta$, thus I would like to solve for $\beta$ computationally: $$\gamma = \frac{1-e^{-jT\beta}}{1-e^{-(j+1)T\beta}}$$ variables $\gamma$, $j$ and $T$ are known.…
Tian
  • 870
  • 3
  • 12
  • 24
0
votes
1 answer

Turing Machine with non trivial states and transitions

Please give me some idea as to how to go about this Draw a Turing machine (using Sipser notation) having at least 4 nontrivial (i.e., nonrejecting) states and at least six nontrivial (i.e., not to the rejecting state) transitions.
Priya
  • 69
  • 2
  • 8
0
votes
2 answers

How to calculate how many bit sequences of size n with k bits set and c changes of bit values exist?

We know that calculating the number of n-length bit sequences with k bits set is equal to C(n,k)=n!/(k!(n-k)!)*. But I've recently asked myself how can you think about this problem once another condition is set: The number of bit value changes. For…
Eduard
  • 127
  • 4
0
votes
3 answers

Why am I getting only marginal improvements in time when I cut the computations in half?

I wanted to write a program which will print and count all the primes between 1 and k. The idea is that we take each odd number i between 1 and k and check for odd factors of i up to sqrt(i). It took my computer 1 minute 47 seconds to go check for…
Ovi
  • 573
  • 2
  • 5
  • 16
0
votes
4 answers

Sign computation with a macro

What the following expression computes, exactly? #define SIGN(x) ((x < 0) ? -1 : (x > 0)) what yields if x is zero, less than zero, more than zero? I guess I know the answer, but I'd like to check for clarity... Thank you EDIT: added missing…
Kabu
  • 519
  • 6
  • 16
0
votes
2 answers

Output arrayfun into trid dimension of the matrix in MATLAB

Assume that I have a matrix A = rand(n,m). I want to compute matrix B with size n x n x m, where B(:,:,i) = A(:,i)*A(:,i)'; The code that can produce this is quite simple: A = rand(n,m); B = zeros(n,n,m); for i=1:m B(:,:,i) =…
0
votes
0 answers

Computing weight in Julia for Graph construction

Here is the way I implemented my Graph vertices and Edges in Julia for an optimization problem concerning Schedule Recovery Just concentrate on the two last code functions empty_graph and add_label!, the other code is just informative about the…
Alexo
  • 49
  • 7
0
votes
1 answer

How to reduce the computation time for an R program

I am performing prediction on time series data but I am struggling with reducing the computation time. This is the code sample. So the code actually predicts temperature for different monitoring stations. For 134 stations, it takes like 10 minutes…
Sachit
  • 5
  • 1
  • 4
0
votes
2 answers

L = { : TM does not accept any thing }

L = { : TM does not accept any thing } We can feed strings to TM one by one as long as TM will accept. If there are no such strings , then this process will go infinite time so we can not decide. Hence Recursive Enumerable. P =…
0
votes
0 answers

How do I get better at finding a CFG and PDA for a language?

I seem to be having a lot of trouble finding CFGs and PDAs for languages. Even with languages that are considered generally simple, I find myself taking too long to find a CFG and PDA for it. Am I simple overthinking it or does this skill just get…
0
votes
1 answer

Music21 to get sample of time and frequencies in txt or csv

I'm getting familiar with python but I just discovered music21 and even if I'm currently reading as much as possible from the documentation, I'm having a hard time finding simple answer to my simple question: How to sample a piece of music (say…
Etsaf
  • 167
  • 7
0
votes
0 answers

Computation Speed Local vs Dedicated Web Server

I have been developing a simulation model in my local environment as a way to learn how to code (I am using PHP). In my current environment it is taking around 30 seconds to run 1 simulation. I was expecting this to be much quicker. My theory is…
gente002
  • 63
  • 1
  • 9
0
votes
0 answers

Python ,faster computation

i am trying to read a dataset and apply some information retrieval code. this code is supposed to read a list of strings calculate and present the 10 most frequently used words, along with their frequencies. The code seems to be working but since…
0
votes
0 answers

java multi-threading data race in parallel computation

hey guys i am doing a undergrad math research and i wrote a java program to do lots of computation. First i need to find all the 4-elements combination out of let's say 2500(can be way more up to 300 * 300) elements, then i need to test every…
BYsBro
  • 65
  • 1
  • 3
0
votes
2 answers

All combinations of dividing an integer into several "groups"

Let's say I= have 5 sweets and I want to find all possible combinations of sharing them among my 3 kids. This will be like something below: 5 for kid_A, 0 for kid_B, 0 for kid_3 0 for kid_A, 5 for kid_B, 0 for kid_3 .... 4 for kid_A, 1 for kid_B, 0…
AliAs
  • 93
  • 1
  • 1
  • 12