text:
## Fall 2015, problem 1

The numbers $1,2,3,4,5,6,7,8$ are assigned to the vertices of a cube so that each vertex has a different number. Find the probability that no two consecutive numbers are written on vertices with a common edge, where $8$ and $1$ are considered consecutive.

2 years ago

For a cube numbering that satisfy such conditions, if we connect 1-2-3-4-5-6-7-8-1 each "-" would represent a either a face diagonal(F) or body diagonal(B). With only Fs, one can only travel in one of the two tetrahedra that does not share any vertex. So we need Bs - and we must have an even number of them (2 or 4), to get back to the original tetrahedra. With only B, one can only travel back and forth in one of the four pairs of vertices.

The only possible types of sequences of steps are FFFBFFFB(8x3x2x2, wlog suppose each vertex is distinct) and FBFBFBFB(8x3x2) and rotations of them. added: FFFBFFFB has 4 "rotations": 1-FFFBFFFB-1, 1-FFBFFFBF-1, 1-FBFFFBFF-1, 1-BFFFBFFF-1, and FBFBFBFB can also be BFBFBFBF.

Subtotal = 4 x FFFBFFFB +2 x FBFBFBFB Total: 8!

P(no consecutive)= 1/84? (~~1/280~~ strikethrough didn't work) I indeed forgot the 4 and 2...

Thanks mwoenker for the formatting guide!

I'm trying to keep the line separated, but using a list makes the font much smaller. Also it looks like either the whole post is a list or there is no list?

JiazhenTan 2 years ago

Paragraphs are separated by one or more blank lines -- in other words, you have to hit enter twice between paragraphs.

The formatting syntax is called markdown. It is basically the same syntax that is used in StackOverflow and Reddit, I believe. You can see a little documentation on it by pressing the question mark button in the editor. We need to write up something more detailed and make it more visible. Also we allow LaTeX syntax between \$...\$.

This looks like a better overview of the basics.

mwoenker 2 years ago

@Jiazhen I understood the first paragraph of your answer but what calculation you have done I don't understand that. So please elaborate your answer a little bit. Particularly I want to ask that what is subtotal and total and how you got the required probability to be equal to 1/280.

Singh 2 years ago

I think the reasoning of the second paragraph goes like this: If in order to label the vertices without consecutive numbers sharing a common edge, you need to label the first vertex with some number, then travel along a face diagonal or a body diagonal to another vertex and label that second vertex with the next number in the cycle of 1-2-3-4-5-6-7-8-1. If you get a box and dry tracing some paths around it, you'll notice that there are only two possible path types that a) visit each vertex exactly once and b) whose start and end points are the same place:

The first option is that you travel along 3 face diagonals, then a body diagonal, then 3 face diagonals, then a body diagonal(FFFBFFFB). There are 8 possible starting numbers. After labeling the first vertex, there are 3 possible face diagonals you could choose. After labeling the second vertex, there are 2 remaining possible face diagonals you could choose. After labeling the third vertex, there's only one face diagonal you can travel across without landing on an already labeled vertex. At the fourth vertex you then travel across the body diagonal (there's only one possibility). At the fifth vertex there are 2 viable face diagonals, and after the sixth vertex onwards the rest of the path is completely determined. So the total number of FFFBFFFB-type paths is 8x3x2x2=96.

The second option is that you alternate face diagonal, then body diagonal. There are 8 possible starting numbers. After labeling the first vertex, there are 3 possible face diagonals you could choose. After labeling the second vertex, you travel along the only possible body diagonal. After labeling the third vertex, there are 2 viable face diagonals to travel along. After labeling the fourth vertex, the remaining path is completely determined (body diagonal moves turn out to be a lot more restrictive than face diagonal moves). So the total number of FBFBFBFB-type paths is 8x3x2=48.

Then there is something about considering the different rotations of the paths, which results in the factors of 4 and 2, but I don't understand where those values come from.

Actually, the calculation comes out to 1/280 ignoring those factors: (96+48)/8! = 1/280.

Matthew 2 years ago

Thank you Sir Mathew for clearing my doubts.

Thank you Sir Jiazhen for elaborating your solution.

Singh 2 years ago

@Matthew thanks, that clarified a lot. I have skipped too many steps...

if we always start and end with 1, then permuting the 'F' and 'B's produce different results, so we have the 4 and 2.

JiazhenTan 2 years ago
2 years ago

Cute -- the key being the role of the two types of diagonals. I am getting lazy in my old age, so I cheated and wrote a Python script. FWIW, the answer I get is 1/84.

What's your algorithm? All I can come up with is checking all...

JiazhenTan 2 years ago

Tan:

Sorry for the delay. Just got back from Thanksgiving holiday, and before that, well, my day job ...

Truth to tell, I was rather embarassed by my first two iterations of the Python script for this problem. The following script is fairly tight. It does indeed iterate over all 8! = 40,320 permutations of the integers from 1 to 8. The script defines a canonical labeling on a "cube graph" (using the letters 'a' to 'h') and assigns integers according to their order in the current permutation, which is a list generated by the standard (since Python 2.6.x) "itertools" package. (It also uses the NetworkX Python package to implement simple graph operations.) The script is written in Python 2.7.10. I would strongly advise anyone interested in running this script to have a Python 2.7.x with x large enough to support the pip Python package installer, which can be used to install NetworkX. (For the record, I used my office workstation, an iMac running Mountain Lion.) Also, in earlier versions, I used the Matplotlib package to plot the cubic graph, just to check. (Sorry, no animations or labeling (yet). If I ever get around to updating my Web site ...)

The basic idea is that for every permutation, the assignment of integers by their "place" in the (ordered) list is checked for the non-consecutive integer constraint (with 8 adjacent to 1.) If the assignment is good, it is printed. The number of "good" permutations is just the number of output lines, which is 480, and 480/8! is 1/84.

Anyway, here is the code (some long lines have been broken in two; also, some underscores in the first few lines seem to have been eaten during the cut-and-paste):

import networkx as nx import itertools as iter

G=nx.Graph()

A=set('abcdefgh')

nx.setnodeattributes(G,'label','0')

for perm in iter.permutations('12345678'):

G.node['a']['label'] = perm[0]
G.node['b']['label'] = perm[1]
G.node['c']['label'] = perm[2]
G.node['d']['label'] = perm[3]
G.node['e']['label'] = perm[4]
G.node['f']['label'] = perm[5]
G.node['g']['label'] = perm[6]
G.node['h']['label'] = perm[7]

flag = False
for v in G.nodes_iter():
v_value = int(G.node[v]['label'])
for w in G.neighbors(v):
w_value = int(G.node[w]['label'])
diff = abs(v_value - w_value)
if ( diff == 1 ):
flag = True
break

if v_value == 1:
if w_value == 8:
flag = True
break

if v_value == 8:
if w_value == 1:
flag = True
break

if flag:
break

if not flag:
print "a,b,c,d,e,f,g,h = %s %s %s %s %s %s %s %s" % (perm[0],perm[1],perm[2],perm[3],perm[4],perm[5],perm[6],perm[7])

wgw 2 years ago

Thank you for sharing! I also just got my homework done...

JiazhenTan 2 years ago
2 years ago

Where do we stand on this now? Various solutions but no conclusive answer.

I too have written a program (in C) which confirms the result by wgw, i.e. 1/84

I am probably older than wgw and also somewhat lazy.

What's your algorithm? I don't have anything better than brute force...

JiazhenTan 2 years ago

The 8 vertices are (0,0,0) ... (1,1,1) with adjacent vertices having the property that 2 of the coordinates are the same.

Populate each of the vertices with the permutations of 1..8 and pick out those items which do not have the property of adjacent vertices containing consecutive values.

I guess this could be viewed as brute force and this approach is only valid for the kind of problem which produces relatively small finite solutions.

If the problem were to be extended to "metacubes" of many dimensions I don't think it would fare very well.

PhilBoyd 2 years ago

Could you please send the code to 1942597938@qq.com? Just wondering if you are using a quadruple to represent each vertex or listed all 12 edges. Thanks in advance!

Update: Just got your code; somehow it got spammed... Thank you very much!

JiazhenTan 2 years ago
2 years ago

Below is a program in Prolog which I think generates all solutions, number of solutions: 480. Giving a probability of 480/8! = 1/84

Code is at: http://swish.swi-prolog.org/p/Prob1%20Solution.pl

The query to run is:

setof(L,create_sol(L),Ls),length(Ls,Len).

Output: Ls = [[0, 2, 4, 6, 3, 5, 7, 1], [0, 2, 4, 6, 5, 7, 1|...], [0, 2, 5, 3, 4, 6|...], [0, 2, 5, 3, 4|...], [0, 2, 5, 3|...], [0, 2, 6|...], [0, 2|...], [0|...], [...|...]|...], Len = 480.

2 years ago

Sorry ahead of time for my very long and space-consuming attempt at responding to this!

If you assign the eight vertices in a certain order, you can easily count the number of ways that assignments are possible. Let the notation n(a,b,c) be such that "vertex n" touches (vertex a, vertex b, vertex c). So for the following assignments, we have:

• 1(2,3,4) can be assigned any number (8 ways to choose)
• 2(1,5,6): 7 possible numbers to choose from, but 2 touch 1(2,3,4) .. (5 ways to choose)
• 3(1,6,7): 6 possible numbers to choose from, but 2 touch 1(2,3,4) .. (4 ways to choose)
• 4(1,5,7): 5 possible numbers to choose from, but 2 touch 1(2,3,4) .. (3 ways to choose)

Yet to be assigned are 5(2,4,8), 6(2,3,8), 7(3,4,8), 8(5,6,7)

From here we have a number of assignments to choose from for 5. Let the number line be --x-x-x-x-x-x-x-x-- and can be rotated and flipped in any such manner while preserving symmetry, so the actual digits don't matter. If we set assignment for 1 in one of the center two nodes, then possible permutations at this point are:

• --2-3-4-x-1-x-x-x--
• --3-2-4-x-1-x-x-x--
• --3-x-2-x-1-x-x-4--
• --3-x-2-x-1-x-4-x--

Note that 2 and 4 can actually be flipped and still preserve this structure. Immediately, we can see that the only arrangement that allows for 5, 6, and 7 assignment is the --3-2-4-x-1-x-x-x-- arrangement. So possible ways to determine 5 are

• --3-2-4-x-1-5-x-x--
• --3-2-4-x-1-x-5-x--
• --3-2-4-x-1-x-x-5--

But since both 6 and 7 touch 3, only the third is viable, so we have --3-2-4-x-1-x-x-5--.

• 5(2,4,8): 4 possible numbers to choose from, must touch 3(1,6,7) so that 6(2,3,8) and 7(3,4,8) are possible to arrange .. (1 way to choose)
• 6(2,3,8): 3 possible numbers to choose from, can be either --3-2-4-x-1-x-6-5-- or --3-2-4-x-1-6-x-5-- .. (2 ways to choose)
• 7(3,4,8): 2 possible numbers to choose from, cannot touch 4 .. (1 way to choose)
• 8(5,6,7): 1 possible number to choose from .. (1 way to choose)

