Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
0answers
52 views

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

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

Why some built-in functions are slower compared to some other ways using more than one built-in functions for doing same job

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: ...
3
votes
2answers
88 views

MapThread problem

I would like to do the following: ...
2
votes
0answers
54 views

Unexpected behavior from Indexed

I was going to include Indexed in this answer, thinking that it operated much as a List-only ...
0
votes
1answer
51 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: ...
8
votes
2answers
102 views

DownValue assignment using Apply

Why does assigning a DownValue using Apply, e.g., ...
9
votes
6answers
356 views

Product of elements of a list

Sum is for functions; Total is for a list. Product is for a function; what is the command ...
2
votes
0answers
24 views

How exactly does ReplaceAll work? [duplicate]

I am not sure if this question has been asked before but anyway, Consider these two examples: ...
0
votes
0answers
73 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 ...
5
votes
4answers
173 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 ...
4
votes
2answers
131 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 ...
8
votes
0answers
78 views

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

While answering Pattern match for nested Association I came across behavior of MemberQ and FreeQ in 10.0.1 that I believe is ...
0
votes
1answer
41 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 &|> ...
9
votes
5answers
265 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: ...
2
votes
1answer
208 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 ...
10
votes
2answers
172 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 ...
3
votes
1answer
203 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 ...
7
votes
1answer
193 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] ...
2
votes
3answers
101 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. ...
6
votes
1answer
65 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 ...
1
vote
1answer
39 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 ...
4
votes
1answer
73 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 ...
7
votes
6answers
357 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 ...
10
votes
1answer
123 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: ...
1
vote
1answer
56 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: ...
4
votes
1answer
161 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?
7
votes
2answers
282 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 ...
33
votes
1answer
643 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 ...
21
votes
2answers
452 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 ...
6
votes
2answers
187 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 ...
0
votes
1answer
100 views

Need help in understanding code [closed]

I am just beginning with Mathematica. I have received this code to study. I am not able to follow this particular section. I have tried looking it up on many forums, with no answer. Can you help? ...
13
votes
2answers
250 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 ...
34
votes
2answers
737 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: ...
15
votes
1answer
304 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 ...
4
votes
1answer
114 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 ...
2
votes
1answer
44 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 ...
3
votes
0answers
250 views

Is Wolfram Language suitable for building web applications? [closed]

My goal is to find a technology which will afford me to build web applications (e.g. simple social networking site) as quickly as possible (with as little code as possible). I was impressed by Stephen ...
30
votes
4answers
490 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 ...
1
vote
1answer
68 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: ...
55
votes
3answers
2k 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 ...
8
votes
3answers
634 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 ...
7
votes
3answers
226 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 ...
1
vote
2answers
125 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, ...
0
votes
3answers
102 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 ...
2
votes
2answers
101 views

What is wrong with my use of Flatten? [closed]

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 ...
2
votes
1answer
164 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 ...
2
votes
1answer
77 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 ...
0
votes
0answers
76 views

Using Wolfram Language without Raspberry Pi [duplicate]

What are the different ways I can start using Wolfram Language even though I dont want to use Raspberry Pi? Are there any convenient ways? I actually have a raspberry pi but I am trying to find ...