text:
# When can we recover a topology from its connected sets?

Definition. Let $X$ denote a set. Whenever $\tau$ is a topology on $X$, write $\tilde{\tau}$ for the collection of subsets of $X$ that are connected from the viewpoint of the space $(X,\tau)$.

In general, we cannot recover $\tau$ from $\tilde{\tau}$. For instance, let $\tau$ denote the usual topology on $\mathbb{Q}$, and $\sigma$ denote the discrete topology on $\mathbb{Q}$. Then $\tilde{\tau} = \tilde{\sigma}$, but $\tau \not = \sigma$.

I'm wondering whether we can use local connectedness to get rid of this problem.

Question. Let $X$ denote a set. Suppose $\tau$ and $\sigma$ are topologies on $X.$ Suppose $(X,\tau)$ and $(X,\sigma)$ are locally connected spaces. From $\tilde{\tau} = \tilde{\sigma}$, can we deduce $\tau = \sigma$?

If not, can we replace local connectedness with something else, so that from $\tilde{\tau} = \tilde{\sigma}$, we can deduce $\tau = \sigma$?

• At the very least, you should assume that both $\tau$ and $\sigma$ are Hausdorff, otherwise there are easy examples. – Moishe Kohan Apr 30 '16 at 13:47
• @studiosus Perhaps I'm a bit dense today but I don't see them. Which examples do you have in mind? – Marc Paul Apr 30 '16 at 14:28
• This already fails for $X=\{ a,b\}$: the topology $\{a\}, \emptyset, X$ makes all sets connected, as does the trivial topology $\emptyset, X$. – user138530 Apr 30 '16 at 19:42
• @MarcPaul: See my answer. – Moishe Kohan May 1 '16 at 4:36

