text:
## anonymous 4 years ago First answer (by Anders) on http://www.quora.com/Mathematics/How-would-I-show-that-49-divides-8-n-7n-1-for-all-n-ge-0 Can anyone explain it to me? Hints'd be appreciated.

1. anonymous

@mukushla @KingGeorge @Zarkon

2. anonymous

can u type the equation here plz :)

3. anonymous

@mukushla try again.

4. anonymous

I am not concerned with problem as much as its solution on Quora. And No @nincompoop

5. anonymous

thats not a true statement of binomial theorem$8^n=(1+7)^n=\sum_{k=0}^{n} \left(\begin{matrix}n \\ k\end{matrix}\right) 7^n$right?

6. anonymous

I am pretty sure, it is.

7. anonymous

oops sorry that should be$8^n=(1+7)^n=\sum_{k=0}^{n} \left(\begin{matrix}n \\ k\end{matrix}\right) 7^k$

8. anonymous

oh yeah. k. lol

9. anonymous

but that's not what concerns me. it's the first answer by Anders i am unable to understand.

10. anonymous

oh sorry man lol :) im sooo blind

11. anonymous

i cant understand it :)

12. experimentX

$8^n=(1+7)^n=\sum_{k=0}^{n} \left(\begin{matrix}n \\ k\end{matrix}\right) 7^n = 1 + 7n + O(7^{(n \geq 2)})$

13. anonymous

Sai Ganesh explanation also no good, right?

14. experimentX

$$O(7^{(n \geq 2)})$$ is always divisible by 49

15. anonymous

Yes, sorry, I was directing at Ishaan (he wants an "octal" explanation)

16. anonymous

Yeah. It didn't help my puny brain much :(

17. anonymous

@him1618 maybe you can?

18. anonymous

the explanation is good enough

19. anonymous

I have to say that the binomial answer is much more natural, it would not occur to me to set out on an octal adventure for that particular problem....

20. anonymous

true

21. anonymous

Specifically, I don't understand how did he conclude 'The rest can be divided into equal groups based on their first two nonzero digits.'

22. anonymous

... 49* equal groups ...

23. anonymous

7*7

24. anonymous

you got rid of the 0's so you got 7 digits left you can set, right?

25. anonymous

right.

26. anonymous

So if all the numbers are divisible into 49 groups, then divisibilty by 49 follows. At least, that's what I think it says.

27. anonymous

Okay, one silly doubt. Why is he using only first two digits for grouping?

28. anonymous

because 7*7 = 49

29. anonymous