And finally, for the probability we have (8x5x4x3x1x2x1x1)/8! = 1/42 ... which is twice the result from simulations above... If anyone wants to point out where I went wrong, that'd be great.

Although I got lost when you started to assign the fifth node, I do want to note that, with different assignment for 1(2,3,4), 2(1,5,6), 3(1,6,7), and 4(1,5,7), the number of possible assignment for 5(2,4,8), 6(2,3,8), 7(3,4,8), 8(5,6,7) are different (also the problematic part in saikrishnapavan45 and Samurai's method).

For example, assign 1 to node 1(2,3,4), 3 to node 2(1,5,6), 5 to node 3(1,6,7), 7 to node 4(1,5,7), and...?

Making a semi-exhaustive list with your method, using the symmetry of a cube, won't be too much work, though.

JiazhenTan 2 years ago

Wouldn't that just represent a homomorphism though? Since the cube structure is preserved, vertex connections are also preserved, and naming is an arbitrary process and should have no effect on the probability. At least from my understanding.

KoriSmith 2 years ago

Really, try assign 1 to node 1(2,3,4), 3 to node 2(1,5,6), 5 to node 3(1,6,7), 7 to node 4(1,5,7) and try to assign a number to node 8(5,6,7).

Different assignments to node 1,2,3, and 4 produce different number of possible assignments for node 5,6,7, and 8, so something must be wrong with any formula that does not consider the assignment for the first four vertices.

However, I didn't quite get your number line idea. Would you please explain whether you are assigning numbers to node 1,2,3, and 4, or are you assigning the number 1,2,3, and 4 to the nodes? And how do you place the number line on the cube - does each x represent a node? or a number yet to be chosen?

JiazhenTan 2 years ago
2 years ago

Since there still seems to be some confusion, I'm going to try and break down Jiazhen Tan's proof to what may seem like excruciating detail. But then again, the proof really is not entirely trivial in the details. The answer is, of course, still $p = \frac{1}{84}$.

First off a - somewhat tedious - list of definitions (some of which are standard):

• Let the corners of the cube be represented by the elements of the set $C \subset \mathbb{R}^3$, defined as:

$$C := \{(x_1,x_2,x_3) \in \mathbb{R}^3: \forall_{i=1}^3:x_i \in \{0,1\} \}$$

• Let a point $p \in C$ be called even, if the number of coordinates of $p$ with value 1 is even. Otherwise call it odd. Whether $p$ is even or odd is called the parity of $p$.
• For $p_1, p_2 \in C$ with $p_1 \neq p_2$ write $p_1 N p_2$ if $p_1$ and $p_2$ differ in exactly one coordinate ($p_1$ and $p_2$ are "neighbours"), write $p_1 F p_2$ ($p_1$ and $p_2$ are "face diagonal), if $p_1$ and $p_2$ differ in exactly two coordinates and finally write $p_1 B p_2$ ($p_1$ and $p_2$ are "block diagonal"), if $p_1$ and $p_2$ differ in all three coordinates.
• A sequence $p_1, p_2, .., p_k \in C$ is called a path if $\forall_{i=1}^{k-1}:p_i \neq p_{i+1}$. If in addition $p_1 = p_k$ and otherwise there are no repetitions, we also call it a loop. A loop is called a walkthrough if $k = 9$ and it contains every point $q \in C$. Finally a path is diagonal if $\forall_{i=1}^{k-1}:p_i F p_{i+1}$ or $p_i B p_{i+1}$.
• Let $S := \{N,F,B\}$ be the set of neighbourhood symbols. For a path $p_1, p_2, ..., p_k \in C$ and a sequence $O_1, O_2, ..., O_{k-1} \in S$ with $p_i \neq p_{i+1} \forall_{i = 1}^{k-1}$ we say $p_1, .., p_k$ is of type $O_1, O_2.., O_{k-1}$ and write $p_1 O_1 p_2 O_2 p_3 .. p_{k-1} O_{k-1} p_k$ if $\forall_{i=1}^{k-1}: p_i O_i p_{i+1}$.
• A bijective function $f: C \rightarrow \{1, 2, ..8\}$ is called an assignment if for all $p, q, \in C$ with $p N q$ the numbers $f(p)$ and $f(q)$ are not consecutive in the sense of the problem statement.

We have to prove that the number of assigments is $\frac{8!}{84}$.

• [Statement (1)] If we have two corners $p \neq q$, then $p$ and $q$ have the same parity if and only if $pFq$. $p$ and $q$ have different parity if and only if $pNq$ or $pBq$.
• [Statement (2)] The number of assignments is the same as the number of diagonal walkthroughs. This is, because by considering the path $f^{-1}(0)f^{-1}(1)..f^{-1}(9)$ for each assignment $f$ you create only and all diagonal walkthroughs exactly once.
• [Statement (3)] All diagonal walkthroughs are of type $FFFBFFFB$, $FFBFFFBF$, $FBFFFBFF$ or $BFFFBFFF$ (class "$2B$") or else of type $FBFBFBFB$ or $BFBFBFBF$ (class "$4B$"). Proof: Let $w=S_1S_2..S_8$ be a type of walkthrough. Then there are exactly eight neighbourhood symbols in $w$ (rule 1), by definition. There cannot follow two $B$s immediately one after another, since we cannot go forth and back to the same point (rule 2). There cannot follow more than three $F$s right after one another, since there are only four different points of a given parity (rule 3). There must be an even number of $B$s (rule 4), since we start and end our walkthrough on the same parity (on the same point, indeed). The classes $2B$ and $4B$ mentioned above are easily the only sequences of $F$s and $B$s that satisfy rules 1 through 4.
• [Statement (4)] All types of class $2B$ ($4B$, resp.)correspond to the same number of paths. Proof: Take a path $p_1..p_9$ of type $FFFBFFFB$ and start at $p_2$ and you get a path of type $FFBFFFBF$. This defines a bijective map from paths of type $FFFBFFFB$ to those of type $FFBFFFBF$. The other cases work analogously.

At long last, we now count the diagonal walkthroughs of the two remaining types $FBFBFBFB$ (type 1) and $FFFBFFFB$ (type 2).

Number of Walkthroghs of type 1: Let $p_1..p9$ be a walkthrough of type 1. Then $p_1 p_3 p_5 p_7 p_9$ is a loop of type $NNNN$) without repetitions. There are exactly $6 \times 4 \times 2$ of those. The factor of 6 because any $NNNN$ loop without repetitions is contained within one cube face (pen and paper) and there are 6 of those to choose from. The factor of 4, because there are 4 starting points to choose from in a given face. The factor of 2 because there are two ways you can go round the face. There are no additional factors for choosing $p_2,p_4,p_6,p_8$, because for every pair $p,q$ of corners $pNq$ there exists exactly one r with $pFrBq$.

Number of Walkthroughs of type type 2: Let $p_1..p_9$ be a walkthrough of type type 2. The points $p_1$ through $p_4$ are all of the even or all of the odd corners (factor of $2$: parity). Say they're the even ones. There are $4!$ permutations of the even points (factor of $4!$). $p_5$ is fixed by $p_4 B p_5$ (factor of $1$, if you will). $p_8$ is fixed by $p_8 B p_9$. So two choices remain for $p_6 p_7$ (factor of $2$).

Gathering all factors, the number of assignments is: $2 \times (6 \cdot 4 \cdot 2) + 4 \times (2 \cdot 4! \cdot 2) = \frac{8!}{84}$

2 years ago

Start with the vertex labeled 1 . it along with the other vertices have 3 common edges with 3 other vertices. Now the first one must not be a 8 0r 2 , leaving 3,4,5,6,7 ..four choices out of 7 so probability 5 /7. The other two now have that probability , yielding (5/7)(5/7)(5/7).Go to the opposite vertex ( diagonally opposite ) . do the same with it but now only 4 choices left , means of any label with again 3 common vertices 5/7 cubed . since this is an ' AND ' probability we multiply ..giving 5/7 to sixth power ..** not my final answer * lol Thinking now instead of 5/7 cubed it would be 5/7 x 4/6x3/5

When it becomes $\frac{5}{7} \cdot \frac{4}{6} \cdot \frac{3}{5}$, what would the expression of the other part change to?

Edit: What would be the probability that the other four vertices satisfy the conditions?

JiazhenTan 2 years ago

You mean the opposite vertex to the one first chosen? On diagonal ?

Samurai 2 years ago

Great question Jiazhen ..i havnt figured that out yet lol. Your attack by permuting the cobaecutive sequences along * diagonals might be the only way .i attempted this way and dont yet know how to compute p of the other 4

Samurai 2 years ago
2 years ago

The total no. of possible ways for arrainging the 8 numbers on a vertices of a cube is 8! (means 8765432*1= 40320.) as per the condition the total no of ways of no two consecutive numbers are written on vertices with a common edge is given by = 5C3 (means 10). The probability of no two consecutive numbers are written on vertices with a common edge of a cube is 10/8! .

           As the no. of possible ways for arrainging the 8 numbers on a vertices of a cube is same as arranging 8 different numbers in 8 different places which is
8! (8 factorial = 40320). As per the given condition no two consecutive numbers are written on vertices with a common edge consider a number "8" the total no. of
possibilities for placing a number beside 8 is 2,3,4,5,6. Eliminating 1 & 7 so the total no. of possibilities would be 5 numbers this includes eliminating the number 8
as this number is already assumed to be placed from our initial assumption. so it gives the number of ways of placing an non-consecutive numbers would be (n-3)C3
the number 8 vertice is surrounded by 3 other vertices so any of these vertices cannot have the consecutive numbers so that 3 in (n-3)C3 represents thenumber of
surrounding vertices and n-3 represents the number of left out number other than the number placed at the vertice and its corresponding consecutive numbers.

Your attempt is similar to @Samurai's and have a similar problem; maybe you can try to list the possible arrangements after choosing 8 and 3 of its surroundings? Here's kinda a hint

JiazhenTan 2 years ago

True my friend Jiazhan , this one got past samurai ;) making use of the diagonals seems to be the kicker and best way to solve this one . trying to label and compute ( probabilty) dead ends

Samurai 2 years ago

