# Tagged Questions

Questions on the basic structure of the Mathematica language (Wolfram language) including atomic data types, syntax etc

235 views

### How do I understand ListCorrelate(contains $\{k_L,k_R\}$) when it works for 2-dimentional data?

Two months ago, I asked a question here And @nikie give me a solution: The intuitive way to understand ListCorrelate is that the kernel is "moved" to every ...
42 views

### How to find out which definitions use Temporary symbol?

According to the Documentation, Symbols with attribute Temporary are automatically removed when they are no longer needed. For example: ...
74 views

### Concise way to express Table[FactorInteger[300][[n, 2]], {n, 1, Length @ FactorInteger[300]}] [closed]

I can get the exponent part of FactorInteger[300] with Table[FactorInteger[300][[n, 2]], {n, 1, Length @ FactorInteger[300]}] ...
373 views

### Why some built-in functions are slow

I just wonder why some built-in functions are slower compared to some other ways using more than one built-in functions for doing same job. consider this example: ...
106 views

I would like to do the following: ...
87 views

### Unexpected behavior from Indexed

I was going to include Indexed in this answer, thinking that it operated much as a List-only ...
66 views

### What does this Append expression do? [closed]

I have to understand some code. A part of it is written below. Can someone explain to me what it does: ...
129 views

### DownValue assignment using Apply

Why does assigning a DownValue using Apply, e.g., ...
34 views

### How exactly does ReplaceAll work? [duplicate]

I am not sure if this question has been asked before but anyway, Consider these two examples: ...
97 views

### Solution of a set of quadratic congruences (Chinese remainder)

Edit: Please remove this question. I think there are mathematics error in what I am asking. You are welcome to edit the question if you can state the problem correctly. I have a set of quadratic ...
217 views

### Signed power set of a list

Given {a, b, c, ...} with $n$ elements generate a list with $2^n$ elements. For example, if the list were {a, b, c}, then the ...
155 views

### Non sequitur in documentation of MemberQ

Mr.Wizard's question about MemberQ and FreeQ got me to re-read the documentation for those functions. I find I don't understand ...
186 views

### A bug in the overloading of MemberQ and FreeQ for Association?

Bug introduced in 10.0.0 and fixed in 10.1.0. While answering Pattern match for nested Association I came across behavior of MemberQ and ...
88 views

### Association of pure functions [duplicate]

I've encountered confusing behavior of Association when I try to use it for storing pure functions. For example: as = <|"1" -> # + 1 &|> ...
695 views

### Postfix Double Slash Notation with Multiple Parameters [duplicate]

Examples A convenient shorthand that I use frequently is the "double slash" notation to string commands together. For example, I can write: ...
345 views

### Dynamic graph construction and visualization (Watts' “Small Worlds” α-model)

I need some help in creating a Mathematica program for building and visualizing Watts' "Small Worlds" α-model. This is a variant of the more known (and much more simple) β-model (also known as ...
272 views

### How to restore function attributes to default

Adding an attribute to a function is easy and clearing attribute is easy also. But I don't know really how to restore the attributes of a function to its defaults. All I do is quit the kernel or close ...
338 views

### How to use Mathematica for traditional programming

I am new to the structure of Mathematica. I understand that in the notebooks, one enters the symbolic expressions and evaluates them. But I need to generate some simulated data and do that a few ...
1k views

...
217 views

### Why can't a string be formed by head String?

Since everything is an expression in Mathematica, why must a string object be formed by "abc" but not by a String[abc] ...
231 views

### How to test for Indeterminate values?

I need something like this a = 101010/0; If[a == ComplexInfinity, True, False] But if I use ToString, I get what I want. ...
251 views

### Taking the derivative of a function with indexed variables

I have a number of functions that depend on a variable x. I am using a second, integer variable to index these functions, i.e. something like ...
47 views

### Strange behaviour of Set and Part when given a sequence

Consider this example: lis1 = {a, b, c}; lis1[[2]] = Sequence[e, f]; lis1 (*{a, e, f, c}*) lis1[[2]] (*e*) lis1[[2]] = Sequence[g, h]; lis1 (*{a, g, h, c}*) It ...
148 views

### Pick bug? level 0 matching

A previous discussion of this issue (Is there a bug in Pick?) accepted that matching at level 0 is not a bug in Pick. Was that correct? I am not yet persuaded. ...
107 views

### How to define a formula in FormulaData?

I am looking for a way to manage frequently used formulas in my research, in a organized way in Mathematica. It appears to me that using FormulaData would be a ...
451 views

