# Questions tagged [counting]

Questions on counting subparts of expressions, based on certain criteria. This is to be used with primary tags such as list-manipulation or string-manipulation, with the primary tag indicating the specific use case.

83 questions
Filter by
Sorted by
Tagged with
30 views

### Computation of operation count for the numerical evaluation in Mathematica

Is there any way to find the complexity of computation in Mathematica? There is a command in Maple that computes the number of multiplications, storage, and assignments. Is there any similar command ...
32 views

### ResetDirectory causes a fail on stored file names

Consider some directory dir with sub dirs and files. Our aim is to count the no of files in dir (not in sub-dirs, just the dir.) ...
23 views

### Counting the number of occurrences of all groupings (consecutive occurrences of the same number) in a list

If the variable "digits" contains a sequence of numbers how to count how many times each grouping of a number occurs? For instance, for number $1$ how many times it occurs once consequitivly ...
70 views

### Counting the number of occurrences of specific values in a list in specific intervals

If the variable "digits" contains 10,000 digits from 0 to 9. How can the number of occurrences of 1s and 2s be counted in every 1000 digit intervals, that is to say the number of 1s and 2s ...
42 views

### Count heads: e.g. neglect all terms $\sin(x) \sin (y) \sin (z) \sin (w)$ for all values of the argument

I have a polynomial (functional) expression $E[F]$ in terms of a function $F$. I want to take an $F$-cube truncation in the sense that I want to and make terms of the form $F[w]F[x]F[y]F[z]$ vanish ...
184 views

### How do I count zeros in sublists?

I have an array RandomInteger[1,{100,100}]. How do I count zeros in each sublist so that I have a list which gives the number of zeros of each sublist in the array?
140 views

### In Wolfram Mathematica, who do I query the result of a Counts operation efficiently and conveniently?

Setup Say, I'm given a dataset, like the one below: titanic = ExampleData[{"Dataset", "Titanic"}]; titanic Answering with: And I want to count the occurrences ...
154 views

### Count for SparseArray

Why does Count not work with SparseArrays, and is there any function I can use to replace it? What would be an efficient ...
34 views

### Counting the number of rows that contains specific numbers in specific cells

I'm trying to find a way to count the number of rows in a matrix that contains specific elements in specific cells. For example, suppose I have the following matrix ...
27 views

### Adding up a list of rules

Here's the problem: I take a count of a count, so that I end up with a list in this format: Table[Counts@Counts@Join[dKm[[i]], Pick[data1, ccKMedoid, i]], {i, 5}] ...
19 views

### Putting a Count function for a matrix, in a loop

previously i had a doubt on how to assign different rows with certain values using a special function, which i later figured out by using the far more superior "DO" Loop. At present i have two ...
241 views

### Program that can count deficient numbers

Using Mathematica, I want to make program which can solve the following question. What is the number of deficient numbers less than 100? Please help me.
88 views

### count conditional items in list

I have a list of the form: {1,1, (1 if x>y, -1 if y>=x), -1} I want to count the number of 1's in the list. The output I'm looking for is something of the ...
79 views

### Finding percentage of points within tilted ellipse?

I am trying to find the number of data points that I have that are within a tilted ellipse that I have generated to represent the 68% confidence region. I generated some data using: ...
55 views

### Using Count and Rotate left

Q. Use RotateLeft and Count to find the number of planets detected by each method, presenting the result in a list of the form {{D, n1}, {R, n2}, {T, n3}}. ...
39 views

96 views

### Repeated consecutive values above a threshold

I would like to know if a list has repeated consecutive values above a threshold. Lets say for this example the threshold is 5. ...
100 views

### Counts[list] giving unexpected result [closed]

I import some data from an .xls-file and process it by subtracting pairs of data. What I need to do is counting the total number of each difference appearing in my result list, e.g. if the result list ...