$T_0$ and $T_1$ (see my comment below @studiosus's answer) examples have been given.

$T_2+regular$ example: Let $X=[0,1]\times[0,1)$. We define topologies $\sigma$ and $\tau$ on $X$ by specifying a basis for each. $\\$

$\sigma$: Neighborhood of a point with positive $y$-coordinate is a vertical open interval. Neighborhood of a point with $y$-coordinate $0$ is a Euclidean ball.

$\tau$: Neighborhood of a point with positive $y$-coordinate is same as in $\sigma$. Neighborhood of a point $(x,0)$ is a vertical open tube around the point, minus $\{x\}\times [r,1)$ for some $r>0$.

$(X,\sigma)$ and $(X,\tau)$ are easily seen to be Hausdorff (and more) and locally connected (all of the basic open sets are connected).

$\tau\neq \sigma$ obviously.

$\tilde \tau=\tilde \sigma$: $\tilde \sigma \subseteq \tilde \tau$ because $\tau\subseteq \sigma$. Now let $C\in \tilde \tau$. If $C$ is contained in a vertical line then $C\in \tilde \sigma$. Otherwise, $C$ must be closed downward, i.e., if $(x,y)\in C$ then $(x,z)\in C$ for all $z<y$, and also $C\cap [0,1]\times \{0\}$ must be connected. Again $C\in \tilde \sigma$.

Note: These spaces are neither second countable nor separable, but they are probably metrizable, or very close anyway.

Can we replace local connectedness with something else, so that from $\tilde{\tau} = \tilde{\sigma}$, we can deduce $\tau = \sigma$?

I suggest replacing locally connected with locally connected+metric+compact Hausdorff (if you have fewer open sets, then a connected basis means more).

• ..... Very nice! – Moishe Kohan May 2 '16 at 7:05
• @studiosus thank you! I started thinking about strange locally connected spaces, and the Alexandroff square came to mind. These examples are sort of based on that. – Forever Mozart May 2 '16 at 7:18
• @studiosus sorry I meant the "wheel without the hub". The Alexandroff square is not locally connected. – Forever Mozart May 2 '16 at 7:22

Here is the explanation of my earlier comment.

Given a topological space $(X,\tau)$ and a point $x'\notin X$, we define the set $X'=X\cup \{x'\}$ and the topology $\tau'$ on $X'$ as follows:

Elements of $\tau'$ are the empty set and all the subsets of the form $U\cup \{x'\}$, $U\in \tau$. It is then easy to see that $(X',\tau')$ is locally connected: If $V$ is any nonempty element of $\tau'$, it contains the point $x'$ and, hence, is connected.

Now, let us take your example: $X={\mathbb Q}$, $\tau_1$ is the discrete topology on $X$ and $\tau_2$ is the standard topology on $X$. As above, we define the topological spaces $(X', \tau_i'), i=1, 2$, $X'=X\cup \{x'\}$. Both are locally connected. The connected nonempty subsets of both $(X', \tau_1'), (X',\tau_2')$ are exactly the singletons in $X$ as well as all the subsets of the form $Z\cup \{x'\}$, $Z\subset X$ arbitrary.

Thus, you obtain two locally connected topologies on the same set which share the same collection of connected subsets.

I do not particularly like this example since it is not Hausdorff.

• Your topologies are $T_0$ only. But note that you can easily get them to be $T_1$ (and still locally connected) by adding $\omega$ with the cofinite topology instead of just one point $x'$. So your open sets would be of the form $U\cup (\omega\setminus F)$. Connected sets would be the same for both topologies generated like this. – Forever Mozart May 1 '16 at 4:46
• @ForeverMozart: Yes, very true, but I would prefer Hausdorff examples. – Moishe Kohan May 1 '16 at 4:49


text:
# Example: Properties on a grid¶

Download BeO_tape41.run

Saving the RUNKF file of a calculation gives rise to the opportunity to restart from it to calculate properties on a grid, like densities, potentials, or crystal orbitals. Find more details here.

Regarding the following example, in the first run we perform a single-point calculation for a bulk BeO system. After the calculation finished the RUNKF file shall be renamed to BeO.runkf. In the second run we restart from this file. We specify to use a regular grid and ask the program to calculate a bunch of properties on that grid.

First job:

$ADFBIN/band << eor Title BeO Comment in the "ideal" most symmetric configuration: u=3/8, and c=sqrt(8/3)*a End DefaultsConvention 2014 NumericalQuality Basic xc gga scf bp86 end Define uuu=3/8 aaa=5.10 ccc=sqrt(8/3)*aaa End Coordinates Fractional ATOMS Be 0 0 0 Be 1/3 1/3 1/2 O 0 0 uuu O 1/3 1/3 uuu+1/2 END Lattice aaa 0 0 0.5*aaa 0.5*sqrt(3)*aaa 0 0 0 ccc End BasisDefaults BasisType DZ Core large end end input eor mv RUNKF BeO.runkf  Second job: $ADFBIN/band << eor
DefaultsConvention 2014

Title BeO

Comment
in the "ideal" most symmetric configuration: u=3/8, and c=sqrt(8/3)*a
End

Restart
File BeO.runkf
DensityPlot
End

Grid
Type Coarse
End

DensityPlot
rho(deformation/fit)
rho(fit)
rho(atoms)
v(coulomb/atoms)
v(coulomb)
vxc[rho(fit)]
End

NumericalQuality Basic

xc
gga scf bp86
end

Define
uuu=3/8
aaa=5.10
ccc=sqrt(8/3)*aaa
End

Coordinates Fractional

ATOMS
Be  0 0 0
Be  1/3 1/3 1/2
O   0 0 uuu
O   1/3 1/3 uuu+1/2
END

Lattice
aaa 0 0
0.5*aaa 0.5*sqrt(3)*aaa 0
0 0 ccc
End

BasisDefaults
BasisType DZ
Core large
end

end input
eor

format: plain


text:
# Number base manipulation in Haskell

I am picking up good Haskell practices!

In this instance, I wanted to pick a file which contains a title in the first line and then every line is a string.

Each string represents a number in base equal to the number of distinct characters that appear on the string, but we do not know what characters correspond to each digit.

We want to find out the difference between the max and min number a string could represent, with the added restriction that a number cannot have leading 0s.

I feel like my code is quite complicated for such a simple task. Can I get any pointers on how to improve it so its more readable and elegant?

import qualified Data.Map as Map
import Data.List
import Data.Maybe

main = do
contents <- (tail . lines) <$> readFile "submitInput" :: IO [String] let input = contents :: [String] let result = max_range <$> input
let decorated_result = ["Case #" ++ show i ++ ": " ++ show s | (i,s) <- zip [1..] result]
writeFile "output.txt" $unlines$ decorated_result

-- Computes the difference between the max and min possible decoding
max_range word = max_decoding word - min_decoding word

-- Computes the minimal possible decoding of word
min_decoding :: String -> Integer
min_decoding word =
let number = fix_decoding $min_aux word (Map.empty :: Map.Map Char Integer) 0 in base_conversion (toInteger . length . nub$ number) $catMaybes number -- The decodification cannot have leading zeros fix_decoding :: [Maybe Integer] -> [Maybe Integer] fix_decoding [] = [] fix_decoding (Just 0:ds) = Just 1 : fix_decoding ds fix_decoding (Just 1:ds) = Just 0 : fix_decoding ds fix_decoding (d:ds) = d : fix_decoding ds min_aux :: [Char] -> Map.Map Char Integer -> Integer -> [Maybe Integer] min_aux [] _ _ = [] min_aux (c:cs) map next | c Map.member map = Map.lookup c map : min_aux cs map next | otherwise = Just next : min_aux cs (Map.insert c next map) (next + 1) -- Computes the maximal possible decoding of word max_decoding :: String -> Integer max_decoding word = let number = max_aux word (Map.empty :: Map.Map Char Integer) ((toInteger . length . nub$ word)-1)
in base_conversion (toInteger . length . nub $number)$ catMaybes number

max_aux :: [Char] -> Map.Map Char Integer -> Integer -> [Maybe Integer]
max_aux [] _ _ = []
max_aux (c:cs) map next
| c Map.member map    = Map.lookup c map : max_aux cs map next
| otherwise             = Just next : max_aux cs (Map.insert c next map) (next - 1)

-- Interprets a list of digits as a number in a given base
base_conversion :: Integer -> [Integer] -> Integer
base_conversion base []     = 0
base_conversion base (d:ds) = d * base ^ (length ds) + base_conversion base ds

# Type signatures and naming

While it's good practice to use type signatures on top-level bindings, it's usually not necessary in expressions unless type classes are involved. For example, the two following lines don't need type signatures:

contents <- (tail . lines) <$> readFile "submitInput" :: IO [String] let input = contents :: [String]  readFile always returns IO String, and tail . lines always changes a String into a [String]. Furthermore, input = contents is a nop, so it's not clear why it's there. Next, you usually use camelCase instead of snake_case in names in Haskell and hide the functionality in local bindings if you don't want to reuse functions, e.g. min_decoding :: String -> Integer min_decoding word = base_conversion (toInteger . length . nub$ number) $catMaybes number where number = fix_decoding$ min_aux word Map.empty 0
min_aux = ...

Feel free to use let … in … instead. By the way, max_range is missing a type signature.

# Recursion and Horner's method

Your base_conversion isn't really optimal. We can use Horner's method to get rid of length. For this we need a helper:

baseConversion :: Num a => a -> [a] -> a
baseConversion base = go 0
where
go acc []     = acc
go acc (d:ds) = go (acc * base + d) ds

You can verify that this yields the same result:

baseConversion 10 [1,2,3,4,5]
= go 0 [1,2,3,4,5]
= go (0  * 10 + 1) [2,3,4,5]
= go (1  * 10 + 2) [3,4,5]
= go (12 * 10 + 3) [4,5]
= go (123 * 10 + 4) [5]
= go (1234 * 10 + 5) = 12345

But there's already a function for this, foldl':

baseConversion :: Num a => a -> [a] -> a
baseConversion base = foldl' (\acc x -> acc * base + x) 0

Either way, we got rid of the ^ (length ds) part.

# Don't repeat yourself

Both min_decoding and max_decoding look very similar, and so do max_aux and min_aux.

We're repeating a lot of logic here. So instead, let us use a single function:

toDigit :: (Integer -> Integer) -> [Char] -> Map.Map Char Integer -> Integer -> [Maybe Integer]
toDigit _    []     _   _    = []
toDigit step (c:cs) m next =
| c Map.member m    = Map.lookup c m : toDigit cs m next
| otherwise           = Just next : toDigit cs (Map.insert c next m) (step next)

Now

min_aux = toDigit (+1)
max_aux = toDigit (subtract 1)

# Use appropriate types

But toDigit is still not optimal. We never return Nothing in our list. Therefore, there is no reason to use [Maybe Integer] as a result type:

toDigit :: (Integer -> Integer) -> [Char] -> Map.Map Char Integer -> Integer -> [Integer]
toDigit _    []     _   _    = []
toDigit step (c:cs) m next = case Map.lookup c m of
Just digit -> digit : toDigit step cs map next
Nothing    -> next  : toDigit step cs (Map.insert c next m) (step next)

While we're at it, you probably want to replace Integer with Int for the digits.


text:
# Welcome

## Five most recent articles:

### Home cider fermentation : posted in Miscellany

We recently moved into a house with apple trees in the garden so decided to have a go at making cider. The process is relatively simple and is described excellently by Andrew Lea at The Wittenham Hill Cider Pages. As such, these pages just give details on our particular product and includes some of our tips.

#### The Apples

The first step was the apples. I'm not sure of the variety but they look similar to a Worcester. The trees were planted around 50 years ago so are more likely to be a traditional English variety. We used a mixture of salvageable wind-falls and picked fruit and used a total of around 47kg of apples.

Some of our collected apples in a barrow

Read more... Published on 27th December 2013.

### No network on resume in OpenSuse : posted in Computing

I noticed that my network connection was not active after a resume from sleep mode in OpenSuse 12.2

The symptom was that when I resumed, the network connection would not be active and ifconfig showed only the lo connection, not eth0. I could manually solve this each time by running the following commands but this was a pain and hardly a seamless user experience.

$sudo dhclient eth0$ sudo mount -all


text:
# Ex.6.3 Q14 Triangles Solution - NCERT Maths Class 10

Go back to  'Ex.6.3'

## Question

Sides $$AB$$ and $$AC$$ and median $$AD$$ of a $$\triangle ABC$$ are respectively proportional to sides $$PQ$$ and $$PR$$ and median $$PM$$ of another $$\triangle PQR.$$

Show that $$\Delta ABC\text{ }\sim{\ }\text{ }\Delta PQR$$ .

Diagram

## Text Solution

Reasoning:

As we know if one angle of a triangle is equal to one angle of the other triangle and the sides including these angles are proportional, then the two triangles are similar.

This criterion is referred to as the $$\rm SAS$$ (Side–Angle–Side) similarity criterion for two triangles.

Steps:

Produce $$AD$$  to $$E$$ so that $$AD = DE$$ . Join $$CE$$ Similarly, produce $$PM$$ to $$N$$ such that $$PM = MN$$, and Join $$RN$$.

In $$\Delta ABD$$  and $$\Delta CDE$$

$$AD = DE$$ [ By Construction]
$$BD = DC$$ [AP is the median]

$$\angle ADB = \angle CDE$$ [Vertically opposite angles]
Therefore,
$$\Delta ABD \cong \Delta CDE$$ [By SAS criterion of congruence
$$\Rightarrow AB = CE$$ [ CPCT] ... (i)

Also, in $$\Delta PQM$$ and $$\Delta MNR$$

$$PM = MN$$ [By Construction]
$$QM = MR$$ [PM is the median]

$$\angle PMQ = \angle NMR$$ [Vertically opposite angles]
Therefore,
$$\Delta PQM = \Delta MNR$$ By SAS criterion of congruence
$$\Rightarrow PQ = RN$$ [CPCT] ... (ii)

Now,

$\begin{array}{l} \frac{{AB}}{{PQ}} = \frac{{AC}}{{PR}} = \frac{{AD}}{{PM}} & \left[ {{\rm{Given}}} \right]\\ \Rightarrow \frac{{CE}}{{RN}} = \frac{{AC}}{{PR}} = \frac{{AD}}{{PM}} & \begin{bmatrix} \text{from (i)} \\ \text{ and (ii)} \end{bmatrix} \\ \Rightarrow \frac{{CE}}{{RN}} = \frac{{AC}}{{PR}} = \frac{{2AD}}{{2PM}}\\ \Rightarrow \frac{{CE}}{{RN}} = \frac{{AC}}{{PR}} =\frac{{AE}}{{PN}} & \!\!\!\!\!\!\!\! \begin{bmatrix} 2AD = AE\\ {\text{ and }} \\ 2PM = PN \end{bmatrix} \\ \therefore \Delta ACE\sim\Delta PRN & \!\!\!\!\!\! \!\!\begin{bmatrix} \text{By SSS} \\ \text{ similarity} \\ \text{ criterion} \end{bmatrix} \end{array}$

Therefore,

\begin{align} \angle CAE &= \angle RPN\\{\rm{Similarly, }} \\ \angle BAE &= \angle QPN\\ \text{Therefore,} \\ \angle CAE + \angle BAE &= \begin{Bmatrix}\angle RPN \\+ \angle QPN \end{Bmatrix} \\ \Rightarrow \angle BAC &= \angle QPR\\ \Rightarrow \angle A &= \angle P....{\rm{(iii)}}\end{align}

\begin{align}&{\text{Now, In }}\Delta ABC{\text{ and }}\Delta PQR\\ &\frac{{AB}}{{PQ}} = \frac{{AC}}{{PR}}\\&\angle A = \angle P\qquad \left[ {{\rm{from (iii)}}} \right]\\&\therefore \Delta ABC\sim\Delta PQR \\ & \qquad \qquad \quad \begin{bmatrix} \text{By SAS} \\ \text{ similarity} \\ \text{ criterion} \end{bmatrix} \end{align}

Learn from the best math teachers and top your exams

• Live one on one classroom and doubt clearing
• Practice worksheets in and after class for conceptual clarity
• Personalized curriculum to keep up with school


text:
# Work done by gravitational force is negative

When we lift an object work done by gravitational force is negative $-mgh$ means gravitational force is taking energy from the body. How? Which energy is being reduced by the gravitational force?

This answer will be a little long but I think you’ll understand by the end of it.

Throw a ball up in the air. You have imparted initial Kinetic Energy (KE) right at the beginning. Observe the ball move up.

As the ball moves up, you see the velocity of the ball is reducing since the force of gravity is acting against it. In Physics, we say that this force of gravity is doing negative work on the ball.

The ball has now reached the top, its velocity is zero. Basically force of gravity has done enough negative work to reduce the velocity to zero and therefore its KE has also becomes zero. Let’s say this total work done by gravity in upward journey is W1 (it would be a negative sign e.g. -4J or -10J)

But what has happened to the initial KE. The KE of the ball keeps reducing as it moves up but another form of energy keeps increasing. This other form of energy is Potential Energy (PE). Thus the PE at start is zero and keeps increasing till all KE has converted to PE by the time it reaches the top of the flight. The gravitational force that did negative work on the ball and decreased its KE has in the process increased the PE of the ball. Thus negative work (W1) has resulted in positive change in PE. According to work KE theorem,

Delta KE = W1 ———- Eq. 1

but since Mechanical energy has to be conserved

Delta PE + Delta KE = 0 ———- Eq. 2

Use Eq. 1 to substitute Delta KE as W1 in equation 2, we get

Delta PE + W1 = 0

or

Delta PE = - W1

As an example, if work done is say -10 J and the change in PE is from say PE (initial) = 0 J to PE (final) = 10 J, then-

Delta PE = -W

or PE (final) - PE (initial) = -W

or 10 J - 0 J = - (-10 J)

10 J = 10J

• Please use Mathjax for mathematics. It's the site standard. – StephenG May 18 '18 at 17:26


text:
## Grazes Group Title Solve. one year ago one year ago

1. Grazes Group Title

$0 \le \theta <360$ $\sec \theta= \csc \theta$

2. some_someone Group Title

$0≤θ<360$ $\theta<360$ 360 integer solutions

3. Grazes Group Title

Not helping :/

4. AnElephant Group Title

45 degrees and 225 degrees sec theta = 1/costheta csc theta = 1/sintheta so 1/costheta = 1/sintheta on the interval 0=<theta<360 because 45 degrees gives sqrt2/2 for both sin and cos and 225 gives both -sqrt2/2 for sin and cos, these are the only two values that satisfy the equation


text:
# Finding roots of Equation involving trig. functions.

In a problem of classical mechanics, I encounter the following equation:

$$\mu \sin^4 \theta + \cos \theta = 0 \qquad \mu > 0 \qquad \frac{\pi}{2} < \theta < \pi,$$

where $\mu$ is some constant containing things like mass $m$ and angular momentum $L$. I would like to find the roots in $\theta$ for it being in the interval $\left(\frac{\pi}{2},\pi \right)$, which is a condition I know for sure to be true. Mathematica gives me an extremely blown up solution for this equation. Is there any (nice) way to find the roots of this equation by hand?

Let $x=-\cos(\theta)$ so that

$$\mu(1-x^2)^2-x=0$$

This polynomial indeed has a single root in the range $[0,1]$ for all positive $\mu$.

We can rewrite the above equation as

$$\mu=\frac x{(1-x^2)^2}.$$

For small $x$, $x\approx\mu$.

For $x$ close to $1$, let $1-\epsilon$, we have

$$\mu=\frac{1-\epsilon}{(1-(1-\epsilon)^2)^2}\approx\frac1{4\epsilon^2}.$$

This gives us the approximation

$$x=1-\frac1{2\sqrt\mu}.$$

You can refine the root numerically in the range

$$[\mu,1-\frac1{2\sqrt\mu}].$$

For a "manual" method, you can plot the relation $\mu=f(x)$ as accurately as possible. Then for a given value of $\mu$, find the corresponding $x$ on the plot and use it for a starting value of Newton's iterations.

Update:

The $\mu$ curve has a vertical asymptote at $x=1$, which makes it more difficult to handle. We can discard it by considering the function

$$\frac\mu{\mu+1}=\frac x{(1-x^2)^2\left(\frac x{(1-x^2)^2}+1\right)}=\frac x{(1-x^2)^2+x}.$$

It turns out that the function is fairly well approximated by $x$ in the range of interest, so that a good initial approximation is simply

$$x=\frac\mu{\mu+1} !$$

• For $\mu>1$ the given range for numerical refinement becomes useless, right? – Matt L. Dec 16 '15 at 21:53
• @MattL.You are right. – Yves Daoust Dec 16 '15 at 21:57

You can avoid ugly analytical formulas but you'll need to use a numerical method to solve for the roots of a polynomial.

$$\mu\sin^4\theta-\sqrt{1-\sin^2\theta}=0$$

(because $\pi/2<\theta<\pi$), from which you get

$$\mu^2\sin^8\theta+\sin^2\theta - 1=0$$

With $x=\sin\theta$ this is equivalent to

$$x^8+\frac{1}{\mu^2}x^2-\frac{1}{\mu^2}=0\tag{1}$$

Solve for the roots of $(1)$, choose the one which is real-valued and positive, and compute the desired angle as

$$\theta_0=\pi-\arcsin x_0$$

(again, because $\pi/2<\theta<\pi$).

• Shouldn't your first equation read $\mu\sin^4\theta+\sqrt{1-\sin^2\theta}=0$ instead of $\mu\sin^4\theta-\sqrt{1-\sin^2\theta}=0$ ? – K. Rmth Dec 16 '15 at 21:35
• @K.Rmth: No, because $\cos\theta <0$ for the given interval of $\theta$. – Matt L. Dec 16 '15 at 21:37
• Understood. :-) – K. Rmth Dec 16 '15 at 21:39


text:
At point A on the earth's surface, the angle of dip is, $\delta =+25°$. At a point B on the earth's surface, the angle of dip is, $\delta =-25°$. We can interpret that:

1. A and B are both located in the southern hemisphere.

2. A and B are both located in the northern hemisphere.

3. A is located in the southern hemisphere and B is located in the northern hemisphere.

4. A is located in the northern hemisphere and B is located in the southern hemisphere.

Subtopic:  Earth's Magnetism |
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
Launched MCQ Practice Books

Prefer Books for Question Practice? Get NEETprep's Unique MCQ Books with Online Audio/Video/Text Solutions via Telegram Bot

The relation amongst the three elements of Earth's magnetic field, namely horizontal component H, vertical component V and dip angle is: (${B}_{E}$=total magnetic field)

1. V=${B}_{E}$tan$\delta$, H=${B}_{E}$

2. V=${B}_{E}$sin$\delta$, H=${B}_{E}$cos$\delta$

3. V=${B}_{E}$cos$\delta$, H=${B}_{E}$sin $\delta$

4. V=${B}_{E}$, H=${B}_{E}$tan$\delta$

Subtopic:  Earth's Magnetism |
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
Launched MCQ Practice Books

Prefer Books for Question Practice? Get NEETprep's Unique MCQ Books with Online Audio/Video/Text Solutions via Telegram Bot

If  and ${\theta }_{2}$ are the apparent angles of dip observed in two vertical planes at right angles to each other, then the true angle of dip $\theta$ is given by:
1. ${\mathrm{tan}}^{2}\theta ={\mathrm{tan}}^{2}{\theta }_{1}+ta{n}^{2}{\theta }_{2}$
2. $co{t}^{2}\theta =co{t}^{2}{\theta }_{1}-co{t}^{2}{\theta }_{2}$
3. ${\mathrm{tan}}^{2}\theta ={\mathrm{tan}}^{2}{\theta }_{1}+ta{n}^{2}{\theta }_{2}$
4. $co{t}^{2}\theta =co{t}^{2}{\theta }_{1}+co{t}^{2}{\theta }_{2}$

Subtopic:  Earth's Magnetism |
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
Launched MCQ Practice Books

Prefer Books for Question Practice? Get NEETprep's Unique MCQ Books with Online Audio/Video/Text Solutions via Telegram Bot

A compass needle which is allowed to move in a horizontal plane is taken to a geomagnetic pole. It

1. will become rigid showing no movement

2. will stay in any position

3. will stay in north-south direction only

4. will stay in east-west direction only

Subtopic:  Earth's Magnetism |
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh
To view explanation, please take trial in the course below.
NEET 2023 - Target Batch - Aryan Raj Singh


text:
# Revenge of ex-Euclid

Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 32768/32768 K (Java/Others)

## Description

In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, which computes, besides the greatest common divisor of integers a and b, the coefficients of Bézout's identity, that is integers x and y such that ax + by = gcd(a, b).
---Wikipedia

Today, ex-Euclid takes revenge on you. You need to calculate how many distinct positive pairs of (x, y) such as ax + by = c for given a, b and c.

## Input

The first line contains a single integer T, indicating the number of test cases.

Each test case only contains three integers a, b and c.

[Technical Specification]
1. 1 <= T <= 100
2. 1 <= a, b, c <= 1 000 000

## Output

For each test case, output the number of valid pairs.

## Sample Input

2
1 2 3
1 1 4

## Sample Output

1
3

heyang

## Source

BestCoder Round #9


text:
# Getting started with STM32F469I discovery software ... Getting started with STM32F469I discovery software

• View
0

0

Embed Size (px)

### Text of Getting started with STM32F469I discovery software ... Getting started with STM32F469I discovery...

• October 2015 DocID028464 Rev 1 1/18 1

UM1962 User manual

Getting started with STM32F469I discovery software development tools

Introduction This document describes some software environment recommendations, required to build an application using the STM32F469I Discovery kit (32F469IDISCOVERY).

The document provides users with guidelines about how to build and run a simple example and how to create and build an application. It has the following structure: • The first chapter presents the software and hardware requirements (some toolchains

supporting the STM32 families, ST-LINK/V2-1 installation and firmware package presentation).

• The second chapter provides step by step guidelines on how to execute and debug an application example using the following toolchains: – IAR Embedded Workbench® for ARM® (EWARM) by IAR Systems® – Microcontroller development kit for ARM® (MDK-ARM) by Keil® – System Workbench for STM32 (SW4STM32) by AC6

Although this user manual does not cover all the topics relevant to software development environment, it demonstrates the first basic steps necessary to get started with the compilers/debuggers and it includes references for complementary information.

www.st.com

http://www.st.com

• Contents UM1962

2/18 DocID028464 Rev 1

Contents

1 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 IDEs supporting STM32 families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 ST-LINK/V2-1 installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Firmware package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5 Compiling, linking and executing firmware using software toolchains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.1 EWARM toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.2 MDK-ARM toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11

5.3 SW4STM32 toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

• DocID028464 Rev 1 3/18

UM1962 List of tables

3

List of tables

Table 1. Toolchains supporting STM32F469I Discovery kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Table 2. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

• List of figures UM1962

4/18 DocID028464 Rev 1

List of figures

Figure 1. Hardware environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Figure 2. Package contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Figure 3. IAR embedded workbench IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Figure 4. EWARM project successfully compiled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Figure 5. Download and debug button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Figure 6. IAR embedded workbench debugger screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Figure 7. IAR Go button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Figure 8. µVision5 IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Figure 9. MDK-ARM project successfully compiled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Figure 10. Start/Stop debug session button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Figure 11. MDK-ARM debugger screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Figure 12. Run button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Figure 13. SW4STM32 workspace launcher dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 14. SW4STM32 import source select dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 15. SW4STM32 import projects dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Figure 16. SW4STM32 project successfully compiled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Figure 17. SW4STM32 debug window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

• DocID028464 Rev 1 5/18

UM1962 System requirements

17

1 System requirements

Before running an application, the user should: 1. Install his preferred Integrated Development Environment (IDE). 2. Install the ST-LINK V2-1 driver from the www.st.com web page. 3. Download the STM32F469I Discovery firmware from the www.st.com web page. 4. Establish the USB connection with the STM32F469 Discovery board by connecting the

CN1 connector of the STM32F469 Discovery board to the USB port of the PC, using a type A to Mini-B USB cable (the Figure 1 shows the connector CN1 inside the red circle).

Figure 1. Hardware environment

The above steps will be detailed in the following sections.

• IDEs supporting STM32 families UM1962

6/18 DocID028464 Rev 1

2 IDEs supporting STM32 families

STM32 families of 32-bit ARM® Cortex® -M core-based microcontrollers are supported by a complete range of software tools. It encompasses traditional integrated development environments IDEs with C/C++ compilers and debuggers from major 3rd-parties (free versions up to 64 Kbytes of code, depending on 3rd-parties), completed with innovative tools from STMicroelectronics.

The following table regroups general information about the three integrated development environments, as well as the version supporting the STM32F469I product.

EWARM IAR Systems® IAR C/C++ 7.40.4 and later

http://www.iar.com 30-day evaluation edition KickStart edition (32-KByte code size limitation)

MDK-ARM Keil® ARMCC 5.xx and later with STM32F4xx_DFP2.6.0.pack http://www.keil.com MDK-Lite (32-KByte code size limitation)

SW4STM32 AC6 GNU C 1.4 and later http://www.openstm32.org Free version: no limitation

• DocID028464 Rev 1 7/18

17

The STM32F469I Discovery board includes an embedded ST-LINK/V2 debug tool interface. The interface needs an ST-LINK/V2 dedicated USB driver to be installed. This driver is available from the www.st.com web page and it is supported by the software toolchains: • IAR Embedded Workbench for ARM (EWARM).

The toolchain is installed by default in the C:\Program Files\IAR Systems\Embedded Workbench x.x directory on the hard disk of the local PC. After having installed EWARM, install the ST-LINK/V2 driver by running the ST-Link_V2_USB.exe from IAR_INSTALL_DIRECTORY]\Embedded Workbench x.x\arm\drivers\ST-LINK \ST-Link_V2_USBdriver.exe.

