3

I am trying to post this question on Mathematica StackExchange but I am getting an error that my code is not properly formatted. I double-checked every line for some time now, but I cannot find an error.

Can someone help me to see what is wrong with my post? This is not the first time that this has happened to me. In the past, it was something as simple as an extra space at the end of a line that I had to delete but I would like an expert's help in identifying what I am doing wrong.

Considering the function
$$
f(x_1,x_2,x_3;y_1,y_2,y_3)=\frac{\left(1-\frac{y_1}{x_1}\right) \left(1-\frac{y_2}{x_1}\right) \left(1-\frac{y_3}{x_1}\right)\left(1-\frac{y_1}{x_2}\right) \left(1-\frac{y_2}{x_2}\right) \left(1-\frac{y_3}{x_2}\right)\left(1-\frac{y_1}{x_3}\right) \left(1-\frac{y_2}{x_3}\right)\left(1-\frac{y_3}{x_3}\right)}{\left(1-\frac{x_2}{x_1}\right) \left(1-\frac{x_3}{x_1}\right)\left(1-\frac{x_3}{x_2}\right) \left(1-\frac{y_2}{y_1}\right) \left(1-\frac{y_3}{y_1}\right)\left(1-\frac{y_3}{y_2}\right)}
$$
I am trying to compute the sum
$$
\sum_{w\in S_3\times S_3} w(f),
$$
where the first copy of $S_3$ in $w$ is permuting the indices of the variables $x_1, x_2, x_3$ while the second copy of $S_3$ is permuting the indices of the variables $y_1,y_2,y_3$.

I have a quasi-code

    ClearAll[f]
    f[x1_, x2_, x3_, y1_, y2_, y3_] = ((1 - x1^-1 y1)(1 - x1^-1 y2)(1 - x1^-1 y3)(1 - x2^-1 y1)(1 - x2^-1 y2)(1 - x2^-1 y3)(1 - x3^-1 y1)(1 - x3^-1 y2)(1 - x3^-1 y3))/((1 - x1^-1 x2)(1 - x1^-1 x3)(1 - x2^-1 x3)(1 - y1^-1 y2)(1 - y1^-1 y3)(1 - y2^-1 y3));
    With[{xx = Array[Subscript[x, #] &, 3]},Sum[f@@ xx[[p]],{p,Permutations[Range[3]]}]]
    With[{yy = Array[Subscript[y, #] &, 3]},Sum[f@@ yy[[p]],{p,Permutations[Range[3]]}]]

but I am not sure how to put the last two lines together.

Edit: Upon deleting all extraneous spaces, the following is how my post looks like but I am still getting an error that my code is not properly formatted.

Considering the function $$f(x_1,x_2,x_3;y_1,y_2,y_3)=\frac{\left(1-\frac{y_1}{x_1}\right)\left(1-\frac{y_2}{x_1}\right)\left(1-\frac{y_3}{x_1}\right)\left(1-\frac{y_1}{x_2}\right)\left(1-\frac{y_2}{x_2}\right)\left(1-\frac{y_3}{x_2}\right)\left(1-\frac{y_1}{x_3}\right)\left(1-\frac{y_2}{x_3}\right)\left(1-\frac{y_3}{x_3}\right)}{\left(1-\frac{x_2}{x_1}\right)\left(1-\frac{x_3}{x_1}\right)\left(1-\frac{x_3}{x_2}\right)\left(1-\frac{y_2}{y_1}\right)\left(1-\frac{y_3}{y_1}\right)\left(1-\frac{y_3}{y_2}\right)}$$
in $6$ variables, I would like to compute the sum
$$
\sum_{w\in S_3\times S_3}w(f),
$$
where the first copy of $S_3$ in $w$ is permuting the indices of the variables $x_1, x_2, x_3$ while the second copy of $S_3$ is permuting the indices of the variables $y_1,y_2,y_3$.

I have a quasi-code

    ClearAll[f]
    f[x1_,x2_,x3_,y1_,y2_,y3_]=((1-x1^-1y1)(1-x1^-1y2)(1-x1^-1y3)(1-x2^-1y1)(1-x2^-1y2)(1-x2^-1y3)(1-x3^-1y1)(1-x3^-1y2)(1-x3^-1y3))/((1-x1^-1x2)(1-x1^-1x3)(1-x2^-1x3)(1-y1^-1y2)(1-y1^-1y3)(1-y2^-1y3));
    With[{xx=Array[Subscript[x,#]&,3]},Sum[f@@xx[[p]],{p,Permutations[Range[3]]}]]
    With[{yy=Array[Subscript[y,#]&,3]},Sum[f@@yy[[p]],{p,Permutations[Range[3]]}]]
but I am not sure how to put the last two lines together.

Also, in case the following information is helpful, I am using Firefox.

Edit: I've copied and pasted the second set of lines verbatim as a post, and here is the snapshot of the error (I'm guessing that my posts will automatically be flagged until I've earned enough reputation points).

improper-formatting-error

  • 3
    First off thank you for asking for help rather than just posting malformatted code! Secondly it looks like you have an issue of too many spaces at the start of your lines. – b3m2a1 Apr 25 at 6:32
  • @b3m2a1 Thanks for your reply! Can you specify a little bit further on where the "too many spaces" at the start of my lines are located? – Mee Seong Im Apr 25 at 6:37
  • One point of clarification: when you say you get the formatting error, what do you mean by that? I was imagining you were trying to post that code block as is, in which case you just have the four spaces at the beginning of all the lines. I figure now that code block is the direct text you were trying to paste? If so I have no issue getting the code to format when pasting directly into a new question/answer box. – b3m2a1 Apr 25 at 7:13
  • 1
    @b3m2a1 I added the four spaces to the beginning of each line only for this meta stackexchange post. So if you copy and paste above, then that is precisely my post which stackexchange is having a problem with. – Mee Seong Im Apr 25 at 14:25
  • what’s the exact error it’s spitting out? I’m not running into issues with it. Does the preview look malformatted? – b3m2a1 Apr 25 at 17:15
  • @b3m2a1 The preview looked fine since yesterday upon checking it multiple times (no errors or typos). But the system was flagging me for an improperly formatted code. I'm guessing that it's because I have less than 200 reputation points, see e.g. the answer here mathematica.meta.stackexchange.com/questions/2018/… – Mee Seong Im Apr 25 at 17:21
  • 1
    sounds good. If you try to post it does it still refuse to go through? Alternatively you could try to post a stub first and then add this via the Edit mechanism. – b3m2a1 Apr 25 at 17:27
  • @b3m2a1 That is a good idea! I'll try this next time. I've posted the above without any lines of code (I added the function f as a comment and another user added that to my post). – Mee Seong Im Apr 25 at 17:34

You must log in to answer this question.

Browse other questions tagged .