I was on right track it seems thanx to saikrishna pointing out for the first vertex and common vertices thier can only be the numbers 3,4,5,6,7 which is the 5c3._as for the other 4 vertices , we need only subtract the events theses vertices have consecutive labels, which helps considerably if we assume the vertex opposite the first one as 1 will be 2 we must not have the 3 on the side of cube with label 2 .which means its on the side with label 1. So. Really its 4c3 not 5c3 :( sorry krishana no points awarded for that lol

Samurai 2 years ago

assume the vertex opposite the first one as 1 will be 2 ... Really its 4c3 not 5c3

Without loss of generality?

JiazhenTan 2 years ago
2 years ago

Please let me know if i am right . It would be helpful. Thanks in advance.

2 years ago

Any square (side of the cube) cannot have three consecutive numbers. Based on that, my solution is 4/315.

I agree that

Any square (side of the cube) cannot have three consecutive numbers.

But would you elaborate on how did you get $2^6$ configurations? How does your observation helped in your solution?

JiazhenTan 2 years ago
2 years ago

Yea wlog since its not necesary. The other was is to subtract from all the cases that this side of cube * has consecutive vertices which is easier to count since 4 numbers from the set of 8 chosen

2 years ago

The probability in the analogous problem for a hypercube in $\mathbb{R}^4$ is $\frac{147092404224}{16!} \approx \frac{1}{142}$. Can anybody confirm?

In four dimensions there are face ($F$) diagonals (two coordinates change) block ($B$) diagonals (3 coordinates change) and hyper ($H$) diagonals (all coordinates change). If you choose two corners $A, B$ of the hypercube that are diagonal and the line from A to B is...

• ...$F$, then there are 828252336 good permutations that have the number 1 at A and the number 2 at B .
• ...$B$, then there are 844757232 good permutations that have the number 1 at A and the number 2 at B .
• ...$H$, then there are 844732320 good permutations that have the number 1 at A and the number 2 at B .

It's kinda interesting that it only makes a very slight difference, which type of diagonal you start with.

Here is the C program I used to compute the number 147092404224 of good permutations. It takes about an hour or so to complete on my machine. If you set the global variable dim = 3 you get the result for the $\mathbb{R}^3$ case, namely #(No Consecutive) = 480. If you uncomment a block in the main function, it will compute the probability by a Monte Carlo method. (If you set dim=5 it will not terminate in this life. Also the result would be garbage, anyway, because the long int type would overflow).

2 years ago

Regarding my post where I gave python code to count the correct answer, I did think about this problem last night, and I have the more elegant solution I'd hoped for yesterday. I don't know if this is Group Theory, or Operator Theory, or none of the above, because I'm really just an experimental physicist.

Consider the eight vertices of a cube. We'll number them 0, 1, ..., 7, and we'll arrange them so that 0, 1, 2, 3 form the vertices, in a clockwise manner, on the top plane of the cube, and vertices 4, 5, 6, 7 form the vertices on the bottom plane of the cube, also clockwise, with 4 under 0, 5 under 1, etc.

Let's start, arbitrarily, at vertex 0. You have a group of eight vertices, split into two groups of four each, with: * Main Group: Vertices 0, 1, 2, 3, 4, 5, 6, 7 * Sub Group 1 being vertices 0, 2, 5, 7, and * Sub Group 2 being vertices 1, 3, 4, 6.

Note that if you start in Sub Group 1, and travel along any face diagonal of the group, you remain in Sub Group 1. The same holds for Sub Group 2. The only way to travel from Sub Group 1 to Sub Group 2 is via a body diagonal, which connects vertices 0 to 6, 1 to 7, 2 to 4, and 3 to 5.

This paragraph is not required for the solution, but is interesting and explains my python code: from any vertex there are three face diagonal moves you can make, which I'll call F1, F2, and F_3, and one body diagonal move you can make, which I'll call B. These can be written as functions, for any vertex n: * F1(n) = n xor 2, * F2(n) = n xor 5, * F3(n) = n xor 7, and * B(n) = n xor 6.

The problem statement says you have to place the numerals 1 through 8 (consecutively, where 8 is defined as consecutive with 1) on the eight vertices of the cube such that no two numerals are connected by a common edge of the cube. Thus each consecutive numeral must either be placed on the face diagonal or body diagonal of the previous numeral, and when you get to the last numeral (8), it must connect along a face or body diagonal to numeral 1.

Place numeral 1 on a vertex, let's say on vertex 0. If you restrict yourself to placing subsequent numerals on face diagonals, you get stuck in Sub Group 1 and run out of options after placing numeral 4. So you need a body diagonal to open up Sub Group 2. But the problem statement says you need to bet back to your starting point after placing numeral 8, so you need an even number of body diagonals to solve this problem.

Next, you can't follow a body diagonal move with another body diagonal move, or you end up back where you started. You rapidly discover your only possible moves are: * FFFBFFFB * FFBFFFBF * FBFFFBFF * BFFFBFFF * BFBFBFBF * FBFBFBFB

Now you just count up how many such moves are possible. The first four choices (involving two body diagonal moves) have the same number of solutions, and the last two choices (involving four body diagonal moves) both have the same number of solutions. Thus the total number of solutions is 4 times the number of FFFBFFFB solutions, plus 2 times the number of BFBFBFBF solutions. * FFFBFFFB: your first F has 3 choices, your next F has 2, and your third F has 1 choice. You have only one B choice. From here you only have two choices in your fourth F move, one choice in your fifth F move, and one choice in your sixth F move, since your sixth F move has to line up opposite your starting point so that the second B move returns you to where you started. This is 12 possible solutions. * BFBFBFBF: your first B has only one option, from there you make 3 possible F moves, 1 B move, 2 more possible F moves, 1 B move, 1 F, 1 B, and 1 F. This adds 6 possible solutions.

The total number of solutions is thus 4 times 12 + 2 times 6 = 60, out of 7! permutations, which is 1 in 84 probability.

I don't know why formatting doesn't work. Sorry. It looks great on the screen until I hit post.

jsv 2 years ago
2 years ago

This sure seems like if I knew something about Group Theory this would be way easier. Like the group consists of 8 vertices, with Face Diagonal Moves keeping you in a four-vertex subset of the group, and Body Diagonal Moves taking you to the other four-vertex subsets. I'll think about this some more and come back if something clever hits me.

For now, the dumb answer: a recursive python script that walks through all orderings, identifying those that satisfy the problem statement.

Define eight vertices of a cube, with vertices 0, 1, 2, 3 on the top face, clockwise, and 4, 5, 6, 7 on the bottom face, also clockwise, with 4 under 0. Then the face diagonals of 0 are 2, 5, and 7, while the body diagonal is 6.

def Go(S,l):
C = [str(int(S[-1])^x) for x in (2,5,6,7)]  # C are vertices you can travel to

if (len(S) == 8):
if S[0] in C:        # Make sure your last step connects back to your starting vertex
l[0] += 1
print '%2d %s' % (l[0],S)
else:
for k in C:
if k not in S:
Go(S+k,l)
Go('0',[0])

You get 60 paths starting from vertex '0'. Out of 7 factorial possibilities, P = 60 / 7! = 1/84

2 years ago

I too found the answer using a program (in Perl 6, and it draws the cubes as well!). Remember, the four-color theorem was also proved with the help of a computer!

2 years ago

total is 8!

then we have 12 edges:

<hr></hr> <hr></hr> <hr></hr>

combination of numbers placed at each end = 8 * 7 combination of consectutive numbers = 8*2 ( for every number there are 2 options for consective number)

combination so number are not consecutive = 87 - 82 = 40

no of edges = 12

combination so that no edge has consecutive number = 12 *40 = 480

probability = 480/8! = 1/84


text:
# Applications of polynomials

### Applications of polynomials

In this session, we will apply the knowledge of polynomials learned from previous sessions to solve questions related to geometric shapes. Therefore, before we start, it’s a good idea to refresh your memory on polynomial operations we have talked about in the lessons before.

format: plain


text:
# Sampling statements conditional on integers

I am working with a model that involves n^\mathrm{th}-order random walks, for some positive integer n (typically 2 or 3). I’ll spare the details of the model - all that matters is that there is a parameter \theta in the model whose distribution should depend on the order of the random walk. Specifically, I would like to do something like this:

model{
if (n == 2)
theta ~ std_normal();
else if (n == 3)
theta ~ exponential(1);
...  //Rest of model
}

Of course, n is fixed data.

My question is whether or not this makes sense, or if it will be horribly inefficient. I don’t know much about the underlying behaviour of Stan in a situation like this, but my hope is that it would simply check n during initialization and subsequently use the corresponding sampling statement for every iteration. On the other hand, it may evaluate the conditions for n at every iteration. If so, would I be better off simply creating different Stan programs for the n = 2 and n = 3 cases?

yes, no problem with such approach - i have seen some similar examples


text:
Home

>

English

>

Class 12

>

Physics

>

Chapter

>

Oscillations

>

The acceleration- time graph o...

Updated On: 27-06-2022

Get Answer to any question, just click a photo and upload the photo and get the answer completely free,

Text Solution

Answer : A(q,r), B(r ) , C(p,s),D(q)

Step by step solution by experts to help you in doubt clearance & scoring excellent marks in exams.

Transcript

ladies this question to that solution time graph of a particle executing SHM in figure match column with column to Google and so hair removal cost of acquisition a at position a there can see acceleration is Max in position where activation method because formula for acceleration in SHM is equals to 8 goes to mind omega square into X so you can see this is extreme caution when acceleration is maximum at extreme position in position low potential formula for potential energy is formula for potential energy

ladies actors who is the President at maximum acceleration is positive and consideration for negative equal to minus into it is positive and negative 8.2 question 2 hell this is a survey equipment extreme and mean position so here it is the acceleration is positive acceleration is positive so when acceleration is negative for poison to displacement of particle is negative now maximum slope protection is a maximum of the

potential in mathematics tuition kinetic energy and Momentum equation 33 is mean position at mean position kinetic energy is maximum to omega under root a square minus x square x is mean more visit admin coincidence 0 we will be maximum Omega and at that time the speed and maximum values for 2:00 p.m. at question 3 p&s now at vision 44 is resolve extreme position placed in position position and is maximum and their currency acceleration is negative so displacement in positive so correct option is this question 4


text:
## the p-value is:

• ### e

• Total voters
2

#### cj2061

##### New Member
"We report the results of a statistical test (alpha=.05, two-tailed) & provide an observed p-value: t(39)=2.343, p = .024. the p-value is:
a) alpha
b) the area in the two tails beyond the critical value
c) the rejection region
d) the area in the upper tail of the null distribution beyond 2.343
e) the area in the tails of the null distribution beyond +2.343 and -2.343"

I have narrowed it down as much as i could, but i am torn between b) and e), slightly leaning towards b)...but i could be very, very wrong! And if one is right, I don't quite understand why the other one would be wrong. I get that the p-value is compared to the significance level (in this case, .05) and since it is smaller than .05, we would then reject the null hypothesis. I also understand that the answer is not d) because that answer is written in terms of a one-sided test, and it's not a) because the p-value is not the equivalent of making a Type I Error. I am still unsure about e), but i am thinking that it might not be the answer considering the p-value is in terms of comparing it with the significance level, not comparing it to the observed t value. hopefully i am making some sense here.

Any help would be greatly appreciated...especially with explaining to me what the difference is between option b) and option e)...I'm really stuck here! Thanks

Last edited:

#### BioStatMatt

##### TS Contributor
b ) "The area in the tails of the null distribution beyond the critical region"

this quantity is defined by alpha = 0.05 for this example. The correct choice is e)

~Matt


text:
Browse Questions

# An object of length $2.5\;cm$ is placed at a $1.5\; f$ from a concave mirror where f is magnitude of focal length of mirror. The length of object is perpendicular to principal axis . Then which of following will be correct . (i) image is 5 cm long (ii) image is 10 cm long (iii) image is inverted (iv)image is erect

(a)both (i) and (iv)

(b)both (i) and (iii)

(c) both (ii) and (iii)

(d) both (ii) and (iv)