• Keil Microcontroller Development Kit (MDK-ARM) toolchain. The toolchain is installed by default in the C:\Keil directory on the hard disk of the local PC; the installer creates a ARM® Keil® µVision®4 shortcut in the start menu. When connecting the ST-LINK/V2 tool, the PC detects new hardware and prompts user to install the ST-Link_V2_USB driver. The “Found New Hardware” wizard displays and guides the user through the steps, required to install the driver from the recommended location.

• AC6 System Workbench for STM32 (SW4STM32). The toolchain is installed by default in the C:\Program Files\AC6 directory on the hard disk of the local PC. The ST-Link_V2_USB.exe is automatically executed, when installing the software toolchain.

For complementary information on the firmware package content and the STM32F469I Discovery requirements, refer to: STM32CubeF4 demonstration platform (UM1743 user manual).

Note: The embedded ST-LINK/V2-1 supports only the SWD interface for STM32 devices.

• Firmware package UM1962

8/18 DocID028464 Rev 1

4 Firmware package

The STM32F469I Discovery firmware applications, demonstration and examples are provided in one single.zip file. The extraction of the zip file generates a folder named “STM32Cube_FW_F4_VX.Y.Z”, which contains the subfolders shown in Figure 2.

Figure 2. Package contents

Subfolders description

