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
3
votes
0 answers

Obtaining computation graph structure of a forward pass in pytorch

Is there any way that we can automatically extract a computation graph that represents the forward pass in a series of pytorch computations? We would like the nodes in the graph to have access to the functions that make up the forward pass, so that…
Hanson Lu
  • 31
  • 4
3
votes
2 answers

Getting 0 in R instead of a precise result

How can I get the actual precise result instead of the rounded ones? result = ((0.61)**(10435)*(0.39)**(6565))/((0.63)**(5023)*(0.60)**(5412)*(0.37)**(2977)*(0.40)**(3588)) out: NaN Because, denominator is 0
Mine
  • 831
  • 1
  • 8
  • 27
3
votes
1 answer

Ruby puts not outputting in real time

I've started some problems on Project Euler. One of the questions: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? I have some code written up...and it works: class Integer def…
Jordan Arsenault
  • 7,100
  • 8
  • 53
  • 96
3
votes
1 answer

Using Orleans, how to implement distributed computation with distributed data storage?

I am new to distributed computation and orleans, recently do some research on those,and not sure whether orleans can be used for new task. This task is that, there are many projects belong to different people and each project has a lot of data. For…
Ryan Zhou
  • 78
  • 8
3
votes
1 answer

Implementing derivatives of logs of data in python

We have two lists (vectors) of data, y and x, we can imagine x being time steps (0,1,2,...) and y some system property computed at value each value of x. I'm interested in calculating the derivative of log of y with respect to log of x, and the…
user929304
  • 465
  • 1
  • 5
  • 21
3
votes
0 answers

How to use matlab crossval do the computation for one of the partitions (in k-fold cross validation)

I'm trying to apply cross validated LDA using matlab cross validation method. To do this I put the crossval() in a loop and in each loop I extract corresponding train and test labels and feature matrix (trFV, tsFV). It's like the example presented…
SddS
  • 587
  • 1
  • 5
  • 17
3
votes
1 answer

How can I prove a language is context-free if I remove one character from its alphabet?

Suppose that we have a language L that is context free,and 'a' among others belongs to its alphabet. How can I prove that the language ERASEa(L),that removes all instances of the character 'a' in the strings produced by L (f.e. abbac -> bbc), is…
3
votes
2 answers

Python: how to compute a fast measure of robustness on a network?

I am working with a regular NxN network, and I need to determine a measure of its robustness (namely, the ability to withstand failures). To do this, I am using the average node connectivity, which is described by this function. However, this…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
3
votes
2 answers

Intro to Computation and Programming Using Python

I am trying to solve Finger Exercise 3.1, and I can't figure out what I am doing wrong here. When I enter '1' as the integer, it returns 0 and 0. I am a complete newbie to programming and Stack Overflow, so I'm not sure if I am doing this correctly,…
Jen Hodges
  • 33
  • 4
3
votes
1 answer

Median Absolute Deviation Computation in R

A quite confusing thing is what I got: The Median Absolute Deviation output of the following vector is vec = c( -5.665488 ,3.963051, 14.14956, 0, -5.665488) > mad(vec) [1] 8.399653 However, if I compute that I got the following value: Median…
Tunc Jamgocyan
  • 321
  • 2
  • 7
  • 18
3
votes
1 answer

How does node "actually" handle threads?

I read a lot about node js trying to understand the event loop and its patterns / anti patterns. One thing that many authors fail to mentions that node actually handles threads. The application programmer however doesn't get access to them of…
Gustav
  • 1,361
  • 1
  • 12
  • 24
3
votes
1 answer

How can Matlab or Octave be so fast?

I am really confused about the computation speed of Matlab or Octave. How is it possible to give the result of a computation like 5^5^5^5 (= 2.351*10^87 if you wanna know) instantly? I found some results about the speed for matrix computations…
Happy
  • 1,815
  • 2
  • 18
  • 33
3
votes
4 answers

To handle rational number without losing accuracy of computation in Matlab?

I want to use this rational number in computations without losing the accuracy of the picture in Matlab: f = 359.0 + 16241/16250.0 I think storing, for instance by f = uint64(359.0 + 16241/16250.0) loses accuracy, seen as 360 in Matlab. I think the…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
3
votes
2 answers

Each cell wise operation based on condition in matlab

I don't know whether this is possible without iterating the matrix, but here goes the question. For any given square matrix say 'M', and a particular value say 'key'. I want to compute a new matrix (say 'NM') such that, if M(i,j) < key; compute…
2
votes
1 answer

bash deletes my file while looping "~$ ./program > file.dat" (gnuplot)

I'm doing some script on bash to plot data with gnuplot. But it doesn't work. I have a program which throws data to the command line. I collect that data on a file and then I loop this process over to get the desired result. Say I have this script …
stringparser
  • 735
  • 1
  • 6
  • 16
1 2
3
26 27