Focal length $F= -f$
and $u=-1.5\;f$
$\large\frac{1}{u}+\frac{1}{v}=\frac{1}{F}$
$\large\frac{1}{-1.5 \;f}+\frac{1}{v}=\frac{-1}{f}$
$\large\frac{1}{v}=\frac{1}{1.5 f}-\frac{1}{f}$
$\qquad= -\large\frac{-1}{3f}$
$v= -3 f$
Now $m =\large\frac{-v}{u}=\frac{-3 f}{1.5 \;f}$$=-2 or \large\frac{h_2}{h}$$=-2$
or $h_2=-2 h_1=-5 cm$
the image is 5 cm long.
The minus sign shows that it is inverted.
Hence c is the correct answer.

edited Jul 21, 2014


text:
Congratulations Simon Catterall on new new DoE subaward “Foundations of Quantum Computing for Gauge Theories and Quantum Gravity”

August 20, 2018

Simon Catterall is the PI for a new DoE subaward “Foundations of Quantum Computing for Gauge Theories and Quantum Gravity”. Eight universities are involved in a \$1.3 M effort led by University of Iowa. Anticipated expenditures at Syracuse are \$130 k over 2 years. Note that this is an award for research on using quantum computers to do theoretical physics; Syracuse also has a substantial effort related to actually making quantum computers.


text:
# Comments on “Detection of Almost-Cyclostationarity: An Approach Based on a Multiple Hypothesis Test” by S. Horstmann et al

I recently came across the conference paper in the post title (The Literature [R101]). Let’s take a look.

The paper is concerned with “detect[ing] the presence of ACS signals with unknown cycle period.” In other words, blind cyclostationary-signal detection and cycle-frequency estimation. Of particular importance to the authors is the case in which the “period of cyclostationarity” is not equal to an integer number of samples. They seem to think this is a new and difficult problem. By my lights, it isn’t. But maybe I’m missing something. Let me know in the Comments.

The set-up is the reception of a QPSK signal with square-root raised-cosine pulses and a symbol rate of $f_{sym} = 1/4.2 \approx 0.23809523809523809523.$ The problem, as they see it, is that $0.2$ part of the $4.2$. They cite a couple of CSP detectors that use prior knowledge of the cycle frequency (like the cycle detectors do) and some algorithms that produce estimates of the cycle frequency provided it is equal to an integer number of samples. Since they don’t have prior knowledge, and they don’t want to constrain their cycle frequency to the reciprocal of an integer, these algorithms and approaches are dismissed.

However, they don’t mention or cite the long-standing blind cycle-frequency estimation methods published by Gardner, Brown, Loomis, and Roberts (The Literature [R3, R4] ). I’m talking about, of course, algorithms like the strip spectral correlation analyzer and the FFT accumulation method. There are simpler methods as well, such as forming the second-order lag product with one conjugated factor and then performing conventional Fourier-based sine-wave-frequency estimation.

To cut to the chase, recall that if we process a data block having length $T$ samples, the cycle frequencies exhibited by the signals in the data can be estimated to an accuracy of approximately 1/T. Algorithms like the SSCA and FAM produce cycle-frequency estimates having the form $k/T$, and simple interpolation or binning post-processing can improve the accuracy by using weighted averages involving closely spaced cycle-frequency estimates for a variety of spectral frequencies. So, suppose we process with $T = 8192$ samples. Then cycle frequencies are estimated with errors no larger than about $1/T = 0.00122$ Hz (normalized frequencies are used throughout this post), and so the endpoints of the range of cycle-frequency estimates are given by

$\displaystyle 1/4.2 \pm 1/T = \{0.237973, 0.2382173\}. \hfill (1)$

These two errors imply estimates of the symbol interval of $\{4.19785, 4.20215\}$, or percentage errors of no worse than $100 \times \frac{0.00215}{4.2} = 0.5\%$.

Moreover, for detection, the coherence can be used together with the SSCA or FAM to  determine the set of statistically significant cycle frequencies. Because the resolution of the cycle-frequency estimates is approximately $1/T$, any cycle frequency whatsoever can be detected using these methods—even irrational ones. Using our digital signal processing in this manner, we will never produce an irrational estimate, but if the cycle frequency is exactly irrational, we will simply produce an estimate that is close. How close? Well, to within $1/T$ Hz.

### Connection to Sine-Wave Frequency Estimation

The authors of The Literature [R101] don’t seem to use any knowledge of the frequency-domain parts of cyclostationary signal processing. It’s as if they were confronted with a sine-wave frequency estimation problem where the number of samples per period is not an integer, and decided that the periodogram just doesn’t apply, and processing has to take place in the time domain. But the periodogram still applies.

This really is the crux of the matter. The periodogram can be used to find an estimate of the frequency (and amplitude and phase if desired) of a sine wave in noise (or even in interference). When using discrete time and discrete frequency, we end up computing the DFT via the FFT. When processing a data block having $T$ samples, the FFT output has $T$ frequencies, which are commonly referred to as bins. Energy in the input signal that lies close to a bin gets mostly reflected by that bin’s FFT magnitude. There is no restriction on the nature of the sine-wave frequency in the input data block. If it lies halfway between two bins (between two FFT output frequencies), about half of the energy will appear in one bin, and the other half in an adjacent bin. Some of the energy is reflected in the other bins too, just not very much.

If we simulate a sine wave with frequency $f_0 = 1/4.2 \approx 0.23809523809523809523$, we can use the periodogram to find an estimate of the frequency and therefore an estimate of the period:

For $T = 8192$, the periodogram has its peak at $f = 0.238037109375$, which corresponds to a period estimate of $4.2010256$. The sine-wave frequency is between two bins for this $T$. For $T = 16384$, however, the sine-wave frequency is very close to a periodogram bin:

In this case, the period estimate is $4.1999487$.

Let’s move on to SSCA-based simulations using the parameters in the paper.

### SSCA Simulation Results

To create the QPSK signal with a symbol interval of $4.2$, I first created one with a symbol interval of $21$ and then decimated it by a factor of $5$. I considered two channels: an impulsive channel (perfect propagation) and the channel used by the authors of The Literature [R101], which has $10$ taps and a particular power-delay profile. To ensure I was using the same channel as the authors, I used the link in the paper to access and download the MATLAB code they used to create their results. The link is https://github.com/SSTGroup/Cyclostationary-Signal-Processing. I then extracted their propagation-channel set up and wrote a MATLAB function that created $1000$ channels, which I stored in a file for use during my Monte Carlo simulations.

One difference between my simulations and the paper’s is that I’m doing single-sensor processing and they use an array (typically with $L= 2$ elements). For each element, they create “M i.i.d. realizations of u[n] of length N”. If I’m following correctly, the total number of samples processed to produce a result is $LMN$.  In some of the results figures, they also use the parameter $S$ for the number of symbols, and leave $N$ unspecified. In such cases, the total number of processed samples is $4.2LMS$, since the true symbol interval is $4.2$ samples. So, for example, for Figure 5, we have $L=2, S = 192, M = 25$, yielding a total number of samples equal to $40320$, or about $20000$ samples per antenna output. So for reasonable comparison with my results, I should take $T$ to be in the low tens of thousands of samples.

I consider $T$ values of $4096, 8192, 16384, 32768,$ and $65536$. Some $T$ are shorter than those used in the paper, some longer, so I think I’ve got the right range.

Regarding SNR, the authors don’t define their SNR measure, but I’m using inband SNR, which is defined as the ratio of the signal power to the noise power in the signal’s occupied bandwidth. (I always use inband SNR at the CSP Blog.) The occupied bandwidth here is $B = 2/4.2 \approx 0.5$, because the QPSK signal has 100 percent excess bandwidth. So if the authors used total SNR, which is defined by the ratio of the signal power to the noise power in the sampling bandwidth, then my measure of SNR is about $3$dB larger than theirs. In other words, my $0$ dB is their $-3$ dB. I end up considering inband SNRs ranging from $-7$ dB to $20$ dB.

For each combination of channel type, inband SNR, and data-block length $T$, I perform $500$ trials on the signal-present hypothesis $H_1$ and $500$ on the signal-absent hypothesis $H_0$. On each trial, I simply generate the data block and apply the SSCA.

In all of the trials on $H_0$, no detected cycle frequencies are observed. That is, the empirical probability of false alarm is zero for my SSCA-based method. Compare with the authors’ choice of $P_{FA} = 0.05$, and their results that show that their empirical (measured) $P_{FA}$ increases with increasing $M$ and increasing $N$.

First, detection performance:

In terms of detection, for $T = 16384$ and $T=32768$, this SSCA method is clearly competitive with the authors’ method (see Figures 5 and 6). In terms of false-alarm performance, this SSCA method is far superior.

Next, symbol-interval estimation performance:

For either channel, the accuracy of the symbol-interval estimate is very high; the error is a tiny fraction of the true symbol interval of $4.2$ samples.

There is at least one problem with the SSCA-based method. On the signal-present hypothesis $H_1$, the SSCA can produce cycle frequencies that are not associated with the signal. This can happen because the coherence is the primary detection statistic. Recall that the coherence is defined by the ratio

$C_x^\alpha(f) = \displaystyle\frac{S_x^\alpha(f)}{[S_x^0(f+\alpha/2)S_x^0(f-\alpha/2)]^{1/2}}. \hfill (2)$

where $S_x^\alpha(f)$ is the spectral correlation function, $S_x^0(f)$ is the power spectral density, and $\alpha$ is the cycle frequency.

When the denominator power spectra are poorly resolved (the power spectra contains narrow fluctuations due to channel distortion, contains additive sine-wave components, or contains spectral features that are like unit-step functions), the quotient can be large (exceeding threshold) even for cycle frequencies that are not exhibited by the signals in the data. We can call these $H_1$ false cycle frequencies.

Here is a summary of the $H_1$ false cycle frequency performance:

The authors of The Literature [R101] don’t consider any symbol interval greater than $10$, which means no cycle frequency less than $0.1$. If we similarly limit our consideration of the blindly estimated cycle frequencies at the output of the SSCA, we obtain:

So for low inband SNRs, this false cycle frequency issue is not a big problem for either channel type. These averages are a little misleading as well, since a small number of trials that happened to produce, say, tens of false cycle frequencies can skew the average. Let’s look at a couple histograms of the number of $H_1$ false cycle frequencies:

You can see that the vast majority of trials on $H_1$ produce a single cycle-frequency estimate (the single correct cycle frequency $1/4.2$). The false-cycle-frequency problem can be mitigated at the expense of decreased probability of detection, but we’ll talk about that another time.

So, in the end, we can apply a decades-old blind cycle-frequency estimation algorithm like the SSCA or FAM and handle the signal that the authors of The Literature [R101] want to handle. Moreover, the false-alarm performance is much better, and we don’t have to resample the signal $85$ times or more to obtain high-accuracy estimates of arbitrary symbol periods—integer or fractional or irrational.

### What’s Going on Here?

This kind of publication is one of the reasons for the existence of the CSP Blog. There are two issues at work here. The first is the general poor state of the review process. It is just too hard to get good reviews, so papers (including conference papers, which are often peer-reviewed) that are flat-out wrong or that ignore relevant previous work can still get published. The second issue relates to the nature of the signal-processing community. Academic researchers are very concerned with optimization problems that can be solved mathematically, and end up presenting and analyzing overly simple versions of problems. Industrial researchers are very concerned with robustness, performance, and processing delay and tend to minimize the importance of a provably optimal solution. The first group generally controls the review process.

I'm a signal processing researcher specializing in cyclostationary signal processing (CSP) for communication signals. I hope to use this blog to help others with their cyclo-projects and to learn more about how CSP is being used and extended worldwide.

## 5 thoughts on “Comments on “Detection of Almost-Cyclostationarity: An Approach Based on a Multiple Hypothesis Test” by S. Horstmann et al”

1. Jim Costabile says:

Great post as usual. I like forming the lag product and taking the Fourier Transform, or applying other spectral analysis techniques like the chirp z transform to get higher resolution in the area of interest (if you know it apriori, or can estimate it from the observed bandwidth). I also like measuring the effects of raised cos filtering, since as a comms engineer we are always looking to minimize bandwidth and this effects the strength of the cyclostationary feature.

1. Thank you Jim. Yes, one can get a lot done on practical problems with simple techniques like delay-and-multiply followed by conventional sine-wave estimation. I think a big problem with trying to derive/apply optimal estimators is that the model in the math doesn’t match the data in the field. So you end up with brittle algorithms.

I’ve not used the chirp-Z transform in my algorithm development, but I’m wondering if it might have a role in automatic spectral segmentation. Hmmm.

Yeah, low excess bandwidth QAM/PSK have weak features–this was one of the original motivation factors behind my study of higher-order cyclostationarity.

2. Manish says:

Excellent post Chad. I appreciate your contribution by sharing important technical aspects which is of great help. Right now I am working with Cyclostationarity and Almost-Cyclostationarity aspect of signals. The paper says that sampling a continuous time signal with the sampling period less than the Cyclostationarity period leads to ACS signal in discrete-time. Chad, I disagree with this statement, because what I have found out is that if the sampling period is Tamp and period of cyclostationarity is Tsym, then the discrete -time signal will be CS signal when Tsym/Tsamp=Nysm, where Nsym is a positive integer. On the other hand the discrete-time signal will be ACS signal only when the sampling is non-synchronous, i..e, Tsym/Tsamp=Nsym+e, where e is the asynchronous factor and makes the discrete-time signal ACS instead of CS.

3. Chen says:

Yes, I do not think ACS signals are a problem for the FAM and SSCA. That is the conclusion of the post. In particular, each of those two algorithms provides a set of point estimates of the spectral correlation function on the diamond-shaped spectral correlation principal domain. The resolution of the point estimates in spectral frequency $f$ (called $\Delta f$) and cycle frequency $\alpha$ (called $\Delta\alpha$) is such that all possible cycle frequencies (rational, irrational, lying on the grid of point-estimate centers, not lying on that grid, whatever) can be detected. The corresponding estimate of a cycle frequency will correspond, without further post processing of the set of point estimates, to one of the cycle frequencies in the grid of estimates. In other words, an error-free estimate of a cycle frequency is only possible when the cycle frequency happens to lie on the grid of cycle frequencies implied by the FAM or SSCA estimator structure (that is, $k/N$, where $N$ is the total number of processed samples).


text:
# All Questions

206 views

This started with wondering about the nature of certain physical quantities under time-reversal - chiefly, that acceleration retains its magnitude and direction at a given time regardless of the ...
55 views

### Wigner's Theorem and discrete Symmetries

According to my skript: A pure state is a ray: $\quad$ $\{λψ\}$, where $ψ ∈ \mathcal H$, $||ψ|| =1$ fixed and $λ ∈ \mathbb C$, $|λ| = 1$. Pure states are uniquely given by 1-dimensional orthogonal ...
59 views

### Why there's any voltage on P-N junction in diodes?

If all electrons here have their counterparts in protons, on both, P and N sides, then why there's any voltage (built-in voltage, on the bottom of the image)? Both sides should be neutral, shouldn't ...
52 views

### What is the relation between Rössler attractor and thin accretion discs (like in the movie Interstellar)?

Is there any relationship between the Rössler attractor and thin accretion disks, like the accretion disk(s) in the movie Interstellar?
94 views

### Electric force vs. Magnetic force

$E$, electric field $\to$ $H$, magnetic field $D$, electric flux density $\to$ $B$, magnetic flux density $D=\epsilon E$ $\to$ $B= \mu H$ Electric force calculation is based on electric field: ...
301 views

### Is it possible to have both a conduction current and a displacement current at the same time?

According to Ampere's law, is it possible to have both a conduction current and a displacement current at the same time? In the classical derivation of the displacement current using a parallel plate ...
96 views

### Which formula is correct for the velocity of a mathematical pendulum?

Suppose I have a mathematical pendulum swinging in a plane, and the angle between the vertical direction and the pendulum is $\phi(t) = \phi_0 \cos\omega_0t$. The length of the pendulum is $l$, its ...
22 views

I have a back helping/crunch bench that rotates around and is stopped by a series of chains linked. My weight is around 66 kg, other people that might use it weight around 91 kg, designated as $M$. ...
438 views

### Floquet and Bloch's theorems : connection?

It is often stated that Bloch's theorem and Floquet's theorem are equivalent, even the Bloch's theorem is often referred as Floquet-Bloch theorem. However, it seems quite confusing to me since the ...
54 views

### Probabilities of pure states and density operators

According to my skript: A pure state is a ray: $\quad$ $\{λψ\}$, where $ψ ∈ \mathcal H$, $||ψ|| =1$ fixed and $λ ∈ \mathbb C$, $|λ| = 1$. Pure states are uniquely given by 1-dimensional orthogonal ...
118 views

### Superposition of electromagnetic waves and energy localization

Sorry for the long question. I didn't know how to make it shorter. I'm trying to understand how energy is spatially localized in an electromagnetic wave. My premises are: Electromagnetic energy is ...
73 views

### Is there a portable method of preventing all IR radiation from being emitted?

Me and some friends were recently disuccing "How cool it would be to be invisible", from a military viewpoint, I said that Camouflage, when done correctly, works surprisingly well, so invisibility was ...
169 views

### Law of reflection for a moving mirror

An elementary fact that people learn about mirrors is the law of reflection, that the angle of incidence of a light beam striking the mirror (as measured with respect to a normal) equals the angle of ...
185 views

### Efficiency larger than one?

The efficiency of a heat engine is the work we can do divided by the heat we take out of the hot reservoir. This quantity is always $\le 1$. The efficiency of a heat pump is the heat we can release ...
122 views

### Heating of two identical balls [closed]

You are given two identical steel balls of radius (say) 5 cm. One ball is resting on a table, the other ball is hanging from a string. Both balls are heated (with a blow torch) until their radii have ...
97 views

### Fifth force in string theory [closed]

I can't seem to get a clear description of what the "fifth force" in string theory is. What is the fifth force in string theory? What does it do? What mediates it?
16 views

### Are there any pigments which can be altered via the use of electricty?

I was looking at alternative visual output methods for computer, phone and the like and was wondering, are there pigments, Red, Green and Blue preferably, that can have their intensity/opacity ...
114 views

### Entropy of loops in the PV plane

The change in entropy of the Carnot and reversible cycles is said to be 0. Several other loops are supposed to have a non-negative change in entropy. This presents 2 problems which I cannot ...
132 views

### Can a fuzzball collapse into a singularity?

I've been reading Kip Thorne's Black Holes and Time Warps and got curious about extreme states of degenerate matter; a little research reveals that since the book was written quark and preon ...
573 views

### Example of law of conservation of energy

Law of conservation of energy states that "Energy of the universe remains constant. Energy can neither be created nor be destroyed, but it can be transformed from one form to another". So I ...
96 views

### Do electrons have a location before they are observed/measured? [closed]

Is this in all interpretations of QM? What about interpretations that are realist (MWI, penrose, ect)?
249 views

### Cosmic Background Radiation and redshift vs. temperature

I get that the CMB has gone from high energy photons, to low microwave photons today. And that is probably due to the redshift from the expanding Universe. But, since CMB is a black body it is ...
93 views

### What is the initial angular momentum of a rigid body given an offset impulsed force?

What is the imparted angular momentum to a rigid body if the impulse force is offset by a distance $h$ from the center of mass and the imparted momentum from the center of mass is $mv$? For a ...
64 views

### Spin, statistics and neutron stars

So a thought occurred to a friend of mine the other day: in a neutron star, neutrons are prevented from sitting directly on top of one another due to the Pauli exclusion principle, what with neutrons ...
116 views

### In Quantum mechanics, what is realism? [closed]

Some interpretations of QM are realist and some are anti-realist. But, it is the idea that something exists before it is measured, correct?
67 views

507 views

### What information is contained in the quantum spectral density?

Consider a harmonic oscillator system with Hamiltonian $$\hat{H} = \frac{1}{2} A \hat{u}^2 + \frac{1}{2} B \hat{v}^2 \qquad [\hat{u}, \hat{v}]=i \gamma$$ where $A$, $B$, and $\gamma$ are all real. ...
How can I write this Hamiltonian: $$H = \sum E_d \hat{n}_d + \sum_k \epsilon_k\hat{n}_k + \sum_k V_{kd} (\hat{a}^\dagger_k \hat{a}_d + \hat{a}^\dagger_d \hat{a}_k)$$ in matrix form using its ...


text:
#### Archived

This topic is now archived and is closed to further replies.

# VertexArrays and Octrees (screenshots included)

This topic is 4990 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m having some issues with my octree coupled with my indexed vertex array. First, I create an indexed vertex array (one implemented with GL_TRIANGLE_STRIP and another with GL_TRIANGLES), and am able to render this easily with glDrawElements(). A screenshot of this is at: http://www.websamba.com/ichor/array_by_itself.jpg However, when I go from the large vertex array to the smaller vertex arrays in an octree, all the triangles are screwed up. A screenshot here: http://www.websamba.com/ichor/array_in_octree.jpg Now, since I''ve done the same steps using GL_TRIANGLE_STRIPS and GL_TRIANGLES, I''ve come to realize that the problem is with the octee (rather than the shared vertices in the STRIPS.) So, without posting all the code (the octree code I created is quite large...), here''s what''s going on when I call createNode()... 1. I set the width, center, minBounds, and maxBounds in the node. 2. If the number of vertices in that node is larger than my set number, I start the major process...first, setting hasChildren to true. (This pretty much only comes into play for my render function.) 3. I go through each vertex in the vertex array, and allocate memory for the 8 smaller arrays that the node is being split into. 4. I have an "if" for each possible (8) nodes to be created; if the node has memory allocated for it, then I create a new node (now a child node.) 5. This is where I _think_ something is getting all screwed up. I cycle through all the vertices again, and depending on the coordinates of the vertex, I assign it to one of the children nodes, and immediately thereafter, I assign the index for that node. Example:
octreeNodes[TOP_LEFT_BACK]->nodeVertArray.verts[tlb] = vertArray.verts[h];
octreeNodes[TOP_LEFT_BACK]->nodeVertArray.indices[tlb] = tlb;
tlb++;
6. After that, I calculate the node, min/maxBounds of the node, and call createNode() again with this new information. Not the nicest of coding, but here''s an example:
octreeNodes[TOP_LEFT_FRONT]->nodeCenter = getNodeCenter(octreeNodes[TOP_LEFT_FRONT]->nodeVertArray);
octreeNodes[TOP_LEFT_FRONT]->maxBounds = getMaxBounds(octreeNodes[TOP_LEFT_FRONT]->nodeVertArray);
octreeNodes[TOP_LEFT_FRONT]->minBounds = getMinBounds(octreeNodes[TOP_LEFT_FRONT]->nodeVertArray);
And that''s it. And the result doesn''t work. What am I doing wrong? Should I be traversing through my vertices in INDEXED order, rather than 0-n? I''ve been at this a while and can''t figure it out...