Template: pre-configured project with empty main function to be customized. This is helpful to start creating your own application.

Peripheral examples: including set of examples for each STM32F469 peripheral ready to be run.

A

Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents


text:
RSA vs diffie-hellman + polyalphabetic cipher

My basic question is: How does RSA compare to using Diffie-Hellman + <some symmetric key crypto, e.g. a polyalphabetic cipher>

Let's assume that factoring large numbers and computing discrete logs both approximately equally difficult, so diffie hellman is about as secure as RSA. What are the pros and cons of using RSA vs diffie-hellman + symmetric key crypto?

For the latter, for example one might consider using diffie-hellman to agree on a large key (corresponding to say $$k$$ permutations of the characters in the alphabet, where encryption is done by applying the $$(i\text{ mod }k)$$th permutation to the $$i$$th character), and using that to send a message of length $$nk$$, where $$n$$ is some small number, so that frequency analysis is not effective ($$n = 1$$ would give you a "one-time-pad").

(This is a possibly naive question (My background is in algebraic geometry))

• polyalphabetic cipher? You are at least two centuries back. Jun 1 at 2:06
• @kelalaka I'm sure you're right! As I said this is a very naive question from someone whose background is not computer science! Jun 1 at 2:30

RSA allows for signatures. Signatures are a system whereby someone with a private key can "sign" a message, and anyone with the corresponding public key can verify that that private key was used to sign the message.

