# Questions tagged [programming]

For mathematical questions related to programming, and questions where a computer-aided solution is strongly suggested. A strong connection with a mathematical topic is needed to make programming questions on-topic. This should not be the only tag. Consider also using the tags (algorithms), (numerical-methods), or (linear-programming).

395 questions
Filter by
Sorted by
Tagged with
24 views

### I am trying to solve a non-linear equation. In the matlab program, I'm stuck up.

One of the problems could be that, I want a matrix of order 33 but the output is 44, with first row and first column consisting of zeros. Can someone help ! n=5; m=5; T=1; for i=2:n-1 for q=2:m-1 ...
25 views

### Statistical interpretation of entropy [closed]

I am making a program in wxmaxima ,it follows as shown below : ➡️how many coins are there? ➡️how many heads up? ➡️how many would you like to flip? ➡️how many times flipping? ➡️how many tosses per ...
23 views

### Is the operation $i = x + y * \text{width}$ reversible?

In game programming, there is this very common operation we do to index positions in a two-dimensional matrix over a one-dimensional array. We basically associate the value $a_{xy}$ of some matrix $A$ ...
40 views

### How to find the GCDs of LCMs of all pairs of elements in the given sequence.

You are given a sequence $A$ of positive numbers where the number will not be larger than $200,000$. A multiset is created from the given sequence such that: $S = \{LCM(a_{i}, a_{j}) \;|\; i < j\}$....
29 views

### converging average of loop?

I ran the following script, It starts with a random number, then takes it's reciprocal and gets it's fractional part, Then it repeats it again, and takes average. ...
29 views

### Generalization of walks into graphs

When we have a graph with cycles, a walk is like a kind of path possibly unfolding some cycles. A special case in programming would be something like an execution going through some loops a certain ...
22 views

### Strongly Dependent-type languages (running on windows)

What are the best dépendent-type programming languages to learn about type-theory ? I heard about coq, agda, epigram and idris; are there any other ? And most importantly: wich one of these can easily ...
16 views

### Determine whether the combination of two legged animals and 4 legged animals are present

there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct. if ...
63 views

### Sampling from a distribution

In many cases we use sampling from a distribution. Also in programming languages they implement it. But I wonder now what is the process of generating a sample from a probability distribution? What ...
28 views

21 views

### Finding the dual problem with exponential equation

I need to find the dual problem of this: but I have no idea how to work with the norm or the exponential function
13 views

### Binary polynomial convolution-like or-ing

I have two binary polynomials. For example $a(t)$, $b(t)$. I would like an algorithm which calculates the binary polynomial $c(t)$ such that, $$c_n = \sum_{i=0}^{n} (a_i * b_{(n-i)} ) \, > 0.$$ ...