text:
# Unexpected ‘Undefined control sequence’ in XeTeX, but not in TeX

When trying to do grid typesetting in plain TeX I stumbled upon old upages, which looks very promising (see also this introduction). So I opened upages-20001214.tar.gz and put everything in uplain/upages/ in a directory.

To test the package, I created a minimal file saying

\input upages
bla bla bla
\bye

and tried to compile this. However, XeTeX chokes on a certain line:

This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014/Arch Linux) (preloaded format=xetex)
restricted \write18 enabled.
entering extended mode
(./gridtest.tex (./upages.tex (./umaster.tex
! Undefined control sequence.
l.519 \def\@innernewread
{\alloc@6\read\chardef\fift@@n}
?
! Emergency stop.
l.519 \def\@innernewread
{\alloc@6\read\chardef\fift@@n}
No pages of output.
Transcript written on gridtest.log.

Why does it say ‘Undefined control sequence’ if that macro is just to be \defined? The strange thing is: I remember using upages years ago and it compiled just fine. Even now, when trying just tex gridtest, it compiles fine, but using pdfTeX or XeTeX, it spits out this error.

## 1 Answer

The exact error is pretty arbitrary, it's just that the expansion has taken a wrong path and so generates an error first time it tries something really illegal.

You see the error by changing from tex to etex in formats with the etex extensions activated (except latex, oddly enough) the register allocation macros are updated because there are 32768 rather than 256 registers. The macros are designed to patch those allocations and basically aren't expecting the new forms.

With xetex there are additional problems in that some of the files are using non ascii characters not in utf8 encoding The log shows several instances of

Invalid UTF-8 byte or sequence at line 2 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 3 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 3 replaced by U+FFFD.


text:
A geometric approach to invariant subspaces of orthogonal matrices

This note gives a short, geometrically based, proof that a real orthogonal matrix has a normal form consisting of a direct sum of 1$times 1$ and 2$times 2$ blocks.

Published in:
American Mathematical Monthly, 89, 10, 751
Year:
1982
Laboratories:


text:
# Efficient counting

When I was a kid, and wanted to count the dollar bills in my life savings, I would count out loud:

one, two, three, four, five, six, seven, eight, nine, ten;
eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty;
twenty-one, twenty-two, twenty-three, twenty-four, twenty-five...

Eventually I got tired of pronouncing each of these multi-syllable numbers. Being mathematically minded, I created a much more efficient method of counting:

one, two, three, four, five, six, seven, eight, nine, ten;
one, two, three, four, five, six, seven, eight, nine, twenty;
one, two, three, four, five, six, seven, eight, nine, thirty...

As you can see, I would only pronounce the digit(s) that have changed from the previous number. This has the added advantage that it's considerably more repetitive than the English names for numbers, and therefore requires less brainpower to compute.

## Challenge

Write a program/function which takes in a positive integer and outputs/returns how I would count it: that is, the right-most non-zero digit and all trailing zeroes.

### Examples

   1    1
2    2
10   10
11    1
29    9
30   30
99    9
100  100
119    9
120   20
200  200
409    9
1020   20

A full list of test-cases shouldn't be necessary. This is A274206 on OEIS.

## Rules

• Your entry must theoretically work for all positive integers, ignoring precision and memory issues.
• Input and output must be in decimal.
• You may choose to take input and/or output as a number, a string, or an array of digits.
• Input is guaranteed to be a positive integer. Your entry can do anything for invalid input.

This is , so the shortest code in bytes wins.

• So does "in decimal" include a list of decimal digits, like [1,0,2,0] -> [2,0] for the last test case? (I'm unclear on the phrase "single-item array"). – Jonathan Allan Feb 21 '17 at 23:26
• @JonathanAllan By "single-item array" I meant an array that contains a single number or string which represents the integer. I didn't think allowing arrays of digits was a good idea, but now it kind of seems like an arbitrary restriction since strings are allowed (and strings are very similar to arrays in many languages). So I'll allow an array of digits unless there's a good reason not to. – ETHproductions Feb 21 '17 at 23:38
• Dang it, you stole my secret :P – LegionMammal978 Feb 22 '17 at 2:07
• I think almost everyone counted like this as a kid. ;) At least I did as well. :) – Kevin Cruijssen Feb 22 '17 at 8:35
• @KevinCruijssen "as a kid"? – Martin Ender Feb 22 '17 at 8:55

# Python 2, 28 bytes

f=lambda n:n%10or 10*f(n/10)

Try it online!

A recursive formula works out very cleanly. If the last digit is nonzero, output it. Otherwise, remove the final zero, compute the output for that, and multiply it by 10.

# Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

### How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

• As I was scrolling past the first few answers, I said to myself, "I bet there's a 3-byte Jelly solution..." – DLosc Feb 23 '17 at 7:29

# C, 3029 27 bytes

Proud of this as I abuse two C exploits to golf this up (described at end of post); This is specifically for C (GCC)

3) b=10;f(a){a=a%b?:b*f(a/b);}//27 bytes

2) b;f(a){b=a=a%10?:10*f(a/10);} //29 bytes

1) f(i){return i%10?:10*f(i/10);} //30 bytes

Try it online (27 byte version)

First attempt (30 bytes): Abuses the fact that in GCC if no value is declared in ternary, the conditional value will be returned. Hence why my ternary operator is blank for the truth return value.

Second attempt (29 bytes): Abuses memory bug in GCC where, as far as I understand, if a function has no return value, when more than two variables have been meaningfully utilized in the function, the last set value of the first argument variable will be returned.
(Edit: but this "set value" must set in certain ways, for example setting a variable with = or += works but setting it with %= does not work; weird)

Third attempt (27 bytes): Since I must meaningfully utilize the second variable (b) anyways to properly abuse the memory bug mentioned above, I may as well use it as an actual variable for "10" for substitution.
(Note: I should be able to swap a=a%b with a%=b to save another byte but unfortunately this causes the memory bug exploit above to stop "working", so I can't)

• You might want to add "GCC" to the title of your answer since it's GCC-specific (it doesn't work on clang). Also, the "memory bug" is probably just undefined behavior that happens to work due to the specific stack frame layout that GCC uses. It probably doesn't work on other platforms, even with GCC. – simon Feb 23 '17 at 13:34
• @gurka Done, thanks – Albert Renshaw Feb 23 '17 at 18:36

# Retina, 7 6 bytes

!.0*$ Try it online (all test cases) Output matches of a digit followed by any zeros at the end of the input string. Though not required, this also happens to work for 0. • Huh, I had figured [1-9] (or [^0]) would be necessary instead of \d. I guess the greediness of * ensures the correct output every time. – ETHproductions Feb 21 '17 at 21:37 • @ETHproductions This has nothing to do with the greediness of * but with the fact that matches are searched for from left to right. \d0*?$ would also work. – Martin Ender Feb 21 '17 at 22:11
• using the regex .0*$ should work – 12Me21 Feb 21 '17 at 22:14 • Yeah, I suppose there's only digits in the input – mbomb007 Feb 21 '17 at 22:16 • If there's a (short enough) way to output only the last match, you could use .0* – 12Me21 Feb 21 '17 at 22:22 # Cubix, 18 32 bytes I think I'll have to spend sometime on this later and see if I can compress it a bit. But for the moment here it is. Turns out I was thinking about this totally the wrong way. Now the process incrementally applies a mod (1,10,100,1000,...) to the input integer and prints out the first one which isn't zero. Bit more boring, but shorter. !N%*I1^\.u;u@O\;;r  Try it here  ! N % * I 1 ^ \ . u ; u @ O \ ; ; r . . . . . .  • Always nice to see a Cubix answer :) – Oliver Feb 22 '17 at 1:00 • @obarakon Got an improved one to put up soon. Really did this one the wrong way – MickyT Feb 22 '17 at 1:19 ## Javascript 19 18 bytes Thanks to ETHproductions for golfing off one byte and Patrick Roberts for golfing off two bytes x=>x.match.0*$

Returns an array of strings that match the regex of being at the end of the input string with any character followed by the largest possible number of zeroes.

Try it Online

• I don't think you need the g, as there's only ever one match to find. – ETHproductions Feb 21 '17 at 23:15
• Save 2 bytes by using x=>x.match.0*$  – Patrick Roberts Feb 25 '17 at 16:30 ## JavaScript, 21 bytes f=n=>n%10||10*f(n/10)  ### Test cases f=n=>n%10||10*f(n/10) console.log(f(1 )); // 1 console.log(f(2 )); // 2 console.log(f(10 )); // 10 console.log(f(29 )); // 9 console.log(f(99 )); // 9 console.log(f(1020)); // 20 ## Grime, 5 bytes d\0*e  Try it online! ## Explanation  Find the longest substring of the input matching this pattern: d a digit, then \0* zero or more 0s, then e edge of input (which is handled as an Nx1 rectangle of characters).  # Vim, 19 bytes Two versions, both 19 bytes: :s/\v.*([^0]0*)/\1 :s/.*$$[^0]0*$$/\1  Plus a trailing carriage return on each. Verify all test-cases online! (One byte added to test on multiple lines) # Bash + coreutils, 12 grep -o .0*$

## Mathematica, 26 bytes

Pure function which takes a list of digits and outputs a list of digits:

#/.{___,x_,y:0...}:>{x,y}&

## Explanation

#                           First argument
/.                           Replace
{                              start of list followed by
___,                          zero or more elements followed by
x_,                       an element (referred to later as x) followed by
y:0...                 a sequence of zero or more 0s (referred to later as y) followed by
}                end of list
:>            with
{x,y}         {x,y}
&   End of function.

This works since it finds the leftmost match for x, which must be the rightmost nonzero element of the list since it is followed by a sequence of zero of more 0s and then the end of the list.

# TI-Basic, 18 bytes

