Questions tagged [expression-construction]

107 questions
1
vote
1 answer

The best method of constructing a product of consecutive terms

I am new to Mathematica, I am searching for a way to create an expression with a sequence of terms such as: (x-1)/x (x-2)/x (x-3)/x (x-4)/x … (x-n)/x
spaceKnot
  • 383
  • 1
  • 8
0
votes
1 answer

How to modify the order of symbols to make the result look more well and use some fixed expression 1-q, 1-c-q and so on?

In most cases, my expressions are quite complex, like the following expr and expr2. How can I make them look better, for instance, I want to use expressions like 1-q or 1-c-q and so on.
0
votes
1 answer

Displaying positions in expression tree

Can one display the position of each character in an expression tree? For instance: g[h[i, h], l] should be displayed using TreeForm where each character is replaced by its position in the tree. I can mimic this with TreeForm[0[10[11, 120[121,…
ExpressionCoder
  • 1,678
  • 7
  • 15
0
votes
1 answer

Proper formulation of Do expression

I'm having trouble with the following code: Do[ P[x_, y_] := Sum[RandomChoice[{-1, 1}]*x^k*y^l, {k, 0, 3}, {l, 0, 3}], IrreduciblePolynomialQ[P[x, y]], {12}] Basically, I just want to generate multiple polynomials (in the above case 12) of…
David_Shmij
  • 189
  • 8
0
votes
0 answers

What is the meaning of #, Root and &

I am new, but can any one tell me what is the meaning of formulas of x and y in the picture?
olivia
  • 101
  • 1
-1
votes
1 answer

Difference between Log and Log10

I typed a function : f := Tan[(1/a)*Log[(Sqrt[x^2 + y^2])]] - y/x I assigned values: a = 6.045059888; x = 8.36488; y = 1.836539; When I used Evaluate[f] it gave me a value of 0.15145 However, the correct value (verified on calculator and…
Corse
  • 459
  • 2
  • 7
-1
votes
1 answer

Producing the same output as Tuples[{0, 1}, 4]?

How can I use the functions decimalToBinary and padWithZeros to produce the same output as Tuples[{0, 1}, 4]?
tamir
  • 1
-5
votes
1 answer

Translation of GLSL expression (2)

What's the most compact WL translation of this GLSL expression: length(max(vec2(x,y),s)) ?
ChrisJJ
  • 608
  • 3
  • 8