(Elliptic-Curve) Diffie-Hellman (aka ECDH or DH) allows for exchanging a shared secret value, which is then passed through a Key Derivation Function (KDF) to create a shared symmetric key for use with a symmetric cipher like AES-GCM or ChaCha20-Poly1305. Preferably an Authenticated Encryption with Associated Data (AEAD) cipher instead of just any old symmetric cipher, and certainly not a thoroughly broken classical cipher like a polyalphabetic substitution cipher.

It's possible but inadvisable to use RSA to encrypt short messages directly. The maximum message length is very short: for RSA-2048 with OAEP (a "padding" scheme required for security) at most 190 bytes can be safely encrypted. This process is FAR slower than using ECDH and an AEAD. Also, it's wildly unsafe to re-use RSA keys for more than one purpose. Doing so improperly can leak the message plaintext. So no major protocol uses this.

RSA key generation is MUCH slower than ECDH key generation. RSA key generation consists of randomly generating large numbers and testing if they're prime. ECDH key generation consists of generating a random point on some elliptic curve, which can be as simple as generating a single 32-byte random value and performing some fast bitwise operations.

That speed of (EC)DH key generation enables an important security property: forward secrecy. By generating a new key pair for every new "session" (exchange of messages) the compromise of a past session's keys doesn't compromise future keys. RSA key generation is too slow on many systems (especially embedded systems) for this to be practical.