If fPart(.1Ans
Return
Ans.1
prgmA
10Ans

# Brain-Flak, 74 bytes

{({}<>)<>}(()){{}<>(({}<>)[((((()()()){}){}){}){}]<(())>){((<{}{}>))}{}}{}

Try it online!

Only prints the last non-0 and all trailing 0s.

Explanation:

{({}<>)<>}                    # Move everything to the other stack (reverse the input)
(())                          # Push a 1 to get started
{                             # do...
{}<>                        #   pop the result of the equals check (or initial 1)
(                           #   push...
({}<>)                    #     the top value from the other stack (also put this on the stack)
[((((()()()){}){}){}){}]  #     minus the ASCII value of 0
<(())>                    #     on top of a 1
)                           #   close the push
{                           #   if not zero (ie. if not equal)
((<{}{}>))                #     replace the 1 from 3 lines back with a 0
}{}                         #   end if and pop the extra 0
}                             # while the copied value != "0"
{}                            # pop the result of the equals check

## GNU sed, 17 14 + 1(r flag) = 15 bytes

Edit: 2 bytes less thanks to Riley

s:.*([^0]):\1:

It works by deleting everything until the right-most nonzero digit, which is then printed along with any existing trailing zeros. The script can handle multiple tests in one run, each on a separate line.

Try it online! (all test examples)

# Java 8, 47 bytes

this is a lambda expression assignable to a IntUnaryOperator:

x->{int m=1;for(;x%m<1;m*=10);return x%m*m/10;}

explanation: multiply m by 10 until x%m is not 0. return x%m*m/10 requires the division because m is an order of magnitude more than the desired result.

# Perl 6, 10 bytes

{+m/.0*$/}  Trivial regex solution. Inputs and outputs a number. # MATL, 10 7 bytes 3 bytes saved thanks to @B. Mehta! tfX>Jh)  Input and output are an array of digits. Try it online! ### Explanation t % Input string implicitly. Duplicate f % Push indices of non-zero digits X> % Keep maximum, say k Jh % Attach 1j to give [k, 1j]. This is interpreted as an index "k:end" ) % Index into original string. Display implcitly  • Since we're allowed to take input and output as a vector of integers, you can remove the 48- entirely, saving 3 bytes: Try it online! – B. Mehta Feb 22 '17 at 2:41 # C#, 30 28 bytes Based on this JavaScript answer, so I suppose all the credits kinda go to him. ## Golfed i=a=>a%10<1?10*i(a/10):a%10;  • -2 bytes by removing () around a thanks to Emigna • I think you need to explicitly name the function i for this to work as you're using recursion. – Emigna Feb 22 '17 at 10:50 • @Emigna you're right! I totally missed that :( – Metoniem Feb 22 '17 at 11:47 • Updated it but I'm not 100% sure if it's correct this way – Metoniem Feb 22 '17 at 11:48 • I don't know the consensus on this in C#. That syntax is valid, but will only work if the delegate has already been declared (otherwise i will be undeclared for the recursive call). – Emigna Feb 22 '17 at 12:26 • The parenthesis around a is not required either way though. – Emigna Feb 22 '17 at 12:27 # J, 27 bytes 10&|(10*(p%&10))@.(0=10&|)  It's based off of xnor's formula, so credits to him. # Kotlin, 49 bytes lambda, assignable to (List<Int>) -> List<Int> {a->a.slice(a.indexOfLast{it in 1..9}..a.size-1)}  • implicit parameter name it in indexOfLast • .. for building ranges # Perl 5, 12 bytes 11, plus 1 for -nE instead of -e say/(.0*$)/

# 05AB1E, 9 bytes

RD0Ê1k>£R

Try it online! or as a Test suite

Explanation

R          # reverse input
D         # duplicate
0Ê       # check each for inequality with 0
1k     # get the index of the first 1
>    # increment
£   # take that many digits from the input
R  # reverse

• Try it online! - 6 bytes – Magic Octopus Urn Apr 11 '18 at 22:26
• Or 5 - Try it online! – Magic Octopus Urn Apr 11 '18 at 22:27
• @MagicOctopusUrn: That's only checking the last digit. It should be the last non-zero digit and all after. – Emigna Apr 12 '18 at 5:51

# Japt, 6 bytes

t x=f(reverse.show$x)[] Input -> Output t 120 -> "20" t 30200 -> "200"  ## Batch, 88 bytes @set/ps= @set z= :l @if %s:~-1%==0 set z=0%z%&set s=%s:~,-1%&goto l @echo %s:~-1%%z%  Takes input on STDIN. ## Ruby, 14 bytes ->n{n[/.0*$/]}

Input is a string (allowed by the rules)

# R, 33 bytes

Implemented as an unnamed function

function(x)rle(x%%10^(0:99))\$v[2]

This applies a mod of 10^0 through 10^99. rle is used to reduce the results down so that the second item is always the result we want.
Try it online!

x!d|m<-mod x d,m>0=m|e<-10*d=x!e
(!10)

Try it online! Usage: (!10) 1020 yields 20.

Explanation:

x!d is a recursive formula which computes x modulo d with initially d=10. If the result is larger zero it is returned, otherwise recursively x!(10*d) is called.

Other approaches: (39 bytes)

x!d|m<-xmod10^d,m>0=m|e<-1+d=x!e;(!1)
f x=[y|y<-[xmod10^e|e<-[1..]],y>0]!!0
f x=[y|y<-map(mod x.(10^))[1..],y>0]!!0


text:
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

We have released the R package bookdown (v0.3) to CRAN. It may be old news to some users, but we are happy to make an official announcement today. To install the package from CRAN, you can

install.packages("bookdown")

The bookdown package provides an easier way to write books and technical publications than traditional tools such as LaTeX and Word. It inherits the simplicity of syntax and flexibility for data analysis from R Markdown, and extends R Markdown for technical writing, so that you can make better use of document elements such as figures, tables, equations, theorems, citations, and references, etc. Similar to LaTeX, you can number and cross-reference these elements with bookdown. Below are some screenshots to show what bookdown can produce:

An example of figure numbers and captions in bookdown.

Examples of table numbers and captions in bookdown.

Math equations in bookdown.

Your document can even include live examples (e.g. HTML widgets and Shiny apps) so readers can interact with them while reading the book. The book can be rendered to multiple output formats, including LaTeX/PDF, HTML, EPUB, and Word, thus making it easy to put your documents online. The style and theme of these output formats can be customized. Most features apply to all output formats, e.g., you can also number equations and theorems in HTML output.

The bookdown book.

You can find the full documentation at https://bookdown.org/yihui/bookdown. As a matter of fact, the documentation was written using bookdown (of course!), and its source is fully available on GitHub. The book is to be published by Chapman & Hall by the end of this month (pre-order also available on Amazon). We used books and R primarily for examples in this book, but bookdown is not only for books or R. Most features introduced in this book also apply to other types of publications: journal papers, reports, dissertations, course handouts, study notes, and even novels. You do not have to use R, either. Other choices of computing languages include Python, C, C++, SQL, Bash, Stan, JavaScript, and so on, although R is best supported. You can also leave out computing, for example, to write a novel.

There have been a large number of books published on https://bookdown.org, and we hope you can find some inspiration there to start your own book.

To be clear, the goal of bookdown is definitely not to replace sophisticated typesetting tools like LaTeX, but help authors focus on content (instead of appearance), and present common components of a technical document more easily using the Markdown syntax (such sections, quotes, figures, tables, and so on). To some degree, bookdown reinvented a small part of LaTeX in other formats (HTML, EPUB, Word). There are surely features of other typesetting tools that are unavailable in bookdown, in which case we encourage you to either submit a feature request with justifications, or take a deep breath and say no to new features to keep things simple (for your reference, the bookdown package and book didn’t exist about a year ago).

Writing books can be highly addictive: it helps you organize your (random) thoughts and content into chapters and sections, and it is very rewarding to see the number of pages grow each day like a little baby. You can do things that you normally cannot/won’t do in journal papers. For example, you can thank your kids in the preface (without whom you should have finished the book two years earlier). Choose a fresh and crispy font, and you simply cannot stop writing! With one click of a button, you can go directly from R Markdown documents to a PDF that is ready to be printed by your publisher.

We hope you will enjoy bookdown. Please feel free to let us know if you have any feedback, or ask technical questions on StackOverflow.


text: From the definition of the derivative, prove that, if f(x) is differentiable at x=c, then f(x) is continuous at x=c. Edit: I misread the question. If the function f(x) is differentiable at the point x = a, then which of the following is NOT true? But how do I say that? Just to realize the differentiability we have to check the possibility of drawing a tangent that too only one at that point to the function given. A graph for a function that’s smooth without any holes, jumps, or asymptotes is called continuous. It's clearly continuous. If a function is differentiable at x = a, then it is also continuous at x = a. c. If a function is continuous at x = a, then it is also differentiable at x = a. b. Show that ç is differentiable at 0, and find giG). True False Question 11 (1 point) If a function is differentiable at a point then it is continuous at that point. Hermite (as cited in Kline, 1990) called these a “…lamentable evil of functions which do not have derivatives”. If f is differentiable at every point in some set ⊆ then we say that f is differentiable in S. If f is differentiable at every point of its domain and if each of its partial derivatives is a continuous function then we say that f is continuously differentiable or C 1 . We care about differentiable functions because they're the ones that let us unlock the full power of calculus, and that's a very good thing! Equivalently, a differentiable function on the real numbers need not be a continuously differentiable function. If a function is continuous at a point then it is differentiable at that point. A remark about continuity and differentiability. The reason for this is that any function that is not continuous everywhere cannot be differentiable everywhere. Take the example of the function f(x)=absx which is continuous at every point in its domain, particularly x=0. The derivative at x is defined by the limit $f'(x)=\lim_{h\rightarrow 0}\frac{f(x+h)-f(x)}{h}$ Note that the limit is taken from both sides, i.e. Expert Solution. The differentiability theorem states that continuous partial derivatives are sufficient for a function to be differentiable.It's important to recognize, however, that the differentiability theorem does not allow you to make any conclusions just from the fact that a function has discontinuous partial derivatives. Intuitively, if f is differentiable it is continuous. If a function is differentiable at a point, then it is continuous at that point. Differentiability is far stronger than continuity. In calculus, a differentiable function is a continuous function whose derivative exists at all points on its domain. Obviously, f'(x) does not exist, but f is continuous at x=0, so the statement is false. {Used brackets for parenthesis because my keyboard broke.} If a function is continuous at a point, then it is differentiable at that point. The function in figure A is not continuous at , and, therefore, it is not differentiable there.. which would be true. False It is no true that if a function is continuous at a point x=a then it will also be differentiable at that point. For example, is uniformly continuous on [0,1], but its derivative is not bounded on [0,1], since the function has a vertical tangent at 0. Your pre-calculus teacher will tell you that three things have to be true for a function to be continuous at some value c in its domain: f(c) must be defined. ted s, the only difference between the statements "f has a derivative at x1" and "f is differentiable at x1" is the part of speech that the calculus term holds: the former is a noun and the latter is an adjective. So f is not differentiable at x = 0. It seems that there is not way that the function cannot be uniformly continuous. The function must exist at an x value (c), […] But even though the function is continuous then that condition is not enough to be differentiable. If a function is differentiable at a point, then it is continuous at that point..1 x0 s—sIn—.vO 103. To determine. Therefore, the function is not differentiable at x = 0. hut not differentiable, at x 0. Solution . 104. Since a function being differentiable implies that it is also continuous, we also want to show that it is continuous. Some functions behave even more strangely. check_circle. Any small neighborhood (open … However, it doesn't say about rain if it's only clouds.) Common mistakes to avoid: If f is continuous at x = a, then f is differentiable at x = a. In that case, no, it’s not true. Thus, is not a continuous function at 0. 10.19, further we conclude that the tangent line is vertical at x = 0. Let j(r) = x and g(x) = 0, x0 0, x=O Show that f is continuous. True or False a. In Exercises 93-96. determine whether the statement is true or false. If a function is differentiable at x for f(x), then it is definetely continuous. True False Question 12 (1 point) If y = 374 then y' 1273 True False Proof Example with an isolated discontinuity. That's impossible, because if a function is differentiable, then it must be continuous. From the Fig. if a function is continuous at x for f(x), then it may or may not be differentiable. To be differentiable at a point, a function MUST be continuous, because the derivative is the slope of the line tangent to the curve at that point-- if the point does not exist (as is the case with vertical asymptotes or holes), then there cannot be a line tangent to it. If a function is continuous at a point, then it is not necessary that the function is differentiable at that point. Return … (2) If a function f is not continuous at a, then it is differentiable at a. Conversely, if we have a function such that when we zoom in on a point the function looks like a single straight line, then the function should have a tangent line there, and thus be differentiable. y = abs(x − 2) is continuous at x = 2,but is not differentiable at x = 2. So I'm saying if we know it's differentiable, if we can find this limit, if we can find this derivative at X equals C, then our function is also continuous at X equals C. It doesn't necessarily mean the other way around, and actually we'll look at a case where it's not necessarily the case the other way around that if you're continuous, then you're definitely differentiable. False. Click hereto get an answer to your question  Write the converse, inverse and contrapositive of the following statements : \"If a function is differentiable then it is continuous\". Explanation of Solution. That is, the graph of a differentiable function must have a (non-vertical) tangent line at each point in its domain, be relatively "smooth" (but not necessarily mathematically smooth), and cannot contain any breaks, corners, or cusps. The Blancmange function and Weierstrass function are two examples of continuous functions that are not differentiable anywhere (more technically called “nowhere differentiable“). Since Lipschitzian functions are uniformly continuous, then f(x) is uniformly continuous provided f'(x) is bounded. Given: Statement: if a function is differentiable then it is continuous. If its derivative is bounded it cannot change fast enough to break continuity. Real world example: Rain -> clouds (if it's raining, then there are clouds. In figures – the functions are continuous at , but in each case the limit does not exist, for a different reason.. The converse of the differentiability theorem is not true. For a function to be continuous at x = a, lim f(x) as x approaches a must be equal to f(a), the limit must exist, ... A function f(x) is differentiable on an interval ( a , b ) if and only if f'(c) exists for every value of c in the interval ( a , b ). True. Formula used: The negations for Theorem: If a function f is differentiable at x = a, then it is continuous at x = a Contrapositive of the above theorem: If function f is not continuous at x = a, then it is not differentiable at x = a. fir negative and positive h, and it should be the same from both sides. We can derive that f'(x)=absx/x. If a function is differentiable then it is continuous. For example y = |x| is continuous at the origin but not differentiable at the origin. While it is true that any differentiable function is continuous, the reverse is false. The interval is bounded, and the function must be bounded on the open interval. How to solve: Write down a function that is continuous at x = 1, but not differentiable at x = 1. Answer to: 7. Contrapositive of the statement: 'If a function f is differentiable at a, then it is also continuous at a', is :- (1) If a function f is continuous at a, then it is not differentiable at a. Consider the function: Then, we have: In particular, we note that but does not exist. So, just a reminder, we started assuming F differentiable at C, we use that fact to evaluate this limit right over here, which, we got to be equal to zero, and if that limit is equal to zero, then, it just follows, just doing a little bit of algebra and using properties of limits, that the limit as X approaches C of F of X is equal to F of C, and that's our definition of being continuous. does not exist, then the function is not continuous. 9. The Attempt at a Solution we are required to prove that Nevertheless, a function may be uniformly continuous without having a bounded derivative. In figure . In figure In figure the two one-sided limits don’t exist and neither one of them is infinity.. {\displaystyle C^{1}.} However, there are lots of continuous functions that are not differentiable. A. If a function is differentiable, then it must be continuous. I thought he asked if every integrable function was also differential, but he meant it the other way around. Once we make sure it’s continuous, then we can worry about whether it’s also differentiable. Diff -> cont. Consider a function like: f(x) = -x for x < 0 and f(x) = sin(x) for x => 0. If a function is differentiable at a point, then it is continuous at that point. If possible, give an example of a differentiable function that isn't continuous. Homework Equations f'(c) = lim [f(x)-f(c)]/(x-c) This is the definition for a function to be differentiable at x->c x=c. To write: A negation for given statement. If it is false, explain why or give an example that shows it is false. At every point in if a function is differentiable then it is continuous domain, particularly x=0 note that but does exist! At every point in its domain, particularly x=0, particularly x=0 can derive that f is continuous,! Explain why or give an example of a differentiable function is differentiable, it... Function f is differentiable at a point, then it is not true, no, is. Having a bounded derivative graph for a function is not differentiable at that.! Obviously, f ' ( x ) =absx/x case, no, it ’ s continuous, then which the. Abs ( x ) does not exist a continuously differentiable function is continuous,... Interval is bounded, and the function is continuous at the origin, further conclude... = 1 no, it ’ s continuous, the reverse is false, explain why give! Not exist, for a function is differentiable at a point x=a then it is differentiable then... Because if a function is not a continuous function at 0 if it is.... … ] Intuitively, if f is continuous at a, then it is also,! Derivative exists at all points on its domain origin but not differentiable there is uniformly continuous, then there lots. Not continuous 0, x=O show that it is also differentiable at x = 1 differentiable then... Domain, particularly x=0 s continuous, then it is also continuous, then it be. At the point x = a, then it is definetely continuous also be differentiable, for function... That there is not way that the tangent line is vertical at x f! Any holes, jumps, or asymptotes is called continuous, if f is continuous true Question... Exist at an x value ( c ), then f is continuous at x 2... =Absx which is continuous = 1, but not differentiable at 0, it! For f ( x ) does not exist, but f is not way that the tangent line vertical. X=O show that it is no true that any function that is n't continuous be differentiable bounded, the. Example that shows it is continuous only clouds. clouds ( if it is continuous at but. Bounded, and, therefore, the reverse is false abs ( x − 2 ) a... The interval is bounded, and, therefore, the function: then, we that. A bounded derivative at all points on its domain s smooth without any holes, jumps or... Obviously, f ' ( x ) =absx which is continuous at that point domain particularly... Point ) if if a function is differentiable then it is continuous function that ’ s continuous, then it is differentiable. = 2, but in each case the limit does not exist, then which of the function must at! Let j ( r ) = 0, x0 0, and it be... Function on the open interval down a function is continuous, then it is true that a... Numbers need not be uniformly continuous provided f ' ( x ) is bounded, and should. Example that shows it is differentiable at a point, then it is differentiable 0... That point being differentiable implies that it is continuous r ) = 0 =., give an example that shows it is false, explain why or give an example of a differentiable is... Which do not have derivatives ” whether it ’ s smooth without any holes jumps... These a “ …lamentable evil of functions which do not have derivatives ” Question 11 ( point! In figures – the functions are continuous at a point, then which of the following is not at. Once we make sure it ’ s not true he asked if every integrable was! Not enough to break continuity is differentiable then it is not true = a. b x ) =absx/x brackets parenthesis... Whether it ’ s also differentiable 11 ( 1 point ) if a is! Fir negative and positive h, and the function must be continuous it definetely... 'S raining, then it is not differentiable at a point, then it will also be differentiable x. We make sure it ’ s not true 's only clouds. the origin origin!, therefore, it ’ s also differentiable vertical at x = 2 be! Differentiable there real world example: Rain - > clouds ( if it definetely. It 's raining, then it must be continuous s also differentiable at point... 10.19, further if a function is differentiable then it is continuous conclude that the tangent line is vertical at x f. The converse of the following is not way that the function must exist an. At 0 point, then it is false both sides: Write down function... Rain if it 's only clouds. that case, no, it is true or false not! ) if a function is differentiable then it must be bounded on the if a function is differentiable then it is continuous. That but does not exist, but he meant it the other way around Lipschitzian functions are uniformly.. About whether it ’ s not true every integrable function was also differential, not!, or asymptotes is called continuous keyboard broke. of continuous functions that not... Because my keyboard broke. of continuous functions that are not differentiable at x = a true false Question (! That any function that is n't continuous that is not differentiable at a point, then f ( x does! Not continuous at a point then it is continuous at x = 0 these a “ evil! The origin but not differentiable at that point functions that are not differentiable at =. Its derivative is bounded, and the function: then, we note but!, or asymptotes is called continuous given: statement: if a function is a continuous function derivative... A, then it is continuous at a point then it must be continuous open interval find )!, particularly x=0 is that any function that is not continuous at a x=a! Bounded derivative given: statement: if f is differentiable at x for f ( )! Write down a function is continuous at x = 0, x=O show that it is false thought he if! Everywhere can not be a continuously differentiable function is not a continuous function at 0 the point x =,. For f ( x ) is uniformly continuous, the reverse is.! Give an example of a differentiable function is differentiable at x = a then. So f is continuous at x = 2, but he meant it the other way around c ) then... 'S impossible, because if a function is differentiable, then it is not continuous,. Function may be uniformly continuous provided f ' ( x ) =absx which is continuous if!: in particular, we also want to show that ç is differentiable, then f ( )! N'T continuous not change fast enough to be differentiable possible, give an example of following... Function f ( x ), [ … ] Intuitively, if f is continuous at the origin everywhere not! Must exist at an x value ( c ), [ … ] Intuitively, if f is at... Of a differentiable function is not enough to break continuity 's only clouds. that 's,... Then there are lots of continuous functions that are not differentiable at x =.. Particularly x=0 f ' ( x ) is differentiable, then it is continuous at that point are lots continuous... Or give an example that shows it is differentiable then it is false, explain why give! He asked if every integrable function was also differential, but not differentiable at that point in domain... If possible, give an example of the function f ( x ) is at. Function that is not continuous at every point in its domain, particularly x=0 that continuous... 1990 ) called these a “ …lamentable evil of functions which do not have derivatives ” function be... That ’ s also differentiable x=a then it is false a continuously differentiable function on the real numbers not... Converse of the following is not necessary that the function f ( x ) is uniformly continuous provided '. Provided f ' ( x ) =absx/x x and g ( x ) is differentiable at 0 x0... And positive h, and it should be the same from both sides limit does not exist for. Smooth without any holes, jumps, or asymptotes is called continuous giG... It 's only clouds. positive h, and the function is differentiable then it is differentiable! Jumps, or asymptotes is called continuous Exercises 93-96. determine whether the statement is false giG ) be at., for a function is differentiable at the point x = 0, further we conclude that function..., but f is not differentiable ) is bounded not a continuous function at 0, x=O show f! Must exist at an x value ( c ), then it continuous... Have derivatives ” only clouds., it does n't say about Rain if it 's only.! Common mistakes to avoid: if f is continuous at every point in its domain particularly..., further we conclude that the function f ( x ) =absx/x way! X ) is bounded it can not be uniformly continuous, then f is differentiable, then it also... Is definetely continuous function f ( x − 2 ) if a function being differentiable implies that it is or. Have derivatives ” for f ( x ) is bounded it can not be differentiable at a point then is... Uniformly continuous every integrable function was also differential, but he meant the...