### How to build a list of functions

Having said that I'm no expert, I have some problems in generating a list of functions inside a loop. The functions in the list should depend on the elements of a parameters list, that are read in ...
233 views

### Why won't SparseArray let me store values with the head List?

When you attempt to define a SparseArray with elements that have the head List it complains: ...
65 views

### Why does WordData fail to find “PartsOfSpeech” when given a list of two words?

I have the following sample code. StringSplit["a test string", " "] Thread[WordData[%, "PartsOfSpeech"]] The output I get is: ...
221 views

### How to see abstract syntax tree of Wolfram Language expression

I mean, suppose I have this expression: 2 + 2 I want to get something like this: Plus[2, 2] as an output. I've tried FullForm, but this just evaluates 2+2 and returns 4. Is this even possible?
361 views

### When must I use the Return function?

In a comment to my answer to this question, QuantumDot asks, "Where can I find more information on when I must use the 'Return' function?". I found this too deep a question to be answered by leaving a ...
1k views

### Incompatible Changes since Mathematica Version 7?

There is documentation of the incompatible changes made to Mathematica with each major release: Incompatible Changes since Mathematica Version 1 Unfortunately that documentation simply stopped ...
581 views

### Why is Query so much slower than Part?

Time for another of these(1),(2) as yet another new-in-10 function appears to have poor performance compared to older alternatives. This time: Query appears to be ...
215 views

### Why does Mathematica appear to change the head of certain expressions?

I don't know if the question trivial or not (if so I will delete it), but here is what I have: I know that x x (* x^2 *) Looking at the full form gives ...
393 views

### Can't get Append to append a record (association) to a dataset

The Documentation Center item, Computation with Structured Datasets, implies that Append has been extended in V10 to work with datasets. But not on my computer. (I ...
992 views

### Why is the new PositionIndex horribly slow?

This issue has largely been mitigated in 10.0.1. New timings for the final test below are: ...
560 views

### Shorter syntax for Fold and FoldList?

I find it tedious to write out the following: a = {1, 2, 3, 4}; Fold[f, First @ a, Rest @ a] f[f[f[1, 2], 3], 4] It ...
148 views

### Multiple down-values with exactly the same lefthand side

I was working on an answer to this question, when I was sidetracked by what I bring up here. I wanted a function, which when given a string representing a binary number, would convert the string to a ...
52 views

### Is the use of Block to temporarily override definitions inherently unsafe? [duplicate]

This may have been discussed before, if so, please let me know. Consider the following example: x = 5 Dynamic[{Clock[], x}] This will always display the ...
722 views

### What's the difference between Inactive and HoldForm?

In version 10, Mathematica not only added Inactive / Activate but also highlighted this change in the "New in 10" page (in Core ...
131 views

### Why is Return not forcing an exit from my function? [duplicate]

Here is simplified version of my code that exhibits the behavior troubling me: ...
4k views

### How to make use of Associations?

I have been curious about it for long. Now that Mathematica 10 arrives, I think it's time to ask the question: How the new Association data structure would be used ...
776 views

### Why are functions called first-class objects in Mathematica?

I've heard lots of people say a function is a first-class object in Mathematica. "Everything is an expression, including function." "There is no distinction between functions and data." Having read ...
321 views

### Implementing key-value associations in Mathematica 9 with inexact numbers for keys

I'm not sure of what type of problem my issue falls into, so I haven't been able to search forums with any success. If this has already been solved then my apologies! Essentially I'm trying to set a ...
148 views

### Unexpected Plot3D behaviour

The following illustrates what appears to be an incorrect Plot3D for this polynomial. I have forced the function to complex argument, changed ranges. In contrast, ...
168 views

### Identifying the symbol which has a specific value

I'm writing a program that will solve the value of 1 variable in a 4-variable equality equation, but the variable to be solved will depend on the user's input to the program. This is what I've come ...
120 views

### What is wrong with my use of Flatten? [duplicate]

Why does Flatten[f[g[a, f[b]], f[c, d]]] result in f[g[a, f[b]], c, d] I expected the answer to be ...
355 views

### Euler's method for a 2nd order ODE

This is my first post on this site. Also, I'm new to Mathematica. I'm trying to solve my first problem with Mathematica. It's about solving a 2nd order differential equation. I dont have the explicit ...
106 views

### Can a Symbol own OwnValues that don't evaluate when it's the head of an expression?

I believe this a question that most of us have encountered when we were beginners but forgot when we got more familiar with Mathematica. We know the notation $y=y(x)$ for functions, where $y$ here ...