There's also RSA-KEM, a mode whereby RSA is used to exchange a secret value which is then passed through a Key Derivation Function. This operates a bit like (EC)DH, but it's slower. There's not much reason to use this.

Lastly, there are some more obscure but potentially useful things like Cryptographic Accumulators which are easier to implement using RSA-like operations than (EC)DH-like operations.

• "Also, it's wildly unsafe to re-use RSA keys for more than one purpose. Doing so improperly can leak your private keys." - huh? How would that leak the private key? Even if you gave the adversary an RSA oracle (doing the private operation on attacker chosen values), that doesn't leak the private key value... Jun 1 at 12:58
• Thank you for your answer! I can definitely see that signatures and slow key generation are two interesting features of RSA. Again I apologize for my ignorance but why do you say the classical polyalphabetic substitution cipher is "thoroughly broken"? For example the one-time pad is an example of a polyalphabetic substitution cipher (this is "$n=1$" in my OP), which is unbreakable. Combined with Diffie-Hellman, you'd get something at least as secure as DH right? What are the weaknesses of DH + one-time-pad? How would this compare to DH + AES-GCM as you suggest? Jun 1 at 14:10
• Poncho: right. That was totally wrong. There are several ways to leak the private key by misusing RSA, that's not one of them. Jun 3 at 15:10
• One-Time Pads could be seen as a polyalphabetic substitution cipher if you squint, but they're very different in a key aspect: they have a key exactly as long as the message that's never re-used. Classical polyalphabetic substitution ciphers don't have those restrictions, and those restrictions are what makes the OTP secure. DH shares a small secret value, likely much smaller than the message, and that value isn't uniformly random. So it'd turn into a many-time pad, which is not even secure against known-plaintext attacks. (EC)DH + AES-GCM is IND-CCA3 secure, much stronger. Jun 3 at 15:16
• What's to stop you from using DH to exchange large keys? I.e. if you want to securely send an N-bit message, first use DH to agree on an N-bit key, and then use that key to encrypt the message. If you want to send another message, don't use the same key - agree on another one. This makes it so each message effectively becomes encrypted using a one-time-pad, right? Jun 8 at 22:20


text:
View Single Post
 P: 196 Energy due to a charge is infinite? Work is W=∫F.dx . So in it if i apply the limits some distance r to ∞, i would get, W = ∫(kQq/x2) dx = -kQq/x, x from r to ∞, = -kqQ(1/∞-1/r) = -kQq/r.. this is definitely not ∞. But I was thinking that the test charge is moving continuously (with non uniform, decreasing acceleration) almost for infinite time. In that case the sum of all the small patches under the curve should have given infinite energy(I was considering kinetic energy, on v-t graph)....but that doesn't seem to be happening...


text:
# How do you simplify 8(-2i)(-5-4i)?

Dec 3, 2016

$- 64 + 80 i$

#### Explanation:

Multiply 8 and 2i together and distribute the bracket with this product.

$\Rightarrow 8 \left(- 2 i\right) \left(- 5 - 4 i\right)$

$= - 16 i \left(- 5 - 4 i\right) = 80 i + 64 {i}^{2}$

$\textcolor{\mathmr{and} a n \ge}{\text{Reminder}} \rightarrow {i}^{2} = - 1$

$\Rightarrow 80 i + 64 {i}^{2} = - 64 + 80 i$


text:
rtags {utils} R Documentation

## An Etags-like Tagging Utility for R

### Description

rtags provides etags-like indexing capabilities for R code, using R's own parser.