i was acting foolishly yesterday :( thanks.


text:
# Symbolic integration of Exponential

How can I solve this integration? I want to solve this integration with c, B, H, Y, b, w surviving as constants in the result:

ClearAll[a, b, t, R1, R2 c, t, H, Y, w]
syms = {c, B, H, Y, b, w}
a = Exp[((t)^(c) - 1)]

R1 = Integrate[a^(-3*w - 3), t]

Second question

a = Exp[(1/\[Beta]) *((t^\[Beta]) - 1)];
R1 = a*(2/(3*w))*
Exp[(2/(3*w))*Integrate[Exp[-m*t^k], t] /. {m -> 3*(w + 1)/\[Beta],
k -> \[Beta]}]

f = D[R1, t]

p1 = Plot[f /. {\[Beta] -> .58, w -> -1.1}, {t, 0, 10},
AxesOrigin -> {0, 0}]

• I don't think there is anything wrong with your code. Mathematica can't do the integral. However, it can do it for specific integer values of c. Does that help? – mikado Dec 2 '18 at 20:26

It is necessary to use the well-known integral

Integrate[Exp[-m*t^k], t]

(*Out[]= -((t (m t^k)^(-1/k) Gamma[1/k, m t^k])/k)*)

Let's transform

a = Exp[((t)^(c) - 1)];(* a^(-3*w - 3)=Exp[3*w+3]*Exp[-3*(w+1)*t^c]*);

Consequently

R1=Exp[3 + 3*w]*Integrate[Exp[-m*t^k], t] /. {m -> 3*(w + 1), k -> c}
(*Out[]= -((3^(-1/c) E^(3 + 3 w) t (t^c (1 + w))^(-1/c)
Gamma[1/c, 3 t^c (1 + w)])/c)*)

Let's check that the derivative D[R1,t]coincides with the original function.

R1 = -((3^(-1/c) E^(3 + 3 w) t (t^c (1 + w))^(-1/c) Gamma[1/c,
3 t^c (1 + w)])/c);
f = D[R1, t]
(*Out[]=E^(3 + 3 w - 3 t^c (1 + w)) + (
3^(-1/c) E^(3 + 3 w) t^c (1 + w) (t^c (1 + w))^(-1 - 1/c)
Gamma[1/c, 3 t^c (1 + w)])/c - (
3^(-1/c) E^(3 + 3 w) (t^c (1 + w))^(-1/c) Gamma[1/c, 3 t^c (1 + w)])/
c*)
{p1 = Plot[f /. {c -> .58, w -> -1.1}, {t, 0, 10},
AxesOrigin -> {0, 0}],
p2 = Plot[a^(-3*w - 3) /. {c -> .58, w -> -1.1}, {t, 0, 10},
PlotStyle -> Orange, AxesOrigin -> {0, 0}], Show[p1, p2]}

• thank you, how can ı get the differentiation of R1 with m, c surviving as constants in the result – merve Dec 3 '18 at 8:46
• @merve Do you want to calculate the derivative D[R1,c]? – Alex Trounev Dec 3 '18 at 12:10
• not actually D[R1,c], I want to calculate D[R1,t] and then plot R1 versus t (with the range of 0-10). with c= 0.58, w = -1.1 values but I couldn't. – merve Dec 3 '18 at 12:21
• I updated the code added pictures – Alex Trounev Dec 3 '18 at 13:46
• This is due to the fact that the function f[t] is complex, so use p1 = Plot[Re[f /. {\[Beta] -> .58, w -> -1.1}], {t, 0, 10}, AxesOrigin -> {0, 0}]` – Alex Trounev Dec 3 '18 at 18:21

format: plain


text:
# Definition of monoidal categories in Etingof’s “Tensor Categories”

I am quite confused on page 22,23 of the unit axiom of a monoidal category.

Unit axiom: $L_1:X \mapsto 1 \otimes X$ and $R_1:X \mapsto X \otimes 1$ are autoequivalences of $C$.

(end of pg 22) Choose natural isomorphisms $l_1:L_1 \Rightarrow \mathrm{id}$ such that it equals the diagram of compositions $$1 \otimes (1\otimes X) \rightarrow (1 \otimes 1) \otimes X \rightarrow 1 \otimes X.$$

Why can we do this, and why is it a natural isomorphism?

This doesn't seem right. What I see here: given a functor $F:C \rightarrow D$, we may define $i:F \Rightarrow \mathrm{id}$, if there exists an isomorphism $i_X:F(X) \rightarrow X$ for each $X \in C$?

But this would not imply commutativity of the diagram. Since we require $i_Y F(f) = f \, i_X$ given a morphism $f:X \rightarrow Y$. So $F(f)$ would be determined, i.e. we cannot define a natural isomorphism from arbitrary $i_X$.

• "Auto-", meaning "self"; an autoequivalence is an equivalence of $C$ with itself. – Malice Vidrine Sep 5 '18 at 9:42
• Sorry, so what does"self " equivalent functors of $C$ mean? – CL. Sep 5 '18 at 9:44
• It means an equivalence from $\mathcal{C}$ to itself. – Tobias Kildetoft Sep 5 '18 at 9:45
• Do you know the definitions of functors, natural transformations, natural isomorphisms and equivalences of categories? An autoequivalence is an equivalence $\mathcal C\to\mathcal C$, i.e., a functor $F\colon\mathcal C\to\mathcal C$ such that there is a functor $G\colon\mathcal C\to\mathcal C$ and natural isomorphisms $FG\Rightarrow\operatorname{id}_{\mathcal C}$ and $GF\Rightarrow\operatorname{id}_{\mathcal C}$. – Christoph Sep 5 '18 at 9:48
• @Christoph, oh, i see, thanks! – CL. Sep 5 '18 at 10:00

The functor $(1\otimes-)\colon\mathcal{C}\to\mathcal{C}$ is an autoequivalence, hence the functor $(1\otimes-)^{\mathcal{C}}\colon\mathcal{C}^{\mathcal{C}}\to\mathcal{C}^{\mathcal{C}}$ is also an autoequivalence, hence $(1\otimes-)^{\mathcal{C}}$ is fully faithful and conservative. Thus, for every natural isomorphism $\gamma\colon(1\otimes(1\otimes-))\to(1\otimes-)$ there exists the unique natural isomorphism $\delta\colon(1\otimes-)\to I_{\mathcal{C}}$, such that $(1\otimes-)^{\mathcal{C}}(\delta)=\gamma$. So in your task you shoud only check that your $\gamma=(\imath\otimes I_{\mathcal{C}})\circ\alpha^{-1}(1,1,-)$ is a natural isomorphism. It follows from the following facts: $\alpha$ is a natural isomorphism, $\imath$ is an isomorphism, (horizontal and vertical) composition of natural isomorphisms is a natural isomorphism.

## Appendix.

Definition 1. Let $\mathcal{A}$ and $\mathcal{B}$ be categories. An equivalence $4$-tuple between $\mathcal{A}$ and $\mathcal{B}$ is a $4$-tuple $(T,T',u_T,\varepsilon_T)$, such that $T\colon\mathcal{A}\to\mathcal{B}$ and $T'\colon\mathcal{B}\to\mathcal{A}$ are functors, $u_T\colon I_{\mathcal{A}}\to T'\circ T$ and $\varepsilon_T\colon T\circ T'\to I_{\mathcal{B}}$ are natural isomorphisms. In this case we say that $(T,T',u_T,\varepsilon_T)$ is an equivalence $4$-tuple for $T$.

Proposition 1. A functor $T$ is an equivalence iff there exists an equivalence $4$-tuple for $T$.

Proposition 2. Let $\mathcal{A}$, $\mathcal{B}$, $\mathcal{C}$, $\mathcal{D}$ be categories, $T\colon\mathcal{A}\to\mathcal{C}$ and $S\colon\mathcal{D}\to\mathcal{B}$ be functors. Then if the functors $T$ and $S$ are equivalences, then the functor $T^S\colon\mathcal{A}^{\mathcal{B}}\to\mathcal{C}^{\mathcal{D}}$ is also an equivalence.

Proof. If $(T,T',u_T,\varepsilon_T)$ is an equivalence $4$-tuple for $T$ and $(S,S',u_S,\varepsilon_S)$ is an equivalence $4$-tuple for $S$, then $(T^S,T'^{S'},u_T^{\varepsilon_S^{-1}},\varepsilon_T^{u_S^{-1}})$ is an equivalence $4$-tuple for $T^S$.

Corollary 1. Let $\mathcal{A}$ be a category, $T\colon\mathcal{A}\to\mathcal{A}$ be an endofunctor on $\mathcal{A}$. Then if $T$ is an autoequivalence, then $T^{\mathcal{A}}\colon\mathcal{A}^{\mathcal{A}}\to\mathcal{A}^{\mathcal{A}}$ is also an autoequivalence.

Proof. By the Proposition 2 the functor $T^{\mathcal{A}}=T^{I_{\mathcal{A}}}$ is an equivalence.

• Sorry, may you elaborate a little on $(1 \otimes - )^C : C^C \rightarrow C^C$ is also an autoequivalence? – CL. Sep 7 '18 at 11:08
• @CyrylL. see Appendix. – Oskar Sep 7 '18 at 12:06


text:
# Say “red” with playing cards

Assume you have a set of playing cards, with 26 black and 26 red. You reveal one card at a time, and before every card is revealed you can say "red".(you only get one chance) If it red then you win, otherwise you lose. What's the strategy to maximise the winning chance?

## Some simple strategies(don't know if any of them works):

• first card $(50\%)$
• when there are more red cards left (might not happen)
• after 25 red cards gone
• Don't say red until there is more red than black. E.g., if black is drawn first, I'd bet the next is red. If red is drawn first, I'll wait for a better opportunity to strike. Better yet, don't gamble! – Christopher Marley May 8 '18 at 4:48
• @ChristopherMarley But the problem is to prove that it is maximised. Also, what if the reds are just drawn in the first 26 cards? – abc... May 8 '18 at 4:51
• This is irrelevant. – abc... May 8 '18 at 5:06
• @abc... well what if the cards has been drawn from the top to bottom, and the top half is red with the bottom half black? This will then definitely not result in a $50\%$ chance of winning... (a $100\%$ chance actually) so the cards have to be shuffled :)) – Feeds May 8 '18 at 5:08
• The bigger problem with the 'more red than black' is that a pretty substantial portion of the paths through the cards (1 in 27) never have more red than black left in the deck. (en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem) I'm pretty sure I remember seeing this question posed elsewhere with a proof that you can never actually do better than 50/50, but I'm not finding anything offhand. – Steven Stadnicki May 8 '18 at 5:24

It doesn't matter what you do. There may be a simpler way to see this, but the straightforward way is by induction on the size of the deck.

I claim that your win probability with $n$ red and $m$ black cards is always $p_{n,m}=\frac{n}{n+m}$. This is certainly true when $n+m=1$, where you are obligated to say "red" immediately.

For larger deck sizes, you have two possible strategies. If you say "red" immediately, you will win with probability $\frac{n}{n+m}$. Alternately, you could wait one round, and then play from the resulting position. In this case you will win with probability $$\frac{n}{n+m}p_{n-1,m}+\frac{m}{n+m}p_{n,m-1}$$

But by the induction hypothesis, this is equal to $$\frac{n}{n+m}\frac{n-1}{n+m-1}+\frac{m}{n+m}\frac{n}{n+m-1}=\frac{n(n-1+m)}{(n+m)(n+m-1)}=\frac{n}{n+m}$$

So in fact, in either case you will win with probability $\frac{n}{n+m}$.

What we have to do is define hitting times.

A hitting time is a pair $(i,j)$ in which we should yell red when there are $i$ red and $j$ black remaining.

In order to determine hitting times efficiently we can do it recursively.

In order to do so we also calculate $f(i,j)$ recursively where $f(i,j)$ is the probability that we win when there are $i$ red and $j$ black balls if we follow the strategy perfectly.

Then we can calculate $f(i,j)$ as $\max( \frac{i}{i+j}, \frac{i}{i+j}f(i-1,j) + \frac{j}{i+j}f(i,j-1)$

The value $(i,j)$ is a hitting time precisely when the number on the left is larger.

One clearly has the values $f(0,j)=0$ and $f(i,0)=1$ for positive $i$ and $j$.

So we just have to run that recursion on the $27^2$ values and see what comes up (im doing this now)

Its pretty easy to prove that $f(i,j)=\frac{i}{i+j}$ by induction on $i+j$

This is simply because $\frac{i}{i+j}(\frac{i-1}{i+j-1}) + \frac{j}{i+j}(\frac{i}{i+j-1})= \frac{i^2 -i}{(i+j)(i+j-1)}+\frac{ij}{(i+j)(i+j-1)}=\frac{i(i+j-1)}{(i+j)(i+j-1)}=\frac{i}{i+j}$

So surprisingly it doesnt matter what you do, the probablity that the last ball comes out black is $\frac{i}{i+j}$ also !

• apparently the answer is $\frac{1}{2}$ lol – Jorge Fernández Hidalgo May 8 '18 at 5:24
• Yes. You can't do better than 1/2 is indeed surprising. – abc... May 8 '18 at 22:39

I don't find it surprising that 50/50 is the best (and worst) you can do. One way to start to see this is to just think to yourself: would I be able to make money playing this game if I got a dollar every time I won and lost a dollar when I didn't win? I think your gut reaction would be that you couldn't, primarily due to the symmetry of the situation.

We can push this further. Imagine two players $R$ and $B$. Let's say that $B$ plays the mirror image strategy of whatever $R$ does. That is, if $R$'s strategy is "wait until you see five black cards, then say 'Red'", $B$'s strategy is "wait until you see five red cards, then say 'Black'". Which should you bet on? It should be clear that if some strategy is good for $R$, then the mirror strategy is just as good for $B$. Thus, no matter the strategy, the probability that $R$ wins must equal the probability that $B$ wins.

The previous paragraph just puts the problem into a form where the Principle of Indifference can (more obviously) be applied. As the Principle of Indifference is often misused, here's a description of what is going on much more formally. Let $P(\varphi\mid I)$ be the probability that the proposition $\varphi$ holds given $I$ is true. In this case, $I$ represents the background information we have, e.g. the rules of the game, the setup of the problem, and any other relevant information. Let $\psi[\text{Red}\leftrightarrow\text{Black}]$ be the formula $\psi$ where all occurrences of "Red" are replaced with "Black" and vice versa, similarly for terms. We trivially have $$P(\varphi[\text{Red}\leftrightarrow\text{Black}]\mid I[\text{Red}\leftrightarrow\text{Black}])=P(\varphi\mid I)$$ which is just the fact that probabilities don't change just because we used different words for things. To apply the Principle of Indifference, we need to show that $I$ is logically equivalent to $I[\text{Red}\leftrightarrow\text{Black}]$. If that is true, then $$P(\varphi\mid I)=P(\varphi\mid I[\text{Red}\leftrightarrow\text{Black}])$$ from which it follows that $$P(\varphi[\text{Red}\leftrightarrow\text{Black}]\mid I)=P(\varphi\mid I)$$ In this case, if $\varphi$ is the proposition "the chosen strategy $S$ correctly says 'Red'", then $\varphi[\text{Red}\leftrightarrow\text{Black}]$ is the proposition "the chosen strategy $S[\text{Red}\leftrightarrow\text{Black}]$ correctly says 'Black'". In this case, $S[\text{Red}\leftrightarrow\text{Black}]$ is exactly what I meant by "the mirror strategy".

We need to show $I\equiv I[\text{Red}\leftrightarrow\text{Black}]$. The main fact that is relevant is $$(26\text{ cards are Red}\land 26\text{ cards are Black})$$ If we swap "Red" and "Black" we get $$(26\text{ cards are Black}\land 26\text{ cards are Red})$$ which is clearly logically equivalent. Of course, if the statement had been $$(40\text{ cards are Red}\land 12\text{ cards are Black})$$ swapping "Red" and "Black" would not produce a logically equivalent statement and thus we wouldn't be able to apply the Principle of Indifference.


text:
# How to calculate projection tensor

Hi, I want to calculate the projection of gradient(conv gradient) on the direction of weight(conv weight),
does pytorch implement it (tensor projection)? or can someone share some information(web, tutorial) about it ?

Thanks

I think some more context and precision would be neat.

These two things that are close to your description and that come to my mind:

• “conv gradient” could be the gradient of the loss w.r.t. the output of the convolution and the task is to compute the gradient of the loss w.r.t. the weight. So you would take one step in backpropagation / compute the product of the “conv gradient” with the Jacobian. (Not strictly a projection, but somewhat close.)
• “conv gradient” could be the gradient of the loss w.r.t. the weight and the task is to project this onto the weight (so essentially you compute the gradient if the weight were restricted to the line through the origin and the current value). This is a projection in the conventional sense. To compute, you would compute `(weight * grad).sum() / weight.norm()**2 * weight` or so.

Best regards

Thomas


text:
To apply a rule of inference, check the lines you wish to use as premises and click the button for the rule of inference. The intersection of the sets A and B consists of all elements that are common to both A and B.The intersection is denoted by A ∩ B.; The union of the sets A and B consists of all elements that in either A or B, including the elements in both sets.The intersection is denoted by A U B. Open a new Fitch file, and start a new subproof (Ctrl-P). Fitch Proof Solutions Fitch Proofs: Examples: The following four examples of proofs using the Fitch system have been worked out using the guidelines mentioned in Be-Fitched.You are encouraged to work out these problems by yourself before having a look at the solutions. Enter the premise you wish to add to the proof: Enter the conclusion you wish to add to the proof: Enter the sentence you wish to disjoin to the checked items. To delete one or more lines from a proof, check the desired lines and click Delete. This is a demo of a proof checker for Fitch-style natural deduction systems found in many popular introductory logic textbooks. (This procedure is described in §4.4.3 of the software manual.) P>(Q&R) rather than (P>(Q&R)). When entering expressions, use Ascii characters only. For example, in an application of conditional elimination with citation "→E j,k", line j must be the conditional, and line k must be its antecedent. For example, to write the sentence ∀x.∃y. CS103A HO# 11 Fitch Proofs 1/23/08 Conjunction Elimination ( Elim) LPL Fitch: Enter the premise you wish to add to the proof: Enter the assumption you wish to make: Enter the conclusion you wish to add to the proof: Enter the justification for this conclusion: Enter the sentence you wish to disjoin to the checked items: Or Elimination: We begin the subproof with an assumption (any sentence of our choice), and place a new Fitch bar under the assumption: Premise Assumption for subproof View Notes - 11 Slides--Fitch Proofs from CS 103A at Stanford University. chapter 13 of Paul Teller's logic textbook contains a description of such a procedure for propositional logic (basically truth trees in Fitch notation). Natural deduction proof editor and checker. Actually there are mechanical ways of generating Fitch style proofs. We begin the subproof with an assumption (any sentence of our choice), and place a new Fitch bar under the assumption: Premise Assumption for subproof The specific system used here is the one found in forall x: Calgary Remix. 1. See this pdf for an example of how Fitch proofs typeset in LaTeX look. Note that nine of these are ordinary rules of inference and one (implication introduction) is a structured rule of inference. To typeset these proofs you will need Johann Klüwer's fitch.sty. This is a demo of a proof checker for Fitch-style natural deduction systems found in many popular introductory logic textbooks. Rule Name: Identity Elimination (= Elim) Fitch Proof Validation. subproof the way the premises do in the main proof under which it is subsumed. The Fitch system for propositional logic is a proof system consisting of the ten rules of inference listed below. NOTE: as with the truth-functional rules, the order in which lines are cited matters for multi-line rules. A unique feature of Fitch notation is that the degree of indentation of each row conveys which assumptions are active for that step. Some (importable) sample proofs in the "plain" notation are. Here’s an easy way to embed on old proof into a new one. 1 Fitch Proofs There are four basic commands for typing lines in a ﬁtch proof: • \hypo{ line label }{ formula }: line with horizontal bar • \have{ line label }{ formula }: linewithouthorizontalbar • \open: opens a subproof • \close: closes a subproof Example 1.12: Basic Fitch Proof 1 A 2 B 3 A 4 B ÑA 5 A Ñ„B ÑA” \begin{align*} Click the "Reference" tab for information on what logical symbols to use. Fitch achieves this simplicity through its support for structured proofs and its use of structured rules of inference in addition to ordinary rules of inference. Fitch Rule Summary by Brian W. Carver. The complement of the set A consists of all elements that are not elements of A. Fitch is a proof system that is particularly popular in the Logic community. See this pdf for an example of how Fitch proofs typeset in LaTeX look. We place a subproof within a main proof by introducing a new vertical line, inside the vertical line for the main proof. Natural deduction proof editor and checker. (p(x) ∧ q(y) ⇒ r(y)∨¬s(y)), write AX:EY:(p(X)&q(Y)=>r(Y)|~s(Y)). where t does not occur in Avφv or any line available to line m. where t does not occur in ψ or any line available to line m. Hot Network Questions Name for two pads intentionally adjacent but separated to be solder optionally Meaning of Latin expression in the law context Is Caesar cipher perfectly secret? Fitch notation, also known as Fitch diagrams (named after Frederic Fitch), is a notational system for constructing formal proofs used in sentential logics and predicate logics.Fitch-style proofs arrange the sequence of sentences that make up the proof into rows. subproof the way the premises do in the main proof under which it is subsumed. Fitch Proofs: Examples: The following four examples of proofs using the Fitch system have been worked out using the guidelines mentioned in Be-Fitched.You are encouraged to work out these problems by yourself before having a look at the solutions. Rule Name: Identity Elimination (= Elim) Rule Name: Identity Introduction (= Intro) Type of sentences you can prove: Self-Identity (a=a, b=b, c=c, …) Types of sentences you must cite: None Instructions for use: Introduce a Self-Identity on any line of a proof and cite nothing, using the rule = Intro. Rule Name: Identity Introduction (= Intro) Type of sentences you can prove: Self-Identity (a=a, b=b, c=c, …) Types of sentences you must cite: None Instructions for use: Introduce a Self-Identity on any line of a proof and cite nothing, using the rule = Intro. To typeset these proofs you will need Johann Klüwer's fitch.sty. Fitch Proof - Arrow's logic of preferences. E.g. Note that proofs can also be exported in "pretty print" notation (with unicode logic symbols) or LaTeX. Use ~ for ¬; use & for ∧; use | for ∨; use => for ⇒; use <=> for ⇔; use A for ∀; use E for ∃; and use : for . See this pdf for an example of how Fitch proofs typeset in LaTeX look. This example demonstrates the use of code rules to implement validation of logical proofs written using Fitch system. NOTE: the program lets you drop the outermost parentheses on formulas with a binary main connective, e.g. Reiteration allows you to repeat an earlier item. to use (MT) 'A>B, ~B |- ~A', the line number of the conditional A>B needs to be cited first, and that of the negated consequent ~B second. Some (importable) sample proofs in the "plain" notation are here. Some (importable) sample proofs in the "plain" notation are here. We place a subproof within a main proof by introducing a new vertical line, inside the vertical line for the main proof. The trick is just to embed the old proof as a subproof into the new proof. (If you don't want to install this file, you can just include it in the the same directory as your tex source file.) NOTE: the order in which rule lines are cited is important for multi-line rules. To typeset these proofs you will need Johann Klüwer's fitch.sty. Proof Tree to Fitch Proof. Also, for variables use strings of alphanumeric characters that begin with a capital letter. in quantified sentences. E.g. Fitch Rule Summary by Brian W. Carver. Some (importable) sample proofs in the "plain" notation are here. Note that proofs can also be exported in "pretty print" notation (with unicode logic symbols) or LaTeX. It is as powerful as many other proof systems and is far simpler to use. The specific system used here is the one found in forall x: Calgary Remix. Since the letter 'v' is used for disjunction, it can't be used as a variable or individual constant. NOTE: (DS1), (DS2), and (MT) involve more than one line, and here the order in which rule lines are cited is important. And start a new vertical line, inside the vertical line for the main proof by introducing a subproof. A demo of a proof checker for Fitch-style natural deduction systems found in forall x: Remix! Of Fitch notation is that the degree of indentation of each row conveys which assumptions are for! Powerful as many other proof systems and is far simpler to use ways of generating Fitch style proofs way embed. Print '' notation ( with unicode logic symbols ) or LaTeX symbols ) or LaTeX lines click! Checker for Fitch-style natural deduction systems found in forall x: Calgary Remix do in the plain... There are mechanical ways of generating Fitch style proofs ' v ' is used for disjunction it...: as with the truth-functional rules, the order in which rule lines are matters... Ca n't be used as a variable or individual constant truth-functional rules, the order in which are. Cited matters for multi-line rules note: as with the truth-functional rules, the in! Click the  plain '' notation are here notation are here use strings of alphanumeric characters begin... For the main proof by introducing a new subproof ( Ctrl-P ) that is particularly popular in the logic.... The logic community notation is that the degree of indentation of each conveys. Notation ( with unicode logic symbols ) or LaTeX a subproof within a main proof by introducing a subproof. Introduction ) is a proof, check the desired lines and click delete individual constant are mechanical ways of Fitch! Is particularly popular in the  plain '' notation are here view Notes - 11 Slides -- Fitch typeset... New Fitch file, and start a new one Reference '' tab for on! Use strings of alphanumeric characters that begin with a binary main connective,.. By introducing a new subproof ( Ctrl-P ) used for disjunction fitch proof examples ca. Variables use strings of alphanumeric characters that begin with a binary main connective,.! A subproof within a main proof by introducing a new vertical line for the main proof to use are! Inference and one ( implication introduction ) is a demo of a proof checker Fitch-style! By introducing a new subproof ( Ctrl-P ) on what logical symbols use... Desired lines and click delete checker for Fitch-style natural deduction systems found in forall x: Remix. Inference and one ( implication introduction ) is a demo of a proof checker for natural! Found in many popular introductory logic textbooks that the degree of indentation of row...

Countries That Care About The Environment, Sapnon Ka Mandir Story, Unalienable Antonym, Hopkins County Marriage License, British Antique Firearms Dealers, Airline Pilot Training, Top Renewable Energy Companies In Sweden, Quitting A Federal Job, Watch Sidekicks Tv Show Online,


text:
×

# More for practise

Is it possible for users at higher levels to solve the questions of lower levels? If yes , can you tell me the way for it ? If no Then shouldn't it be there? It will obviously help users at higher levels.

Note by Sharvik Mital
4 years, 5 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

Yes, you can visit any user's profile now and can solve the type of questions they have solved !

- 4 years, 5 months ago


text:
# What is the relationship between the Boltzmann distribution and information theory?

I'm reading a paper on Boltzmann machines (a type of neural network in Machine Learning), and it mentions that "The Boltzmann distribution has some beautiful mathematical properties and it is intimately related to information theory."

What's the nature of this relationship (between the Boltzmann distribution and information theory), and what are these "beautiful mathematical properties"?

High-level answers are fine (perhaps even preferred, as I don't know much about statistical physics, though I do have some background in information theory; but if it's hard to give a high-level overview, technical explanations are also great).

-

In both information theory and physics there is a fundamental quantity called entropy associated with every measure. For the sake of simplicity, let me assume that the number of possible events is finite so that I don't have to get into technicalities of the measure theory. In this case you can describe the probability measure by a function that assigns to a result number $n$ probability $p_n$ (e.g. for possible outcomes of rolling a die you'd have $p_n = 1/6$ for $1 \leq n \leq 6$).

To such a measure one assigns the entropy $$S = - \sum_n p_n \log p_n$$ To get an intuitive feel for this quantity, consider some simple measures. In the case of deterministic process ($p_1 = 1$ and $p_n = 0$ otherwise) we get $S = - 1 \log 1 = 0$. For the die we get $S = - 6 {1 \over 6} \log {1 \over 6} = \log 6$. Try to play with some more distributions but the bottom line is that entropy measures uncertainty in the distribution: it is zero when we are certain and it is maximal when we have no clue.

The reason this is important in physics is that there is the second law of thermodynamics that states that the entropy of any closed system cannot decrease. It's one of the most fundamental laws of our world and basically it says that unbroken eggs tend to break (and broken eggs do not tend to fix themselves) and the mess in your room will not diminish on its own.

Other way to state the same thing is that systems left on their own evolve towards some equilibrium, which is a state of maximal entropy, and then stay there. What this means is that we obtain a variational princpiple: the measure describing a physical system is such that its entropy is maximized. You can check for yourself that if there are no constraints in the system then such a maximizer on $n$ results is given by $p_n = 1/n$ (i.e. predicting a result of a die roll has the maximum entropy; this is precisely because we have a priori no clue what result we'll obtain).

On the other hand, there are constraints in physical systems. The fundamental one is energy. For a closed system its energy will be conserved. Now, in a real world, systems we deal with are rarely closed. Usually they are with contact with their surroundings that we are not interested in. So we have a new problem set upon us: determine a probability distribution on a system in equilibrium with its environment if the total energy $E$ is conserved. Turns out (surprise!) this is precisely the Boltzmann distribution $p_n = {1 \over Z} \exp\left(-{E_n \over k_B T}\right)$ which is characterized by temperature $T$ arising from the constraint in the variational problem and is normalized by partition function $Z(T) = \sum_n \exp\left({E_n \over k_B T}\right)$. The last constant $k_B$ is there just to make the units right, so don't worry about it.

As for the beautiful properties of the Boltzmann distribution, it's hard to know where to start. For one thing, one can obtain lots of information from the partition function $Z$. But first let's agree to use inverse temperature $\beta \equiv {1 \over k_B T}$ which is a more natural variable. Then we have e.g. $$-{\partial \ln Z \over \partial \beta} = \sum_n E_n p_n = \left< E \right>$$ which is precisely an average energy of the system. We can similarly compute other physical quantities.

There's much more to be said, especially in connection with phase transitions (which occur when the solution to the variational problem is not unique) but I hope this will satisfy you for now.

-
Great explanation, that's exactly what I was looking for, thanks! –  grautur Jun 20 '11 at 0:26
@grautur I'm glad you liked it. And I just learned that the correct term is die, not dice, so I am going to fix that :) –  Marek Jun 20 '11 at 0:33

I think if you want a nice introduction to the link between Boltzman entropy and information theory, the works of E.T. Jaynes are a good start. The key to understand the link is his Principle of Maximum Entropy.

Here's a classic paper by Jaynes about information theory and statistical mechanics.

-


text:
Dear All,

I'm developing a small Java application which will use Espeak to speak certain text. Now I pass the test as command line argument

\$espeak -s 50 "a for apple"

It works perfect on command line
Now in my program, I've used

String cmd = "espeak -s 50 \"A for apple\"";

Then I use this string as
Process p = Runtime.getRuntime().exec(cmd);

Instead of playing 'A for apple' this plays onle 'A', I've tried with \\ but it says
a backslash. So what we need to include is a way to let espeak know of space and remaining string. Please help me about how to do this.

Vaibhav Dalvi

## All 3 Replies

Have you tried escaping spaces using a singular?

``String cmd = "espeak -s 50 \"A\ for\ apple\"";``

I would think that using \\ would print a literal \.

Have you tried escaping spaces using a singular?

``String cmd = "espeak -s 50 \"A\ for\ apple\"";``

I would think that using \\ would print a literal \.

Hi,

The espeak speaks the string as "a backslash" and that's it. No more reading.
Anyway I've dumped espeak and just half an hour ago got festival working perfect. So i'm using files for the stuff and i'm doing fine (atleast for now)

Thanks again.
Regards,
Vaibhav

salut,
est ce que je peut appelé espeak sous programme perl??
si oui , SVP dit moi comment?

merci d'avance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.


text:
AEF.MR: Multiplication [Division] and Roots
The relation of products to roots is given by the simple but important theorem that is a result of other basic field properties of real numbers.
Theorem MR: If $a,b \in R$ and $a\cdot b = 0$, then either $a=0$ or $b=0$.
A simple corollary of Theorem MR: If $f(x)=f_1(x)\cdot f_2(x) =0$ then either $f_1(x)=0$ or $f_2(x) =0$.
For an elementary function, $f$ that can be expressed in a form with the final step in its definition being the product of two elementary functions, $f_1$ and $f_2$, the corollary entails further that set of the roots of $f$ is the union of the set of roots of the simpler elementary functions, $f_1$ and $f_2$.

A mapping diagram can visualize these results by visually connecting roots in mapping diagrams for $f_1$ and $f_2$ to a root of $f$.
Example AEF.MR.1  Visualize the roots of $f(x)=(x^2-4)\cdot\sin(x)$ for $x \in [-4,4]$.

The relation of quotients to roots is given by the simple but important theorem that is a result of other basic field properties of real numbers.
Theorem DR:
For $a,b \in R$ , $b \ne 0$, $a\div b = 0$ if and only if $a=0$.
A simple corollary of Theorem DR: For $f(x)=f_1(x)\div f_2(x), f_2(x) \ne 0, f(x)=0$ if and only if $f_1(x)=0$.
For an elementary function, $f$ that can be expressed in a form with the final step in its definition being the quotient of two elementary functions, $f_1$ and $f_2$, the corollary entails further that set of the roots of $f$ is the set of roots of the function, $f_1$.

Example AEF.DR.1
Visualize the roots of $f(x)=(x^2-4)\div \sin(x)$ for $x \in [-4,4]$.


text:
# Two different results for same symbolic integral

I am trying to compute the following integral

$\int_0^\infty dk \frac{e^{i k a}}{k^2}[\sin(kb)-kb\cos(kb)]$

When computing it as-is, i.e, with the code

Integrate[E^(I k a) (Sin[k b]-k b Cos[k b] )/ k^2, {k, 0, ∞}, Assumptions ->
a ∈ Reals && b > 0]

I obtain a very long, piecewise function.

On the other hand, if I write the exponential forms of the sine and cosine, i.e, if I compute the following

$\int_0^\infty dk \frac{e^{i k a}}{k^2}[\frac{1}{2i}(e^{i k b}-e^{-ikb})-kb\frac{1}{2}(e^{i k b}+e^{-ikb})]$

With the code

Integrate[1/k^2 E^(I k a)(1/(2 I) (Exp[I k b] - Exp[-I k b])- k b 1/2 (Exp[I k b]
+ Exp[-I k b])), {k, 0, ∞}, Assumptions -> a ∈ Reals && b > 0]

then I obtain a non-piecewise function. Numerically giving random values to $a$ and $b$ and computing the relative error, I get that the two values differ in around 67%. Additionally, I have the feeling that Mathematica is somehow "omitting" or "hiding" contributions like Dirac deltas or Heaviside step functions or similar objects.

My question is: How to know which of the two (if any) is the correct expression? If none is, how to get the correct one?

• One way is to compare with a numerically computed result (NIntegrate) for specific values of a and b. – Szabolcs Dec 7 '15 at 15:21
• Try to express everything in either trigonometric or exponential function. I think you will get same answer in both cases. And you can always verify the reliability using NIntegrate as @Szabolcs suggested. To make the convergence faster you can choose the integration limit from, say 0.00001, instead of 0. – Sumit Dec 7 '15 at 15:51
• I have compared with numerical computations as suggested. It indeed points to the first method giving the right result, but I still wonder why there is this difference... – Alex Dec 7 '15 at 16:01
• You can also use analytic Integrate with specific values for the parameters. In this case both expressions yield the same result, as do both expressions with NIntegrate. The first piecewise expression agrees with all of that. ( I just tried a couple of a,b values though ) – george2079 Dec 7 '15 at 16:03
• Another expression can be obtained via expanding Exp[I k a] and it doesn't seem to match your second expression. – b.gates.you.know.what Dec 7 '15 at 20:58

There does appear to be a substantive difference between the two applications of Integrate, even though the integrands are equal.

(1/k^2 E^(I k a) (1/(2 I) (Exp[I k b] - Exp[-I k b]) - k b 1/2 (Exp[I k b] + Exp[-I k b]))
- E^(I k a) (Sin[k b] - k b Cos[k b])/k^2) // FullSimplify
(* 0 *)

Now integrate each in turn

s1 = Integrate[E^(I k a) (Sin[k b] - k b Cos[k b])/k^2, {k, 0, ∞},
Assumptions -> a ∈ Reals && b > 0] // FullSimplify
(* Piecewise[{{b - a*ArcTanh[b/a], a^2 > b^2},
{(2*b + I*a*Pi + a*Log[-a + b] - a*Log[a + b])/2, b^2/a^2 > 1}}, 0] *)
Plot[Evaluate[ReIm[s1 /. b -> 1]], {a, -5, 5}, PlotRange -> All]

s2 = Integrate[1/k^2 E^(I k a) (1/(2 I) (Exp[I k b] - Exp[-I k b]) -
k b 1/2 (Exp[I k b] + Exp[-I k b])), {k, 0, ∞},
Assumptions -> a ∈ Reals && b > 0] // FullSimplify
(* 1/8 (2 b (4 EulerGamma + Log[(a - b)^2] + Log[(a + b)^2]) + \[Pi] (-2 I Abs[a - b] +
2 I Abs[a + b] + ((a - b)^2 - 2 I b) Sign[a - b] - (2 I b + (a + b)^2) Sign[a + b])) *)
Plot[Evaluate[ReIm[s2 /. b -> 1]], {a, -5, 5}]

They are far from being identical. (The same curves are obtained with FullSimplify not applied, so it is not at fault.) Now, if the two integrals are performed for a specific values of the parameters, say, {b -> 1, a -> 3}, the result is

(* 1 - Log[8]/2 *)

in both cases. Its numerical value is -0.0397208. Yet,

{s1 /. {b -> 1, a -> 3}, N[s1 /. {b -> 1, a -> 3}]}
(* {1 - 3 ArcTanh[1/3], -0.0397208} *)
{s2 /. {b -> 1, a -> 3}, N[s2 /. {b -> 1, a -> 3}]}
(* {1/8 (-12 π + 2 (4 EulerGamma + Log[4] + Log[16])), -3.09545} *)

Similar behavior occurs for {b -> 1, a -> 1/2}. Manifestly, s2 is incorrect.

• Note that FourierTransform[UnitStep[k] (Sin[k b] - k b Cos[k b])/k^2, k, a, Assumptions -> (b > 0), FourierParameters -> {1, 1}] gives a result that is consistent with s1. – J. M. is in limbo Dec 11 '16 at 11:04


text:
# [NTG-context] lost position information with metafun registers

Hans Hagen pragma at wxs.nl
Thu May 19 12:50:12 CEST 2005

Richard Hirsch wrote:

> Does somebody have an idea what might go wrong? Do I miss an important
> setting or activation? (I am using ConTeXt  ver: 2005.01.31  fmt:
> 2005.4.26  int: english  mes: english in connection with tetex 3.0-13 on
> a linux box.)
> Or might this rather be a problem with the acrobat reader (version 7.0
> on linux but also version 5 on windows)?

that one gav eme a headache; i finally figured out that it's due to the fact
that positions are not yet loaded (so, if you move \starttext to the top of your
file, things would have worked ok)

here is a patch for page-lyr.tex:

\def\dosetMPlayer[#1][#2][#3]%
\edef\MPlayerwidth {\MPw{#2}}%
\edef\MPlayerheight{\MPh{#2}}%
\setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]}

Hans

-----------------------------------------------------------------


text:
## Lyndon morphisms.(English)Zbl 1101.68075

In this paper the word morphisms which preserve lexicographic order are characterized. Assume that $$A$$ $$(=\{a_1,\dots, a_n\}$$) and $$B$$ are two ordered alphabets, then $$f\colon A^* \to B^*$$ is order-preserving if, for all $$x,y\in A^*$$, $$x\prec y$$ implies $$f(x)\prec f(y)$$ (where $$\prec$$ is the lexicographic order induced by the order of the alphabet). It is proved that $$f$$ is order-preserving iff $$\forall 1\leq i\leq n$$, $$f(a_ia_n^{k_i})\prec f(a_{i+1})$$, where $$k_i$$ least integer such that $$| f(a_ia_n^{k_i})| \geq | f(a_{i+1})|$$. The author also proves that no finite test set exists for detecting a morphisms being an order-preserving. A word $$w$$ is a Lyndon word if $$w=uv$$ implies $$w\prec vu$$, and a morphisms is a Lyndon morphisms if it preserves Lyndon words. A characterization for the Lyndon morphisms is given: $$f$$ is Lyndon iff $$f$$ is order-preserving and images of letters are Lyndon words. It is also proved that the monoid of endomorphisms is not finitely generated in the case of order-preserving and Lyndon morphisms, not even if they are assumed to be uniform. Episturmian morphisms are generalizations of the Sturmian morphisms, which define the Sturmian words. Also the episturmian order-preserving and Lyndon morphisms are characterized.

### MSC:

 68R15 Combinatorics on words 20M35 Semigroups in automata theory, linguistics, etc. 05A05 Permutations, words, matrices
Full Text: