If I have x = (0, 1, 2, 3, 4), and I want to get all the elements other the first two, but in reverse order, why is it supposed to be x[:1:-1] or x[:-4:-1] rather than x[2::-1]?
106
I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.
95790
A friend was in need of an algorithm that would let him loop through the elements of an NxM matrix (N and M are odd). I came up with a solution, but I wanted to see if my fellow SO'ers could come up with a better solution.  I'm posting my solution as an answer to this question.  Example Output:  For a 3x3 matrix, the output should be:  (0, 0) (1, 0) (1, 1) (0, 1) (-1, 1) (-1, 0) (-1, -1) (0, -1) (1, -1)    Furthermore, the algorithm should support non-square matrices, so for example for a 5x3 matrix, the output should be:  (0, 0) (1, 0) (1, 1) (0, 1) (-1, 1) (-1, 0) (-1, -1) (0, -1) (1, -1) (2, -1) (2, 0) (2, 1) (-2, 1) (-2, 0) (-2, -1)
116802
I have the following assignment:  Let $A_i= \left \{...,-2,-1,0,1,...,i \right\}$.   Find  a) $\displaystyle \bigcup_{i=1}^{n} A_i$   b) $\displaystyle \bigcap_{i=1}^{n} A_i$  I think the  first one is:  $\displaystyle \bigcup_{i=1}^{n} \left \{...,-2,-1,0,1,...,i \right\} = \left \{...,-2,-1,0,1,2...,n \right\}$  But what about the second one?
104673
I wonder how to build a 1-1 correspondence between [0,1] and [0,1). My professor offers an example such that 1 in the first set corresponds to 1/2 in the second set, and 1/2 in the first set corresponds to 1/4 in the second. I don't quite understand it. Does it mean every element in the first set corresponds to its half value in the second set? wouldn't that make some elements left out in the second set? Does it still count as 1-1 correspondence? Does it connect to Schroder-Bernstein theorem?
103126
I dont know the concept or how to answer the question.     Suppose there are two sets, $X=\{1,2\}$ and $Y=\{a,b\}$.         What are all the ordered pairs in the form of (element of $X$, element of $Y$)?   What are all the ordered pairs in the form of (element of $Y$, element of $X$)?
103253
Given  If $|x -4| + |y - 4| =4$ then how many integers value the sets $(x,y)$ have? $x$ and $y$ are both positive and negative numbers.  options a)infinite b)$3$ c)$5$ d)$12$ e)$16$ Solution My Approach: i have just put all the values satisfying the equation Hence, Possible values are $(0,4),(4,0)$ $ (2,6),(6,2)$ $ (1,3),(3,1)$ $ (3,7),(7,3)$ $ (5,7),(7,5)$ $ (8,0),(0,8)$ I am getting wrong ans as the Ans is $16$ Is there any better approach to this problem and why the my ans is wrong.
106068
I have tried to solve this by taking the natural log of both sides and got $x\ln(x)=\ln(x)$ and after I subtracted $\ln(x)$ from both sides I got $x\ln(x)-\ln(x)=0$ which using the distributive property becomes $(x-1)\ln(x)=0$ so either $x-1=0$ or $\ln(x)=0$ and in both cases $x=1.$ what I am confused about is that $(-1)^{-1}=(-1)$ and when I solved the equation I did not get this answer. Can somebody please tell me where I messed up and how to properly solve this equation?
64332
Consider the ordered square $I_0^2$, the set $[0,1]\times [0,1]$  with the dictionary order topology. Let the general element of $I_0^2$ be denoted by $x\times y$, where $x, y\in [0,1]$. Then the closure of the subset $$S = \big\{x\times \frac{3}{4}: 0&lt;a&lt;x&lt;b&lt;1\big\}$$ in $I_0^2$ is   $S\cup \big((a, b]\times\{0\}\big) \cup \big([a, b)\times \{1\}\big)$ $S\cup \big((a, b]\times\{0\}\big) \cup \big((a, b]\times \{1\}\big)$ $S\cup \big((a, b)\times\{0\}\big) \cup \big((a, b)\times \{1\}\big)$ $S\cup \big((a, b]\times\{0\}\big)$   please explain it properly. I have no idea how to start with?
43217
Where is the mistake? $$-1=(-1)^{2/2}=\left(\left (-1\right)\displaystyle ^2\right)^{1/2}=1^{1/2}=\sqrt 1=1$$
61762
Can anyone please help me in this question:     $(X,\leq )$ is a well-ordered set. $\forall x\in X$, either $x$ is the largest element of $X$ or there exists $y\in X$ such that   (i) $x&lt;y$ and   (ii) if $x_0\in X$ such that  $x\leq x_0\leq y$, then either $x = x_0$ or $x_0 = y$.   Will this be sufficient to start the proof:  If $x$ is the largest element then there is nothing to prove. Suppose $x$ is not the largest element. $$A=\{ z\in X \mid x&lt;z\}\neq \emptyset$$ How do I proceed?
105099
I'm making exercises to prepare for my ring theory exam:     How many elements does the ring $ℤ[X]/(X^2-3,2X-4)$ have? Describe the   structure of the this ring.   I find it always difficult if the ideal is generated by two elements.   I thought about someting like this. $X=2$ and $X^2=3$. Therefore $4=3$ therefore $1=0$. As $2=1$ then $X=0$. And then everyting seems to become $0$.   I'm not sure if I'm allowed to see it this way, but this is the first thing that comes to my mind.
506
In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$   I was only able to find a related question but none with an answer so far:
68438
I want to write this:    I tried with $x_n \to_{n \to 0} 0$ but the $n \to 0$ doesn't go under the right arrow, it goes under but on the right, and I want it under but in the center, as in the picture above.
32263
Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this?  I've read that in some languages the result can be machine-dependent, but I'm not sure though.
95005
Let $T_n$ be the set of permutations of $\{1,2,\ldots,n\}$ which do not have $i$ immediately followed by $i+1$ for $1\le i\le n-1$; in other words, let \begin{align} T_n=\{\sigma \in S_n: \sigma(i)+1\ne\sigma(i+1) \text{ for all } 1\le i\le n-1\} . \end{align} Let $Q_n$ be the number of elements of $T_n$.    Let $D_n$ be the number of  of $\{1,2,\ldots,n\}$.  It is not hard to show algebraically that $Q_n=D_n+D_{n-1}$, but I am having difficulty coming up with a combinatorial argument to show why this is true.  (I believe there are $D_{n-1}$ elements of $T_n$ that leave $n$ fixed, and $D_n$ elements of $T_n$ that move $n$, but I don't know how to justify this combinatorially.)
67163
In $S_n$ with n=10, find a permutation $a$ such that $axa^{-1} = y$ if $x=(1,2)(3,4)$ and $y=(5,6)(3,1)$  I don't know how to start doing this. I read something like I need to get, for this case, $$(a(1),a(2)) \qquad \mbox{ and} \qquad (a(3),a(4))$$ but I am not sure where will I get their equivalents. Also, will those be my permutation $a$? Please help. I have problems very similar to this.
95610
Construct a bijection between $[1,2]$ and $[3,5)$.  So what I usually do if I pair the two outer number together to each other so like $3=1m+b$ and $5=2m+b$ and just solve for m and b but since 5 is not included, I am not sure how to construct it that makes it still a bijection. Thanks for any help!  Edit: this is not from $(0,1] \rightarrow (0,1)$ and also the brackets are different.