### Details

Many text editors allow definitions of functions and other language objects to be quickly and easily located in source files through a tagging utility. This functionality requires the relevant source files to be preprocessed, producing an index (or tag) file containing the names and their corresponding locations. There are multiple tag file formats, the most popular being the vi-style ctags format and the and emacs-style etags format. Tag files in these formats are usually generated by the ctags and etags utilities respectively. Unfortunately, these programs do not recognize R code syntax. They do allow tagging of arbitrary language files through regular expressions, but this too is insufficient.

The rtags function is intended to be a tagging utility for R code. It parses R code files (using R's parser) and produces tags in both etags and ctags formats. The support for vi-style ctags is rudimentary, and was adapted from a patch by Neal Fultz; see PR#17214.

It may be more convenient to use the command-line wrapper script R CMD rtags.

Deepayan Sarkar

### References

list.files, cat

### Examples

## Not run:
rtags("/path/to/src/repository",


text:
# Question

A hospital administrator worries about the possible loss of electric power as a result of a power blackout. The hospital, of course, has a standby generator, but it too is subject to failure, having a mean time between failures of 500 hours.
It is reasonable to assume that the time between failures is exponentially distributed.
a. What is the probability that the standby generator fails during the next 24-hour blackout?
b. Suppose the hospital owns two standby generators that work independently of one another. What is the probability that both generators fail during the next 24-hour blackout?

Sales0
Views73


text:
# Learning Integration with unit step function like u(x - a)

1. Sep 11, 2005

### hanhao

hello maths experts
is the following true?
http://img9.imageshack.us/img9/4596/int15oe.jpg [Broken]

graphically, this is how i view it
http://img9.imageshack.us/img9/179/int28ut.jpg [Broken]

Last edited by a moderator: May 2, 2017
2. Sep 11, 2005

### LeonhardEuler

Yes, that's pretty much correct, but the right hand side is missing a "+C" because it is an indefinite integral.

3. Sep 11, 2005

### hanhao

http://img108.imageshack.us/img108/1626/38jk1.jpg [Broken]
is u(x-a) redundant? can i remove it like this?

Last edited by a moderator: May 2, 2017
4. Sep 11, 2005

### LeonhardEuler

No, the integral is constant for x<a. The u(x-a) keeps the part of the integral that is dependant on x zero for x<a, so it is just the constant of integration before that. The integral should be u(x-a)[F(x)-F(a)]+C.

Last edited by a moderator: May 2, 2017
5. Sep 11, 2005

### hanhao

i want to understand this graphically
how would the graph of u(x-a)[F(x)-F(a)] look like compared to [F(x)-F(a)] ??
am i correct to say that my bottom graph is [F(x)-F(a)] ??

6. Sep 11, 2005

### LeonhardEuler

I am assuming you mean the bottom graph in this image, so tell me if I am wrong:
http://img9.imageshack.us/img9/179/int28ut.jpg [Broken]
This is not the graph of [F(x)-F(a)]. The function itself is f(x)u(x-a). The area represents the integral of this, which is u(x)[F(b)-F(a)], where b is the upper limit.

[F(x)-F(a)] represents an antiderivative of f(x) without the step function. Suppose b and c are both less than a. Obviously the integral,I, of f(x)u(x-a) from b to c is zero, but look what happens when you plug this in to the function you proposed:
I=[F(c)-F(a)]-[F(b)-F(a)]=F(c)-F(b)
which is not necessarily zero.

Last edited by a moderator: May 2, 2017
7. Jun 6, 2010

### nightworrier

We have limits between infinite to minus infinite how can i compute when i multiply a function with an unit step function. i mean i have an integral the limits of that integral is infinite to minus infinite and inside the integral i have f(t).u(t-a) this. So how can i compute this integral ?