text:
Generate Lucky Numbers

Story:

Lucy asked George what his Lucky Number was. After some contemplation, George replied that he had several Lucky Numbers. After some brief confusion, Lucy asked George what his first n Lucky Numbers are. George then asked you, his buddy, to write him a program to do the work for him.

The Challenge:

You will write a program/function that will receive from standard input/function argument a string or integer n. The program/function will then return/output the first n Lucky Numbers. Lucky numbers are defined via a sieve as follows.

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ...

Now remove every second number:

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, ...

The second remaining number is 3, so remove every third number:

1, 3, 7, 9, 13, 15, 19, 21, 25, ...

Now the next remaining number is 7, so remove every seventh number:

1, 3, 7, 9, 13, 15, 21, 25, ...

Next, remove every ninth number and so on. The resulting sequence are the lucky numbers.

Winning:

As usual for codegolf, fewest bytes wins.

As usual, submissions using standard loopholes are disqualified.

• I'd suggest including the definition in the post as well as the first ten or so numbers.
– xnor
Feb 17, 2015 at 4:14
• A cool extension would be that for each item examined (3, 7, etc.) will do that operation that number of times. For example for 3, remove the third element in the list 3 times, the 7th element 7 times, etc. (note this is not the sequence but the idea is the same)
– Ryan
Feb 17, 2015 at 15:51
• @Ryan I think that sequence would be remarkably similar to the natural numbers :) Feb 18, 2015 at 2:40
• @TheBestOne You think so? I posted earlier to math.stackexchange: math.stackexchange.com/questions/1153889/…
– Ryan
Feb 18, 2015 at 2:41
• @Ryan Actually, I misinterpreted your suggestion. As you stated it in your question on math.se, I think that would be interesting. Feb 18, 2015 at 2:47

Python 2, 79

n=input()
L=range(1,2**n)
for r in L:r+=r<2;map(L.remove,L[r-1::r])
print L[:n]

The magic of iterating over a list as the loop modifies it!

The list L starts with all the integers 1 to a sufficiently high value. The code iterates over each element r of L, taking the sublist of every r'th element, and removing each of those values. As a result, the removed values aren't iterated over. At the end, print the first n elements.

The expression map(A.remove,B) is a trick I've been waiting a long time to use. It calls A.remove for each element of B, which causes all the elements of B to removed from A. Effectively, it takes the list difference, though it requires B to be a sublist of A. It requires Python 2, since Python 3 wouldn't actually evaluate the map.

The first loop needs to be special-cased to convert r from 1 to 2, as r+=r<2.

The sufficiently high upper bound of 2**n makes the program very slow for large values of n. Using n*n+1 suffices, but costs a character. Note that n*n doesn't work for n=1.

• You just need n**2 numbers, not 2**n Feb 17, 2015 at 6:32
• That's one amazing use of map you have there. I was wondering whether there was a better way... Feb 17, 2015 at 6:33
• @Optimizer Unfortunately, n**2+1, unless the case n=1 can be forgiven.
– xnor
Feb 17, 2015 at 6:34
• That use of map is brilliant. Like using an ordered set. Perhaps also can be used like map(A.index,B) to find the indexes of the elements of B in A, map(A.count,B) to find the number of the elements of B in A, map(A.extend,B) to add a flattened B list to A. The mind boggles. Feb 17, 2015 at 6:43

s(n:k)p=n:s[m|(i,m)<-zip[p..]k,imodn>0](p+1)
f n=take n$1:s[3,5..]3  Defines a function f. The expression 1:s[3,5..]3 evaluates to the infinite list of lucky numbers, and f simply takes the first n of them by take n. f 20 [1,3,7,9,13,15,21,25,31,33,37,43,49,51,63,67,69,73,75,79]  I could shave off 5 bytes from the sieve using a parallel list comprehension s(n:k)p=n:s[m|m<-k|i<-[p..],imodn>0](p+1)  but that would require passing the humongous compiler flag -XParallelListComp to GHC to enable the extension. Explanation of the sieve s(n:k)p= -- Sieving a list with head n and tail k with accumulator p is n: -- the head n, followed by s[m| -- the result of sieving the list of numbers m (i,m)<-zip[p..]k, -- where (i,m) is drawn from [(p,k_0),(p+1,k_1),(p+2,k_2),..] and imodn>0] -- i does not divide n, (p+1) -- using p+1 as the accumulator  The basic idea is that s(n:k)p produces the (p-1)th lucky number n, drops every nth number from the infinite tail k (offset by p to account for the numbers produced earlier), and recurses to that list with accumulator (p+1). In f, we initialize the process with the odd numbers starting from 3, and tack 1 to the front, obtaining exactly the lucky numbers. • Sorry, but is the input n$1? Cuz running running say f n=take 10:s[3,5..]3 doesnt work :/ Nov 11, 2022 at 11:46
• @DialFrost The code snippet defines a function f that you can call like f 10. Try it online! Nov 12, 2022 at 7:19
• Ya lol, but I wanted it to be shorter? So theres no other way? Nov 12, 2022 at 10:12

Python 2, 71 69 67

At first, I thought this would be a great challenge for Python's array slicing. However, I encountered a stumbling block when I discovered that slices with a step other than 1 can only have another slice of identical length assigned to them. But after googling "python remove slice", my faith was restored: I found a funky del statement that does the trick perfectly.

n=input()
l=range(n*n+9)
for v in l:del l[v&~1::v or 2]
print l[:n]

Old version

n=input()
l=range(1,n*n+9)
for v in l:del l[v-1%v::v+1/v]
print l[:n]

-2 bytes thanks to Sp3000.

CJam - 25

Lri{1$W%{1$\(1e>/+}/)+}/p

Try it online

Explanation:

This implementation doesn't remove numbers successively from an array, but calculates each number based on how many would have been removed before it.
For each index i (from 0 to n-1) and each previous lucky number l, in reverse order, we increment i by i/(l-1), except for l=1 we use 1 instead of 0, and also add 1 at the end.
E.g. for i=4 we have the first 4 numbers, [1 3 7 9], and calculate:
4 + 4/(9-1) = 4
4 + 4/(7-1) = 4
4 + 4/(3-1) = 6
6 + 6/1 = 12
12 + 1 = 13

L              empty array - the first 0 lucky numbers :)
ri             read and convert to integer (n)
{…}/           for each number (i) from 0 to n-1
1$copy the previous array W% reverse the order {…}/ for each array element (l) 1$     copy i
\(     swap with l and decrement l
1e>    use 1 if l=1
/+     divide and add to i
)+         increment and add the new lucky number to the array
p              pretty print

><>, 121114 111 bytes

i2+:&:*1\
:})?v:2+>l{
nao2\r~1
)?vv>1+:&:&=?;:[{::nao}]$}l1-[01+}:l3-$%$l1-@@-{$[{~l1
3.\ ff+
!?:<]-1v
~]{43. >

I have only a few words to say...

... "Argh my brain hurts."

Explanation

><> is a 2D esoteric programming language and is definitely not suited for this task, due to its lack of arrays. In fact, the only data type in ><> is strange mix of int/float/char, and everything happens on a stack of stacks.

Here's the rundown:

Line 1:            i2+:&:*1\

i2+:&              Read a char as input (n) and add 2, copying n+2 into the register
:*                 Duplicate and multiply, giving (n+2)^2 on the stack
1\                 Push 1 and go to the next line

Line 2:            >l{:})?v:2+

l{:})?v            Go to the next line if the stack's length is greater than (n+2)^2
:2+                Otherwise duplicate the top of the stack and add 2 to it

Line 3:            \r~1nao2

r~                 Reverse the stack and pop; stack contains the first (n+2)^2 odd integers
1nao               Print 1 (special case)
2\                 Push 2 (let's call this "i" for "iterations") and go to the next line

Line 4:            >1+:&:&=?;:[{::nao}]$}l1-[01+}:l3-$%$l1-@@-{$[{~l1)?vv

1+                 Increment i
:&:&=?;            If i is equal to n+2 (+2 because we started at 2), halt
:[{::nao}]$} Print the i-th element down (the next lucky number) and also copy it to the top of the stack, while moving i to the bottom l1-[ Move everything but i to a new stack 0 Push 0 (let's call this "r" for recursion depth) Sieve loop: 1+ Increment r }:l3-$%$l1-@@-{$[  Move everything up to the last element to be sieved out to a new stack
{~                 Remove said last element
1)?vv              If the length is 1, go to line 6 (sieving complete)
Otherwise go to line 5, which repeats this sieve loop by teleporting

Line 6:            :?!v1-]

:?!v1-]            Keep unrolling and decrementing r until r is 0

Line 7:            >~]{43.

~]                 Pop r and unroll once more (to the stack where i waits)
43.                Loop, performing everything from line 4 all over again

Here's a mock example which demonstrates roughly how the sieving works (here k is the lucky number which we sieve with):

[[15 13 11 9 7 5 3 1 k=3 r=0]]     -- move -->
[[15 13] [11 9 7 5 3 1 k=3 r=1]]   -- pop  -->
[[15 13] [9 7 5 3 1 k=3 r=1]]      -- move -->
[[15 13] [9 7] [5 3 1 k=3 r=2]]    -- pop  -->
[[15 13] [9 7] [3 1 k=3 r=2]]      -- move -->
[[15 13] [9 7] [3 1] [k=3 r=3]]    -- pop  -->
[[15 13] [9 7] [3 1] [r=3]]        (now we unroll)

• Still better than Java ;) Feb 17, 2015 at 14:01
• I like the fact that nao can apparently be interpreted as "print this thing now". Feb 17, 2015 at 14:24

Pyth: 23 22 bytes

<u-G%@GhH+0GQ%2r1^hQ2Q

Try it online: Pyth Compiler/Executor

Explanation:

<u-G%@GhH+0GQ%2r1^hQ2Q    Q = input()
%2r1^hQ2     create the list [1, 2, ..., (Q+1)^2-1][::2]
u          Q%2r1^hQ2     G = [1, 2, ..., (Q+1)^2-1][::2]
modify G for each H in [0, 1, 2, ..., Q]:
-G%:GhH+0G                  G = G - ([0] + G)[::G[H+1]]
(minus is remove in Pyth)
<                    Q    print the first Q elements of the resulting list

The reduce actually calculates more than Q lucky numbers (the remove command is called Q+1 times, Q-1 should be enough).

R, 58 bytes

n=scan();s=r=1:n^2;for(j in 1:n)r=r[-max(2,r[j])*s];r[1:n]

With line breaks:

n=scan()              #user input
s=r=1:n^2             #declare r and s simultaneously, both large enough to sieve
for(j in 1:n)
r=r[-max(2,r[j])*s] #iteratively remove elements by position in vector
r[1:n]                #print

Previous version, 62 bytes

function(n){
s=r=1:n^2             #declare r and s simultaneously, both large enough to sieve
for(j in 1:n)
r=r[-max(2,r[j])*s] #iteratively remove elements by position in vector
r[1:n]                #print
}

Previous version, 78 bytes

n=as.numeric(readline())   #ask for user input and convert it to numeric
r=1:n^2                    #create a large enough vector to sieve
for(j in 1:n){             #loop
r=r[-max(2,r[j])*1:n^2]  #iteratively remove elements by position in vector
}
r[1:n]                     #print

• 64 bytes: Change n=as.numeric(readline()) to function(n){...}. This creates a function object that can be assigned and called. Drop the curly braces in the for loop. Feb 17, 2015 at 18:10
• Thanks @Alex! Though that's 66, since it needs a name? Feb 17, 2015 at 20:13
• It doesn't need a name for the submission. See the Matlab/Octave solutions. R function objects are akin to unnamed/lambda functions in other languages, which are valid submissions. Feb 17, 2015 at 22:41
• What about n=scan(n=1)? Feb 18, 2015 at 12:53
• That works! And it's 1 character less. It's even shorter if I'd drop the n=1, the function ignores all elements of n after the first. Feb 18, 2015 at 13:06

CJam, 32 30 bytes

3ri:N#,N{0\__I1e>)=%-+}fI(;N<p

Takes input from STDIN.

Code explanation:

3ri:N#,                          "Read the input in N and get first 3^N whole numbers";
N{0\__I1e>)=%-+}fI        "Run the code block N times, storing index in I";
0\__                    "Put 0 before the array and take 2 copies";
I1e>)=              "Take min(2, I + 1) th index from the copy";
%             "Take every array[ min (2, I + 1)] element from the array";
-+           "Remove it from the list and prepend 0 to the list";
(;N<p   "Print number index 1 to N";

Try it online here

Python 2, 105 101 bytes

n=input()
L=range(-1,n*n+9,2)
i=2
while L[i:]:L=sorted(set(L)-set(L[L[i]::L[i]]));i+=1
print L[1:n+1]

Just a straightforward implementation.

Pyth, 393635 32 bytes

J%2r1h^Q2VJI>JhN=J-J%@JhN+2J;<JQ

Similar to the approach above, but things are 0-indexed rather than 1-indexed. Try it online.

Thanks to @Jakube for pointing out a byte saving.

Perl, 8681 78

86:

@a=(1..($k=<>)**2);for$n(@a){$i=1;@a=map{$i++%($n+($n<2))?$_:()}@a;$k-=$k&&print"$n "}

UPDATE: obviously, grep{...} is better than map{...?$_:()} 81: @a=(1..($k=<>)**2);for$n(@a){$i=1;@a=grep{$i++%($n+($n<2))}@a;$k-=$k&&print"$n "}

UPDATE: OK, actually a one-liner now. I can stop. (?) 78:

@a=(1..($k=<>)**2);for$n(@a){$k-=$i=$k&&print"$n ";@a=grep{$i++%($n+=$n<2)}@a}  Mathematica, 80 bytes (For[l=Range[#^2];i=1,(m=l[[i++]]~Max~2)<=Length@l,l=l~Drop~{m,-1,m}];l[[;;#]])&  Straight-forward implementation of the definition. As some other answers, starts with a range from 1 to n2 and then keeps filtering. J, 60 52 bytes  ({.}.@((>:@{.,]#~0<({~{.)|i.@#)@]^:[2,1+2*i.@*:@>:)) 8 1 3 7 9 13 15 21 25  Explanation (from right to left): 2,1+2*i.@*:@>: generates the list 2 1 3 5 7 9... with (n+1)^2 odd numbers ^:[ repeats n times the following @] using the list 0<({~{.)|i.@# is the remainder of the indexes of the lists elements with the first element positive (i.e. index divisible by first element) ]#~ keep those elements from the list >:@{., concatenate a first element with the value of the current one +1 }.@ drop first element {. take the first n element  2,1+2*i.@*:@>: seems way too long but I can only shorten it by 1 byte swapping *: with ! making the list grow exponentially. JavaScript (ES6) 96 99 Edit Counting down in first loop - thanks @DocMax F=n=>(i=>{ for(o=[1];--i;)o[i]=i-~i; for(;++i<n;)o=o.filter((x,j)=>++j%o[i]); })(n*n)||o.slice(0,n)  Ungolfed F=n=>{ for (i = n*n, o = [1]; --i;) o[i] = i+i+1; for (; ++i < n; ) o = o.filter((x, j) => (j+1) % o[i]) return o.slice(0,n) }  Test In Firefox / FireBug console F(57)  Output [1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99, 105, 111, 115, 127, 129, 133, 135, 141, 151, 159, 163, 169, 171, 189, 193, 195, 201, 205, 211, 219, 223, 231, 235, 237, 241, 259, 261, 267, 273, 283, 285, 289, 297, 303]  • You can save 1 by counting down with the first loop and up with the second: F=n=>{for(o=[1],i=n*n;--i;)o[i]=2*i+1;for(;++i<n;o=o.filter((x,j)=>++j%o[i]));return o.slice(0,n)} Feb 19, 2015 at 1:02 • Your ungolfed doesn't really help here :P ;) Feb 19, 2015 at 9:46 • @Optimizer ungolfed updated - maybe still not of much help, but at least working now Feb 19, 2015 at 9:57 • I meant more on lines on "simply a formatting change won't help, please provide comments :)" Feb 19, 2015 at 10:01 Octave, 13983 72 function r=l(n)r=1:2:n^2;for(i=2:n)h=r(i);r(h:h:end)=[];end;r=r(1:n);end  Ungolfed: function r=l(n) r=1:2:n^2; for(i=2:n) h=r(i); r(h:h:end)=[]; end r=r(1:n); # reduce it to only N lucky numbers end  Matlab, 104 bytes function x=f(n) k=1;N=n;x=0;while nnz(x)<n x=1:N;m=1;while m-nnz(x) m=x(x>m);x(m:m:end)=[];end N=N+2;end  With thanks to @flawr for very appropriate comments and suggestions. Example from Matlab command prompt: >> f(40) ans = Columns 1 through 22 1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79 87 93 Columns 23 through 40 99 105 111 115 127 129 133 135 141 151 159 163 169 171 189 193 195 201  • Thanks! I used that in the past, but tend to forget Feb 17, 2015 at 23:33 • @flawr Good point. This answer is becoming more yours than mine! :-) Feb 17, 2015 at 23:40 • Sure! I hang out more often in StackOverflow, but it's the same spirit there. I appreciate it! Feb 17, 2015 at 23:43 • Good point! I'm not sure all this I'm learning will be helpful or actually harmful for my standard Matlab usage, though :-P Feb 17, 2015 at 23:45 • Well codegolf is not about the use, but rather about the abuse of a language^^ Feb 17, 2015 at 23:46 Julia, 66 bytes x->(l=[1:x^2;];[deleteat!(l,(i+=i<2):i:length(l)) for i=l];l[1:x])  Try it online! Bash+coreutils, 136 I'd hoped to golf this down more, but oh well. Not every day that you pipe into a recursive function in a shell script: f(){ mapfile -tn$2 a
(($1>$2))&&{
tr \  \\n<<<${a[@]} sed$[${a[-1]}-$2]~${a[-1]}d }|f$1 $[$2+1]||echo ${a[@]} } yes|sed -n 1~2=|f$1 2

Output:

$./lucky.sh 23 1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79 87 93 99$

Bash+coreutils, 104

Shorter using a more straightforward implementation:

a=(seq 1 2 $[3+$1**2])
for((;i++<$1;));{ a=($(tr \  \\n<<<${a[@]}|sed 0~${a[i]}d))
}
echo ${a[@]:0:$1}

MATLAB, 62 characters

n=input('');o=1:2:n^2;for i=2:n;o(o(i):o(i):end)=[];end;o(1:n)

I misinterpreted the challenge at first - my revised version is now actually shorter.

05AB1E, 17 16 bytes

∞IFD®LKн©ô€¨˜}I£

Try it online.

Explanation:

∞             # Push an infinite positive list: [1,2,3,...]
IF           # Loop the input amount of times:
D          #  Duplicate the infinite list
®L        #  Push a list in the range [1,®]
#  (® is -1 by default, so the list is [1,0,-1] the first iteration)
K       #  Remove all those values from the duplicated list
н      #  Pop the list and leave the first (smallest) value
#  (this is basically the smallest value above ®)
©     #  Store it as new ® (without popping)
ô    #  Split the infinite list into parts of size ®
€¨  #  Remove the last item of each inner list
˜ #  Flatten it back to a single list
}I£         # After the loop: only leave the first input amount of values
# (after which the list is output implicitly as result)

Go, 326

package main
import"fmt"
func s(k, p int,in chan int)chan int{
o := make(chan int)
go func(){
for p>0{
o<-<-in;p--
}
for{
<-in
for i:=1;i<k;i++{o<-<-in}
}
}()
return o
}
func main(){
n := 20
fmt.Print(1)
c := make(chan int)
go func(c chan int){
for i:=3;;i+=2{c<-i}
}(c)
for i:=1;i<n;i++{
v := <-c
fmt.Print(" ", v)
c = s(v, v-i-2, c)
}
}

Straight forward implementation using goroutine and pipes to make sieves.

• This Code Golf, please add a byte count. Feb 17, 2015 at 16:55

Racket 196 bytes

Produces lucky numbers upto n:

(λ(n)(let loop((l(filter odd?(range 1 n)))(i 1))(define x(list-ref l i))(set! l(for/list((j(length l))

Ungolfed version:

(define f
(λ(n)
(let loop ((l (filter odd? (range 1 n))) (i 1))
(define x (list-ref l i))
(set! l (for/list ((j (length l)) #:unless (= 0 (modulo (add1 j) x)))
(list-ref l j)))
(if (>= i (sub1 (length l)))
l

(f 100)

'(1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79 87 93 99)

format: plain


text:
Opuscula Math. 30, no. 2 (), 155-177
http://dx.doi.org/10.7494/OpMath.2010.30.2.155
Opuscula Mathematica

Fréchet differential of a power series in Banach algebras

Abstract. We present two new forms in which the Fréchet differential of a power series in a unitary Banach algebra can be expressed in terms of absolutely convergent series involving the commutant $$C(T) : A \mapsto [A,T]$$. Then we apply the results to study series of vector-valued functions on domains in Banach spaces and to the analytic functional calculus in a complex Banach space.
Keywords: Fréchet differentiation in Banach algebras, functional calculus.
Mathematics Subject Classification: 58C20, 46H, 47A60.
Benedetto Silvestri, Fréchet differential of a power series in Banach algebras, Opuscula Math. 30, no. 2 (2010), 155-177, http://dx.doi.org/10.7494/OpMath.2010.30.2.155

a .bib file (BibTeX), a .ris file (RefMan), a .enw file (EndNote)
or export to RefWorks.

ISSN 1232−9274, e-ISSN 2300−6919, DOI http://dx.doi.org/10.7494/OpMath
Contact: opuscula@agh.edu.pl


text:
# 2017 Household Income Percentile Calculator for the United States

November 2nd, 2020 by
PK

We present here a household income percentile calculator for the United States for 2017. Enter a household income and we'll estimate which percentile it fell into, down to the closest .1%. The data was collected in the March 2017 ASEC, so incomes are for full-year January to December 2016. See more in our accompanying work on household income brackets in the United States.

Also on DQYDJ: an individual income by age calculator and the standard individual income calculator. For net worth, try the net worth percentile by age calculator and the standard net worth bracket calculator.

Note: the household income percentile calculator defaults to a logarithmic scale.

## Source and Methodology on the 2017 Household Income Percentile Calculator

Sarah Flood, Miriam King, Steven Ruggles, and J. Robert Warren. Integrated Public Use Microdata Series, Current Population Survey: Version 4.0. [dataset]. Minneapolis: University of Minnesota, 2015. http://doi.org/10.18128/D030.V4.0.

The data can be extracted and downloaded from here: IPUMS-CPS. For household income percentiles, you should do no filtering whatsoever - merely remove duplicated serials, then compute weighted percentiles for HHINCOME. The final set contains 69,957 data-points representing an estimated 126,519,332 American households. Be very careful with the incomes near the top of the scale; expect them to be well off in either direction starting somewhere around the top 1% or .5%.

## What is the Cutoff to be a 1%er Household in 2017?

Although we often argue that net worth is a better proxy for the "1%" (see our one percent in America article), most often the one-percent refers to income.

To reach the 1% in 2017, an American household would have to earn $430,600.00. Roughly 1,265,193 households made that or more for full year 2016. It isn't appropriate to make a .1% estimate with this rolled up household data (although there is a number in the tool). As the CPS is topcoded and already affects individual income estimates in an extreme way, assortative mating really breaks it for household income. However, the .5% number should be reasonably accurate. To be in the top .5% of American Householde, you would have to make$585,278.

## How Many American Households Made Between $100,000 and$200,000?

Let's work through "$100,000 to$200,000" together so you can (roughly - this is an estimate) answer questions of this type using the tool.

• Households: 126,519,332
• $100,000 Household Income Percentile: 72.5% •$200,000 Household Income Percentile: 93.1%

Now, simply find the proportion of households in range by subtracting, then multiply by the total number:

126,519,332 * (.931 - .725) =

Somewhere around 26,062,982 households in the United States made between $100,000 and$200,000.

## Selected Household Income Percentiles

Please see the household income bracket article for full context. Here's how selected household income brackets changed between 2016 to 2017.

Selected Household Income Percentiles, 2016-2017

Remember, once again, that surveys encompass the entire previous year of data. You're seeing 'full-year' 2015 versus 'full-year' 2016 in the graph.

So there you have it - household incomes to the nearest .1%. Stay tuned for more cuts of income and net worth data, and be sure to subscribe.

### Don't Quit Your Day Job...

DQYDJ may be compensated by our advertising and affiliate partners if you make purchases through links. See our disclosures page for more information.


text:
Search:

# Chemical equilibrium of gases

## The law of partial pressures

### Definition

The → partial pressure of a gaseous substance $X$ in a gas mixture of volume $V$ is its pressure supposing that it occupies alone the whole volume .

### Partial pressure and molarity

The ideal gas law allows to calculate the partial pressure of a gas $X$ in a gas mixture of volume $V$: $P_X$ $=$ $\frac{n_X\cdot R\cdot T }{V}$ $=$ $\frac{n_X}{V}\cdot R\cdot T$

Partial pressure of a gas $X$ in a gas mixture of volume $V$: $P_X$ $=$ $[X]\cdot R\cdot T$   (1) where $[X]$ is the molarity (molar concentration) of the gas $X$ in the gas mixture.

### Partial pressure and equilibrium constant

As gaseous equilibria $aX$ $+$ $bY$ $...$ $\leftrightarrows$ $cC$ $+$ $dD$ $...$ are always proceding in one single phase, the law of mass action applies: $K_c$ $=$ $\frac{[C]^c[D]^d...}{[X]^a[Y]^b...}$  (2) Introducing (1) into (2): $K_c$ $=$ $\frac{(\frac{P_C}{RT})^c(\frac{P_D}{RT})^d...}{(\frac{P_X}{RT})^a(\frac{P_Y}{RT})^b...}$ $=$ $\frac{P_C^cP_D^d...}{P_X^aP_Y^b...}(RT)^{a+b+...-(c+d+.. )}$ As $K_c$ depends only on the temperature, this applies also to : $K_p$ $=$ $\frac{K_c}{(RT)^{a+b+...-(c+d+.. )}}$ and so we have:

Equilibrium between gases: $K_p$ $=$ $\frac{P_C^cP_D^d...}{P_X^aP_Y^b...}$ where $K_p$ is the pressure equilibrium constant.

### Relation between $K_p$ and $K_c$

As a result of the previous calculation, we have :

$K_c$ $=$ $K_p(RT)^{a+b+...-(c+d+..)}$ where $a$ $+$ $b$ $+$ $...$ $-(c+d+.. )$ is the difference between the sum of coefficients of the reagents and the sum of coefficients of the products as shown in the equation.


text:
# Why the discrete subgroup of $R^n$ has finite balls?

Consider a discrete subgroup $G$ of $R^n$. Then let we have an open ball $B\subset G$ (topology in $G$ is induced from $R^n$). Why is $|B|<\infty$?

For example I can take $A=\{\tfrac{1}{1},\tfrac{1}{2}, \tfrac{1}{3}, \tfrac{1}{4},\cdots, -1\}$, which is discrete set. Naturally I can find an open ball in A which is not finite, however $A$ is not a group. So I guess being group is necessary.

-
Hint: infinite bounded subsets of $\mathbb{R}^n$ have an accumulation point. – t.b. Jul 17 '11 at 21:01
It is discrete: please note it does not contain $0$. And for every $\frac{1}{k}$ we can find small enough ball which does not touch $\frac{1}{k-1}$ and $\frac{1}{k+1}$. – Yosif Jul 17 '11 at 21:09
Ah, I misread $0$ for $-1$. Note that subgroups are homogeneous: The map $g \mapsto g+h$ is a homeomorphism of $G$ onto itself. – t.b. Jul 17 '11 at 21:11
So if we can find any point which is has an open ball that does not touch any other point, therefore such ball with its center in any other point does not touch other points. And therefore it has to be finite. Is that right? (In other words in discrete subgroups the radius of separating ball has to be good for all points). – Yosif Jul 17 '11 at 21:20
Yes you can do it this way, that's even better than the argument I had in mind initially. – t.b. Jul 17 '11 at 21:24

Here are two key facts:

1) We are working inside $\mathbb{R}^n$, in which a subset is compact iff it is closed and bounded (Heine-Borel).

2) A discrete subgroup $G$ of any Hausdorff topological group is closed (a proof of this was given recently on this site). More generally, any locally compact subgroup of a Hausdorff group is closed.

So let $G$ be a discrete subgroup of $\mathbb{R}^n$. We want to prove that for every ball $B$ of finite radius, $B \cap G$ is finite. We easily reduce to the following special case: for all $r \geq 0$, the intersection of $G$ with the closed ball $B_r$ of radius $r$ centered at $0$ is finite.

Now let us apply the above facts: since $B_r$ is closed and bounded in $\mathbb{R}^n$, it is compact. Since $G$ is closed in $\mathbb{R}^n$, $G \cap B_r$ is closed in $B_r$, so $G \cap B_r$ is compact. Moreover, $G \cap B_r$ is a subspace of the discrete space $G$, so it is discrete. But a topological space which is both compact and discrete is necessarily finite.

-
You probably mean this thread in 2). – t.b. Jul 27 '11 at 23:43
@Theo: of course, you're right. The next time this happens, if you just go ahead and edit the link into my answer I'll take it as a big favor. :) – Pete L. Clark Jul 28 '11 at 2:34
Okay, I'll do that :) – t.b. Jul 28 '11 at 2:36


text:
# How do you use a variable in a Puppet Manifest?

I am using the WSUS Module with Puppet Master on Centos 7.2. My Puppet Agent servers are running Windows Server 2012.

I want to use a manifest with a variable. However, when the Puppet Agent server has the puppet agent run, it displays "error 400, syntax error." I have tried re-writing the manifest and every variation I could think of. I keep getting some error.

Here is one example of a manifest:

class excellent {
class { 'wsus_client':
$cool = 'Saturday' server_url => 'http://acme.com', auto_update_option => 'Scheduled' scheduled_install_day =>$cool,
scheduled_install_hour => 1,
}
}

I've tried assigning the variable in braces {}. I tried to use $LOAD_PATH, --custom-dir and FACTERLIB. But I could not figure out how to use any of these three. I want to change the variable in one place and use it within the scope of its parent class. What should I do? edit retag close merge delete ## 2 Answers Sort by » oldest newest most voted can you define$cool where you have, just after the colon?

Move it outside of the inner class.

 class excellent {
$cool = 'Saturday' class { 'wuss_client': server_url => 'http://acme.com', etc => 'other parts', } }  more If you want to access/modify a value in a class, the best way to do that is via parameters. There is a really good set of guides in this gitbook on Test Driven Puppet You should create it as a parameter to your class, and set the value either by passing a value to it, or by filling in the value via Hiera's Automatic Parameter Lookup (APL) class excellent($cool = 'Saturday',
) {
class { 'wsus_client':
server_url => 'http://acme.com',
auto_update_option  => 'Scheduled'
scheduled_install_day => \$cool,
scheduled_install_hour => 1,
}
}

more


text:
## Electronic Journal of Probability

### Joint Distribution of the Process and its Sojourn Time on the Positive Half-Line for Pseudo-Processes Governed by High-Order Heat Equation

#### Abstract

Consider the high-order heat-type equation $\partial_t u=\pm \partial^n_x u$ for an integer $n>2$ and introduce the related Markov pseudo-process $(X(t))_{t\geq0}$. In this paper, we study the sojourn time $T(t)$ in the interval $[0,+\infty)$ up to a fixed time $t$ for this pseudo-process. We provide explicit expressions for the joint distribution of the couple $(T(t),X(t))$.

#### Article information

Source
Electron. J. Probab., Volume 15 (2010), paper no. 28, 895-931.

Dates
Accepted: 17 June 2010
First available in Project Euclid: 1 June 2016

https://projecteuclid.org/euclid.ejp/1464819813

Digital Object Identifier
doi:10.1214/EJP.v15-782

Mathematical Reviews number (MathSciNet)
MR2653948

Zentralblatt MATH identifier
1231.60032

Rights

#### Citation

Lachal, Aimé; Cammarota, Valentina. Joint Distribution of the Process and its Sojourn Time on the Positive Half-Line for Pseudo-Processes Governed by High-Order Heat Equation. Electron. J. Probab. 15 (2010), paper no. 28, 895--931. doi:10.1214/EJP.v15-782. https://projecteuclid.org/euclid.ejp/1464819813

#### References

• M. Abramowitz and I.-A. Stegun. Handbook of mathematical functions with formulas, graphs, and mathematical tables. Dover Publications, 1992.
• L. Beghin, K.-J. Hochberg and E. Orsingher. Conditional maximal distributions of processes related to higher-order heat-type equations. Stochastic Process. Appl. 85 (2000), no. 2, 209-223.
• L. Beghin and E. Orsingher. The distribution of the local time for "pseudoprocesses" and its connection with fractional diffusion equations. Stochastic Process. Appl. 115 (2005), 1017-1040.
• L. Beghin, E. Orsingher and T. Ragozina. Joint distributions of the maximum and the process for higher-order diffusions. Stochastic Process. Appl. 94 (2001), no. 1, 71-93.
• H. Bohr. Über die gleichmässige Konvergenz Dirichletscher Reihen. J. für Math. 143 (1913), 203-211.
• V. Cammarota and A. Lachal. arXiv:1001.4201 [math.PR].
• A. Erdélyi, Editor. Higher transcendental functions, vol. III, Robert Krieger Publishing Company, Malabar, Florida, 1981.
• K.-J. Hochberg. A signed measure on path space related to Wiener measure. Ann. Probab. 6 (1978), no. 3, 433-458.
• K.-J. Hochberg and E. Orsingher. The arc-sine law and its analogs for processes governed by signed and complex measures. Stochastic Process. Appl. 52 (1994), no. 2, 273-292.
• V. Yu. Krylov. Some properties of the distribution corresponding to the equation $frac{partial u}{partial t}=(-1)^{q+1}frac{partial^{2q} u}{partial^{2q} x}$. Soviet Math. Dokl. 1 (1960), 760-763.
• A. Lachal. Distribution of sojourn time, maximum and minimum for pseudo-processes governed by higer-order heat-typer equations. Electron. J. Probab. 8 (2003), paper no. 20, 1-53.
• A. Lachal. Joint law of the process and its maximum, first hitting time and place of a half-line for the pseudo-process driven by the equation $frac{partial}{partial t}=pmfrac{partial^N}{partial x^N}$. C. R. Acad. Sci. Paris, SÃƒÂˆr. I 343 (2006), no. 8, 525-530.
• A. Lachal. First hitting time and place, monopoles and multipoles for pseudo-procsses driven by the equation $frac{partial}{partial t}=pm frac{partial^N}{partial x^N}$. Electron. J. Probab. 12 (2007), 300-353.
• A. Lachal. First hitting time and place for the pseudo-process driven by the equation $frac{partial}{partial t}=pmfrac{partial^n}{partial x^n}$ subject to a linear drift. Stoch. Proc. Appl. 118 (2008), 1-27.
• T. Nakajima and S. Sato. On the joint distribution of the first hitting time and the first hitting place to the space-time wedge domain of a biharmonic pseudo process. Tokyo J. Math. 22 (1999), no. 2, 399-413.
• Ya. Yu. Nikitin and E. Orsingher. On sojourn distributions of processes related to some higher-order heat-type equations. J. Theoret. Probab. 13 (2000), no. 4, 997-1012.
• K. Nishioka. Monopole and dipole of a biharmonic pseudo process. Proc. Japan Acad. Ser. A 72 (1996), 47-50.
• K. Nishioka. The first hitting time and place of a half-line by a biharmonic pseudo process. Japan J. Math. 23 (1997), 235-280.
• K. Nishioka. Boundary conditions for one-dimensional biharmonic pseudo process. Electronic Journal of Probability 6 (2001), paper no. 13, 1-27.
• E. Orsingher. Processes governed by signed measures connected with third-order "heat-type" equations. Lithuanian Math. J. 31 (1991), no. 2, 220-231.
• F. Spitzer. A combinatorial lemma and its application to probability theory. Trans. Amer. Math. Soc. 82 (1956), 323-339.


text:
# List of Cool People I recommend!

Here I list some of my acquaintances that have demonstrated certain skills. aka. “People I would provide a reference for”.

## Readme

To be listed here, you need to:

• Be an acquaintance to me, either:
• Have been my classmate (at my discretion), or
• Have communicated with me frequently.
• Possesses a skill that’s enough to provide a service (How should I word it…), i.e. fits in one of the categories below,
• Has social media, contact, or website for me to link to.
• Social media: Discord / GitHub / Instagram / Telegram / Matrix

## Misc

• Michael O (D: michaelnj1#8557): Sneakers trading.


text:
# Weak Markov property implies strong Markov property for discrete time

From Klenke, p. 356:

Theorem 17.14: If $I \subset [0,\infty)$ is countable and closed under addition, then every Markov process $(X_n)_{n\in I}$ with distributions $(\mathbf{P}_x)_{x\in E}$ has the strong Markov property.

Proof: Let $f\colon E^I \rightarrow \mathbb{R}$ be measurable and bounded. Then, for every $s \in I$, the random variable $1_{\{\tau=s\}} \mathbf{E}_x[f((X_{s+t})_{t\in I}) | \mathcal{F}_\tau ]$ is measurable with respect to $\mathcal{F}_s$. Using the tower property of the conditional expectation and Theorem 17.9 in the third equality, we thus get

\begin{align*} \mathbf{E}_x\bigl[f\bigl((X_{\tau+t})_{t\in I} \bigr) \big| \mathcal{F}_\tau \bigr] &= \sum_{s\in I} \mathbf{1}_{\{\tau=s\}} \mathbf{E}_x \bigl[ f \bigl( (X_{s+t})_{t\in I} \bigr) \big| \mathcal{F}_\tau \bigr] \\ & = \sum_{s\in I} \mathbf{E}_x\bigl[\mathbf{1}_{\{\tau=s\}} \mathbf{E}_x \bigl[ f \bigl((X_{s+t})_{t\in I} \bigr) \big| \mathcal{F}_s\bigr] \big| \mathcal{F}_\tau \bigr]\\ & = \sum_{s\in I} \mathbf{E}_x \bigl[ \mathbf{1}_{\{\tau=s\}} \mathbf{E}_{X_s} \bigl[ f \bigl( (X_t)_{t\in I} \bigr) \big| \mathcal{F}_\tau \bigr] \\ & = \mathbf{E}_{X_\tau}\bigl[f \bigl( (X_t)_{t\in I}\bigl)\bigr]\, . \end{align*}

In the last step, why can the conditional probability be eliminated?

Since $X_{\tau}$ is $\mathcal{F}_{\tau}$-measurable, we have $$\mathbb{E}_x(g(X_{\tau}) \mid \mathcal{F}_{\tau}) = g(X_{\tau})$$ for any measurable function $g: E \to \mathbb{R}$. Use this for $g(x) := \mathbb{E}_x(f((X_t)_{t \in I})$.
• Thank you! One question: isn't it $g\colon E\rightarrow \mathbb{R}$? – Ystar May 12 '15 at 14:33


text:
# When is a function pure?

Functional programming evolves around functions and a pure function is a very important aspect. But when exactly is function pure? I’ll try to show when a function is pure with some examples.

The following function is pure because no external state is touched and every time the function is called with the same parameters the result will be the same.

public function add(Integer x, Integer y) {
return x + y;
}

When the result of a function is different with each call the function is not pure (or impure). Using the random generator will make the following function impure.

public function generateId() {
return Math.random();
}

Updating some non-local variable also will make the function impure. The following function is impure because of the non-local variable and also because the result will vary every invocation.

public function inc() {
this.counter++;
return this.counter;
}

Using pure functions has some advantages that are worth the effort. Some of the advantages are:

• Testability; Every function can be unit tested with a elegant and concise unit test. Because a function cannot introduce side effects and the result can be easily predicted the unit test can be very simple.
• Memoizable; When a function is used often in a program the result can be cached and looked up in a table. This can only be done when the function is pure and the function does not call another impure function.
• Parallelism; Functions can be executed on different processors because they don’t share state.

So to give a sum


text:
# AliveParticleFilter

class AliveParticleFilter < ParticleFilter

Alive particle filter. When propagating and weighting particles, the alive particle filter maintains $N$ particles with non-zero weight, rather than $N$ particles in total as with the standard particle filter.


text:
ReportingTools error message
1
0
Entering edit mode
Assa Yeroslaviz ★ 1.5k
@assa-yeroslaviz-1597
Last seen 10 days ago
Munich, Germany
Hi, I am running (again) a DESeq analysis and try to create a html report using the ReportingTools package. I do the DESeq2 analysis and get the fit object like in the manual (see below). I than try to create the html report but keep getting an error I can't interpret. Error in $<-.data.frame(*tmp*, "Image", value = "") : replacement has 1 row, data has 0 I really don't understand what data.frame is meant here. In the DEseq analysis I don't have any replica, only two samples, which I ran with this code: FirstComp <- Table[,c(5,8)] > head(FirstComp) WT treated FBgn0000003 0 7 FBgn0000008 92 2096 FBgn0000014 32 23 FBgn0000015 13 21 FBgn0000017 652 2782 FBgn0000018 51 139 colData1 <- data.frame(row.names=names(FirstComp), condition = c("WT", "treated")) cds <- DESeqDataSetFromMatrix ( countData = FirstComp, colData = colData1, design = ~ condition ) class: DESeqDataSet dim: 14869 2 exptData(0): assays(1): counts rownames(14869): FBgn0000003 FBgn0000008 ... FBgn0261574 FBgn0261575 rowData metadata column names(0): colnames(2): WT treated colData names(1): condition fit = DESeq(cds) res = results(fit) After that I try to create the html report with these commands: des2Report <- HTMLReport() publish(fit,des2Report, pvalueCutoff=0.05,annotation.db=NULL, factor = colData(fit)$condition) finish(des2Report) Than I keep getting the above mentioned error message. Can anyone explain to me what I am doing wrong? thanks Assa [[alternative HTML version deleted]]
0
Entering edit mode
Assa Yeroslaviz ★ 1.5k
@assa-yeroslaviz-1597
Last seen 10 days ago
Munich, Germany
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https: stat.ethz.ch="" pipermail="" bioconductor="" attachments="" 20140611="" 5cbb4fe8="" attachment-0001.pl="">
0
Entering edit mode
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https: stat.ethz.ch="" pipermail="" bioconductor="" attachments="" 20140611="" 2ffae722="" attachment-0001.pl="">
0
Entering edit mode
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https: stat.ethz.ch="" pipermail="" bioconductor="" attachments="" 20140612="" 746307d2="" attachment-0001.pl="">
0
Entering edit mode
Hi Jason, Thanks for the hint. You were correct. Apparently no genes passes the p-value threshold of 0.05, which is to be expected, when doing an analysis of only two samples with no replica. I didn't think about that factor, as the error message is very encrypted. I think there should be a better message there - something like " no genes passes the threshhold of the given p-value". This should be checked, before the command try to convert the 'fit' Object into a data.frame with no genes in it and than do the images. Anyhow, thanks again for this (obvious :( ) comment Assa On Thu, Jun 12, 2014 at 12:20 AM, Jason Hackney <hackney.jason@gene.com> wrote: > Hi Assa, > > A couple of questions/comments: > > 1. How many features pass your p-value cutoff of 0.05? > 2. Could you provide your sessionInfo, so I can see what version of > ReportingTools you're using? > > I believe the data.frame in the error message comes from the coercion of > your DESeqResults object to a data.frame before being formatted as an html > table. This happens in two steps for this type of object: First, the > results are made into a data.frame, optionally including annotations (using > the toReportDF method); second, plots and optionally links are added to the > data.frame (using the modifyReportDF method). > > My further guess about what's going wrong here is that there is something > going wrong in making the plots for the individual genes. You could test > this by adding the parameter make.plots = FALSE to your publish call. > This might not throw the same error. > > At the very least, it looks like there's a bug in the modifyReportDF > method(s) being used that don't correctly check for zero row input, so I'll > include a fix for that with a more helpful error. > > Thanks! > > J > > > > > > On Wed, Jun 11, 2014 at 1:31 PM, Assa Yeroslaviz <frymor@gmail.com> wrote: > >> Hi, >> >> I am running (again) a DESeq analysis and try to create a html report >> using >> the ReportingTools package. >> >> I do the DESeq2 analysis and get the fit object like in the manual (see >> below). I than try to create the html report but keep getting an error I >> can't interpret. >> >> Error in $<-.data.frame(*tmp*, "Image", value = "> href=\"figuresDEgenes_IFM_0_3dvsleg/boxplot..pdf\">> src=\"figuresDEgenes_IFM_0_3dvsleg/mini..png\" >> alt=\"figuresDEgenes_IFM_0_3dvsleg/mini..png\">") : >> replacement has 1 row, data has 0 >> >> I really don't understand what data.frame is meant here. >> >> In the DEseq analysis I don't have any replica, only two samples, which I >> ran with this code: >> FirstComp <- Table[,c(5,8)] >> > head(FirstComp) >> WT treated >> FBgn0000003 0 7 >> FBgn0000008 92 2096 >> FBgn0000014 32 23 >> FBgn0000015 13 21 >> FBgn0000017 652 2782 >> FBgn0000018 51 139 >> colData1 <- data.frame(row.names=names(FirstComp), condition = c("WT", >> "treated")) >> >> cds <- DESeqDataSetFromMatrix ( >> countData = FirstComp, >> colData = colData1, >> design = ~ condition >> ) >> >> class: DESeqDataSet >> dim: 14869 2 >> exptData(0): >> assays(1): counts >> rownames(14869): FBgn0000003 FBgn0000008 ... FBgn0261574 FBgn0261575 >> rowData metadata column names(0): >> colnames(2): WT treated >> colData names(1): condition >> >> fit = DESeq(cds) >> res = results(fit) >> >> After that I try to create the html report with these commands: >> des2Report <- HTMLReport() >> publish(fit,des2Report, pvalueCutoff=0.05,annotation.db=NULL, factor = >> colData(fit)$condition) >> finish(des2Report) >> >> Than I keep getting the above mentioned error message. >> >> Can anyone explain to me what I am doing wrong? >> >> thanks >> Assa >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > > > -- > Jason A. Hackney, Ph.D. > Bioinformatics and Computational Biology > Genentech > hackney.jason@gene.com > 650-467-5084 > > > [[alternative HTML version deleted]]
0
Entering edit mode
Hi Assa, A couple of questions/comments: 1. How many features pass your p-value cutoff of 0.05? 2. Could you provide your sessionInfo, so I can see what version of ReportingTools you're using? I believe the data.frame in the error message comes from the coercion of your DESeqResults object to a data.frame before being formatted as an html table. This happens in two steps for this type of object: First, the results are made into a data.frame, optionally including annotations (using the toReportDF method); second, plots and optionally links are added to the data.frame (using the modifyReportDF method). My further guess about what's going wrong here is that there is something going wrong in making the plots for the individual genes. You could test this by adding the parameter make.plots = FALSE to your publish call. This might not throw the same error. At the very least, it looks like there's a bug in the modifyReportDF method(s) being used that don't correctly check for zero row input, so I'll include a fix for that with a more helpful error. Thanks! J On Wed, Jun 11, 2014 at 1:31 PM, Assa Yeroslaviz <frymor@gmail.com> wrote: > Hi, > > I am running (again) a DESeq analysis and try to create a html report using > the ReportingTools package. > > I do the DESeq2 analysis and get the fit object like in the manual (see > below). I than try to create the html report but keep getting an error I > can't interpret. > > Error in $<-.data.frame(*tmp*, "Image", value = " href=\"figuresDEgenes_IFM_0_3dvsleg/boxplot..pdf\"> src=\"figuresDEgenes_IFM_0_3dvsleg/mini..png\" > alt=\"figuresDEgenes_IFM_0_3dvsleg/mini..png\">") : > replacement has 1 row, data has 0 > > I really don't understand what data.frame is meant here. > > In the DEseq analysis I don't have any replica, only two samples, which I > ran with this code: > FirstComp <- Table[,c(5,8)] > > head(FirstComp) > WT treated > FBgn0000003 0 7 > FBgn0000008 92 2096 > FBgn0000014 32 23 > FBgn0000015 13 21 > FBgn0000017 652 2782 > FBgn0000018 51 139 > colData1 <- data.frame(row.names=names(FirstComp), condition = c("WT", > "treated")) > > cds <- DESeqDataSetFromMatrix ( > countData = FirstComp, > colData = colData1, > design = ~ condition > ) > > class: DESeqDataSet > dim: 14869 2 > exptData(0): > assays(1): counts > rownames(14869): FBgn0000003 FBgn0000008 ... FBgn0261574 FBgn0261575 > rowData metadata column names(0): > colnames(2): WT treated > colData names(1): condition > > fit = DESeq(cds) > res = results(fit) > > After that I try to create the html report with these commands: > des2Report <- HTMLReport() > publish(fit,des2Report, pvalueCutoff=0.05,annotation.db=NULL, factor = > colData(fit)$condition) > finish(des2Report) > > Than I keep getting the above mentioned error message. > > Can anyone explain to me what I am doing wrong? > > thanks > Assa > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Jason A. Hackney, Ph.D. Bioinformatics and Computational Biology Genentech hackney.jason@gene.com 650-467-5084 [[alternative HTML version deleted]]


text:
## Full line trajectories plot for the solution of Second Order nonlinear coupled differential equations

I wanted to plot a phase plane containing the trajectories of the solutions found by using ‘NDSolve’ using the initial conditions for x[0], y[0], x'[0] and y'[0]. The equations are: x”[t] – 2 y'[t] == -x[t] + y[t]^2; y”[t] + 2 x'[t] == x[t] + y[t] + x[t]*y[t]

The equilibrium point for the system is (0,0). I have plotted the stream plot for the system but unable to plot a phase portrait that would give me the full line trajectories of the system for different initial conditions. I am also looking for any periodic solution if present in it. The stream plot I got is given below and I would take initial conditions from it.

I get this by using the Parametric Plot of the NDSolve solution:

Kindly help in this capacity. Thanks in advance.

## Nonlinear Differential Equation with Paramaters in Sqrt Function

For a university project, I am trying to see if my system will have choked flow and also plot the resulting pressure spike. I set up the system below to try to model the transient response.

I am able to solve the equations TEq and mEq simultaneously if I use the mDotOutChoked equation in place of the mDotOut equation. But I want to know if it ever even reaches the choked condition, and what the steady-state pressure and temperature will be so I want to start with just using the mDotOut equation.

When I run this as it is below, I get "This computation has exceeded the time limit for your plan" followed by "{sol1} is neither a list or replacement rules nor a valid dispatch table, and so…" for all the graphs.

If I replace the pressure term with just a constant, I can get some limited success depending on the value I use. This makes me think there might be an issue with having the T[t] and P[t] terms in the square root in the mDotOut equation.

Is there some issue in {sol1} or is that issue just a result of me needing to upgrade for more compute power?

ClearAll["Global*"]  Q =  100 ;(*Heat into the shroud in Watts. Based on roughly 1350 W/m^2 from the solar simulator on one face of the shroud*) QAmb = 0  ;(*Heat loss to ambinet. Zero for now*) A =  2*1.935*10^-5 ;(*Area of orifice m^2  Based on 1/4 inch pipe with 0.028 inch wall thickness (two outlets)*) h =  199000 ;(*Heat of vaporization of LN2 J/kg*) Cp =  1039 ;(*Specific heat of nitrogen J/(kg K) *) R =  296.8 ;(*Gas constant for nitrogen J/(kg K)*) γ = 1.40  ;(*Specific heat ratio*) V = 0.001 ; (*Enclosed volume m^3*) Pe = 101000 ; (*External pressure in pa*) ρo = 4 ;(*Approx density of nitrogen at 80K in kg/m^3. This was the lowest temp data I could find*) tf = 300 ;(*Final time in seconds*)  P = m[t]*R*T[t]/V ;(*Pressure term*) mDotEvap = Q/h ; (*rate of evap*) mDotOut = (P*A/Sqrt[T[t]])*Sqrt[(2γ/(R(γ-1)))*((Pe/P)^(2/γ)-(Pe/P)^((γ+1)/γ))];  (*mass flow out of the orifice*) mDotOutChoked =  (P*A/Sqrt[T[t]])*Sqrt[γ/R]*(2/(γ+1))^((γ+1)/(2(γ-1))); (*mass flow out of the orifice if choked*)  TEq = T'[t] == 1/(m[t]*Cp)(mDotEvap*h-mDotOut*Cp*T[t]-QAmb) ; (*Diff Eq for Temperature in the cavity*) mEq = m'[t] == mDotEvap - mDotOut ; (*Conservation of mass*)  icT = T[0] == 77 ;(*initial temp in the cavity in K*) icm = m[0] == ρo*V ;(*initial mass of the vaporized gas. Assuming it just starts at 77k at 1atm and then adding heat*)  sol1 = NDSolve[{TEq,mEq, icT, icm}, {T[t], m[t]},{t, 0, tf} ] ; P2[t_] = m[t]*R*T[t]/V /.sol1 ; (*Plugging back to get shroud pressure as functon of time*)  Plot[{T[t]/.sol1},{t,0,tf},PlotRange -> Automatic, ImageSize->"Large",PlotLabels->Automatic, AxesLabel -> {Time (s),Temperature (K) }] Plot[{m[t]/.sol1},{t,0,tf},PlotRange -> Automatic, ImageSize->"Large",PlotLabels->Automatic,  AxesLabel -> {Time (s),Mass (Kg) }] Plot[P2[t], {t, 0, tf}, PlotRange -> Automatic, ImageSize -> "Large", PlotLabels -> Automatic,  AxesLabel -> {Time (s),Pressure (Pa) }]

## non-linear model fit function not working

I have attempted to exercise a non-linear model fit to my data, dadtAbs, and got the following puzzle

nlm =    NonlinearModelFit[     Transpose[{Table[t, {t, 1, tmax}],dadtAbs}],      (1 - aaa)*bbb*NSPI[bbb, ddd, population, t] *        (1 - ddd)*(population - NSPI[bbb, ddd, population, t]),      {aaa, bbb, ddd},      t]

where dadtAbs is a list, population is a known constant, aaa, bbb, ddd are the desired answers, and t is the variable.

When I queried nlm, I got

[0.]

Here is the function NSPI:

NSPI[alpha_, delta_, population_, tt_] :=    population/(1 + (population - 1)*Exp[-alpha*population*(1 - delta)*tt])

population is a large constant, for example, 1000000

## Steady state solution (1D) of nonlinear dispersal equation

Now I’m interested in the equation $$\frac{\partial }{\partial x}\Bigl(\text{sgn}(x) u \Big) +\frac{\partial}{\partial x} \Bigl[ u^2 \frac{\partial u}{\partial x} \Bigr] =0$$ with boundary conditions $$u(-5)=u(5)=0$$

Since $$\text{sgn}(x)$$ is not differentiable at $$x=0$$, I expectd ND solve to have some problems. I tried

sol = NDSolveValue[{   0 == D[Sign[x]*u[x],x] + D[u[x]^2 D[u[x], x], x],    u[-6] == 0, u[6] == 0}   , u, {x, -7, 7}]

but I can’t even plot it and I think that I’m writing it in the wrong way. Could someone confirm I wrote the right snippet and show the plot I should obtain?

• I asked a related question three days ago, where the equation was the PDE $$\partial_t u = \partial_x (\text{sign}(x) u) + \partial_x (u^2\partial_x u)$$. The one I have above it’s the steady state solution, and I want to compute it directly, instead of integrating in time.

## Why don’t they use all kinds of non-linear functions in Neural Network Activation Functions? [duplicate]

Pardon my ignorance, but after just learning about Sigmoid and Tanh activation functions (and a few others), I am wondering why they choose functions that always go up and to the right? Why not use all kinds of crazy input functions, those that fluctuate up and down, ones that are directed down instead of up, etc.? What if used functions like those in your neurons, what is the problem, why isn’t it done? Why do they stick to very primitive very simple functions?

## How solve nonlinear equations by 14 unknowns?

This is my code, i want to solve system by 14 equations and 14 unknowns(rr list).But the code doesn’t run…

Clear["Global*"] T[0, t_] = 1; T[1, t_] = t; T[n_, t_] := 2 *t*T[n - 1, t] - T[n - 2, t]; For[n = 0, n <= 7, n++, Print["T[", n, ",t]= ", T[n, t], "\n"]]; tableoft = tt /.NSolve[T[7, tt], tt]; tableoft[[1]]; Subscript[z, 1][t_] = Sum[Simplify[Subscript[a, j]*T[j, t]], {j, 0, 6}]; Subscript[z, 2][t_] = Sum[Simplify[Subscript[b, l]*T[l, t]], {l, 0, 6}]; f[t_] = (t^4/6 - t^3/3 + t) /. t -> 1/2*(\[Tau] + 1); Subscript[k, 1][t_, s_] = s^3 /. s -> 1/4*(\[Tau] + 1)*(r + 1); Subscript[k, 1][t, s]*Subscript[z, 1][r]; p[\[Tau]_] =   Integrate[Subscript[k, 1][t, s]*Subscript[z, 1][r], {r, -1, 1}] Subscript[k, 2][t_, s_] = -2 (t - s) /. t -> 1/2*(\[Tau] + 1) /.    s -> 1/4*(\[Tau] + 1)*(r + 1); Subscript[k, 2][t, s]*Subscript[z, 2][r];     pp[\[Tau]_] =   Integrate[Subscript[k, 2][t, s]*Subscript[z, 2][r], {r, -1, 1}]; Subscript[g, 2][\[Tau]_] =   Expand[(f[t] + p[\[Tau]] + pp[\[Tau]])^2] // N; Subscript[\[Delta],    1][\[Tau]_] = ((Subscript[z,      1][\[Tau]])*((f[t] + p[\[Tau]] + pp[\[Tau]])) - 1) // N; Subscript[\[Delta],    2][\[Tau]_] = (Subscript[z, 2][\[Tau]] -Subscript[g, 2][\[Tau]]) // N;  Table[N[Subscript[\[Delta], 1][tableoft[[i]]]], {i, 1, 7}];  Table[N[Subscript[\[Delta], 2][tableoft[[i]]]], {i, 1, 7}];  r = Flatten[Table[N[{Subscript[\[Delta], 1][tableoft[[i]]],   Subscript[\[Delta], 2][tableoft[[i]]]}], {i, 1, 7}]];  rr =Table[Simplify[r[[i]]] == 0, {i, 1, 14}]  list =Flatten[Table[{Subscript[a, i], Subscript[b, i]}, {i, 0, 6}]];  Solve[rr, list]

How to get solution fast?

## Solving symoblic system of non-linear equations takes too long

I am trying to solve a set of system of symbolic non-linear equations:

g1 = ptz + pz + 2 pty q0 q1 - 2 ptz q1^2 + 2 px q0 q2 - 2 pz q2^2 -     2 px q1 q3 - 2 pty q2 q3 - 2 ptz q3^2 - 2 pz q3^2 ; g2 = 2 (ptx q0 q1 + px q0 q1 + ptz q1 q2 - pz q1 q2 + ptz q0 q3 +       pz q0 q3 - ptx q2 q3 + px q2 q3); g3 = ptx + px - 2 ptx q1^2 - 2 px q1^2 - 2 pz q0 q2 - 2 pty q1 q2 -     2 px q2^2 - 2 pty q0 q3 - 2 pz q1 q3 - 2 ptx q3^2 ; g4 = -2 pty q0 q2 - 2 py q0 q2 + 2 ptz q1 q2 - 2 pz q1 q2 -     2 ptz q0 q3 - 2 pz q0 q3 - 2 pty q1 q3 + 2 py q1 q3 ; g5 = ptz + pz - 2 py q0 q1 - 2 pz q1^2 - 2 ptx q0 q2 - 2 ptz q2^2 -     2 ptx q1 q3 - 2 py q2 q3 - 2 ptz q3^2 - 2 pz q3^2 ; g6 = -pty - py - 2 pz q0 q1 + 2 py q1^2 + 2 ptx q1 q2 + 2 pty q2^2 +     2 py q2^2 - 2 ptx q0 q3 + 2 pz q2 q3 + 2 pty q3^2 ; g7 = q0^2 + q1^2 + q2^2 + q3^2;  NSolve[{g1 == 0, g2 == 0, g3 == 0, g4 == 0, g5 == 0, g6 == 0,    g7 == 1}, {q0, q1, q2, q3}, Reals]

Here all variables except q0, q1, q2 and q3 are considered fixed. The variables represent a unit quaternion. Testing for corner cases (by setting single element of quaternion to 0) reveals that these set of equations don’t have a solution, which is what I intend to prove. But the code takes too long to run. Any suggestions would be appreciated.

I could treat the elements of quaternion and the permutations of the elements as separate variable and solve the system as Linear Equations, which I did for the corner cases. But here I don’t have enough constraints (10 unknowns with 7 constraints) and hence can’t employ that method.

## Approximate solution of a nonlinear ODE in the form of a Fourier series containing the coefficients of the initial ODE

In this topic we considering nonlinear ODE:

$$\frac{dx}{dt}= (x^4) \cdot a_1 \cdot sin(\omega_1 \cdot t)-a_1 \cdot sin(\omega_1 \cdot t + \frac{\pi}{2})$$ – Chini ODE

And system of nonlinears ODE:

$$\frac{dx}{dt}= (x^4+y^4) \cdot a_1 \cdot sin(\omega_1 \cdot t)-a_1 \cdot sin(\omega_1 \cdot t + \frac{\pi}{2})$$

$$\frac{dy}{dt}= (x^4+y^4) \cdot a_2 \cdot sin(\omega_2 \cdot t)-a_2 \cdot sin(\omega_2 \cdot t + \frac{\pi}{2})$$

Chini ODE’s NDSolve in Mathematica:

pars = {a1 = 0.25, \[Omega]1 = 1} sol1 = NDSolve[{x'[t] == (x[t]^4) a1 Sin[\[Omega]1 t] - a1 Cos[\[Omega]1 t], x[0] == 1}, {x}, {t, 0, 200}] Plot[Evaluate[x[t] /. sol1], {t, 0, 200}, PlotRange -> Full]

System of Chini ODE’s NDSolve in Mathematica:

pars = {a1 = 0.25, \[Omega]1 = 3, a2 = 0.2, \[Omega]2 = 4} sol2 = NDSolve[{x'[t] == (x[t]^4 + y[t]^4) a1 Sin[\[Omega]1 t] - a1 Cos[\[Omega]1 t], y'[t] == (x[t]^4 + y[t]^4) a2 Sin[\[Omega]2 t] - a2 Cos[\[Omega]2 t], x[0] == 1, y[0] == -1}, {x, y}, {t, 0, 250}] Plot[Evaluate[{x[t], y[t]} /. sol2], {t, 0, 250}, PlotRange -> Full]

There is no exact solution to these equations, therefore, the task is to obtain an approximate solution.

Using AsymptoticDSolveValue was ineffective, because the solution is not expanded anywhere except point 0.

The numerical solution contains a strong periodic component; moreover, it is necessary to evaluate the oscillation parameters. Earlier, we solved this problem with some users as numerically: Estimation of parameters of limit cycles for systems of high-order differential equations (n> = 3)

How to approximate the solution of the equation by the Fourier series so that it contains the parameters of the original differential equation in symbolic form, namely $$a_1$$, $$\omega_1$$, $$a_2$$ and $$\omega_2$$.

## Is this the correct “standard form” of nonlinear programming (optimization) problem and if it is why it’s in this form?

Rather a simple question I guess, though makes me wonder. The standard form I’ve found in the book (and on wiki) is something like this:

$$min f(x)$$

$$s.t.$$

$$h_i(x) = 0$$

$$g_i(x) <= 0$$

Is this considered a “standard form” for nonlinear optimization problems? And if it is why it’s defined like this? Why it has to be exactly the min of the function and why constraints have to be either equal or less than 0 or equal to 0? I couldn’t find any answer why it is as it is actually. Is there some important thing why it couldn’t be max actually for example?

## Complexity of numerical derivation for general nonlinear functions

In classical optimization literature numerical derivation of functions is often mentioned to be a computationally expensive step. For example Quasi-Newton methods are presented as a method to avoid the computation of first and/or second derivatives when these are “too expensive” to compute.

What are the state of the art approaches to computing derivatives, and what is their time complexity? If this is heavily problem-dependent, I am particularly interested in the computation of first and second order derivatives for Nonlinear Least Squares problems, specifically the part concerning first order derivatives (Jacobians).


text:
Structural properties of planar random heap of hard discs

Structural properties of planar random heap of hard discs - Descarga este documento en PDF. Documentación en PDF para descargar gratis. Disponible también para leer online.

Abstract : We study here numerically the average angle of repose θr and the packing fraction ρr of a random two dimensional heap of hard discs falling under gravity ballistically on a sticky base line, where the first layer of discs gets quenched in random positions. We find $\theta { m r}\cong52^\circ$ and $ho { m r}\cong0.80$ for such heaps. We also study the pressure or load distribution on the base line of such a random heap.

Autor: M. Acharyya

Fuente: https://hal.archives-ouvertes.fr/

DESCARGAR PDF


text:
# Memory

.

I have collected in this book memories extending over fifty years.

I am well aware that memory is unreliable.

It not only selects and rearranges that facts of our lives, but also embroiders and invents.

I have checked my version of facts wherever possible against other people’s memories and against written documents.

.

— Freeman Dyson’s Disturbing the Universe

.

.

.

2009.09.05 Saturday $ACHK$


text:
# Showing that $2$ of the following groups are not isomorphic

Exercise :

Given the following groups : $$\mathbb Z_{3^2} \times \mathbb Z_{5^2} \cong \mathbb Z_{225}$$ $$\mathbb Z_{3} \times \mathbb Z_{3} \times \mathbb Z_{5^2} \cong \mathbb Z_3 \times \mathbb Z_{75}$$ $$\mathbb Z_{3^2} \times \mathbb Z_{5} \times \mathbb Z_{5} \cong \mathbb Z_{45} \times \mathbb Z_5$$ $$\mathbb Z_{3} \times \mathbb Z_{3} \times \mathbb Z_{5} \times \mathbb Z_{5} \cong \mathbb Z_{15} \times \mathbb Z_{15}$$ show that $2$ of them are not isomorphic.

Attempt :

For the first of two that I have been asked to find, one can see that :

$$\mathbb Z_3 \times \mathbb Z_3 \times \mathbb Z_{5^2} \ncong \mathbb Z_3 \times \mathbb Z_3 \times \mathbb Z_5 \times \mathbb Z_5$$ since if this was an isomorphism, it's clear that the $\mathbb Z_3 \times \mathbb Z_3$ parts are isomorphic, which leads that it also should be $\mathbb Z_{5^2} \cong \mathbb Z_5 \times \mathbb Z_5$. This is not possible though, as this would imply that the group $\mathbb Z_5 \times \mathbb Z_5$ is cyclic, which is false.

Similar goes for the case :

$$\mathbb Z_{3^2} \times \mathbb Z_5 \times \mathbb Z_5 \ncong \mathbb Z_3 \times \mathbb Z_3 \times \mathbb Z_5 \times \mathbb Z_5$$

Is the above approach correct and complete ? Could it be phrased better if so ?

• How do you prove $\mathbf Z_5\times\mathbf Z_5$ is not cyclic? Does it result from a theorem you've learnt? – Bernard Jan 21 '18 at 14:06
• @Bernard Yes ! In order for the group $\mathbb Z_m \times \mathbb Z_n$ to be cyclic, it would need to be $\gcd(m,n) = 1$ which means that $m,n$ should be coprime. In that case though, $\gcd(5,5) = 5$ so it's not cyclic. – Rebellos Jan 21 '18 at 14:09
• But are you sure this is a necessary condition (it's true, but I wonder on which basis you're allowed to say so). – Bernard Jan 21 '18 at 14:14
• Actually, the simplest way is to show one of the rings has an element of a certain order and the other ring has not. For instance, the cyclic group $\mathbf Z_{225}$ has an element of order $225$, but none of the other has. – Bernard Jan 21 '18 at 14:22
• OK, you don't need to use this fact anyway. Just see them as groups. – Bernard Jan 21 '18 at 14:47

$\mathbb Z_{225}\cong \mathbb Z_{15^2}$ is not isomorphic to $\mathbb Z_{15} \times \mathbb Z_{15}$ since $(15, 15)\neq1$.


text: 2 added 225 characters in body edited Dec 3 '13 at 10:41 AlphaOmega 2922 bronze badges An area in statistics where this problem arises naturally is Approximate Bayesian Computation. What you actually want to do is to summarise the whole sample into "informative" statistics that can later be compared using a suitable metric: this problem is not trivial at all. I would even say that it is actually one of the "hot topics" in statistics. It is not that the method is not theoretical, it is just that there is not unique way of comparing two data sets. It usually depends on your aims and your model. If you have a model and can identify sufficient statistics for it, then, by comparing the sufficient statistics of both samples you can assess how different the information contained in each sample is. If they are very close, then the associated [likelihood functions] (http://en.wikipedia.org/wiki/Likelihood_function) would be similar, and therefore the inferences on the corresponding parameters would be similar as well. An area in statistics where this problem arises naturally is Approximate Bayesian Computation. What you actually want to do is to summarise the whole sample into "informative" statistics that can later be compared using a suitable metric: this problem is not trivial at all. I would even say that it is actually one of the "hot topics" in statistics. It is not that the method is not theoretical, it is just that there is not unique way of comparing two data sets. It usually depends on your aims and your model. If you have a model and can identify sufficient statistics, then, by comparing the sufficient statistics of both samples you can assess how different the information contained in each sample is. An area in statistics where this problem arises naturally is Approximate Bayesian Computation. What you actually want to do is to summarise the whole sample into "informative" statistics that can later be compared using a suitable metric: this problem is not trivial at all. I would even say that it is actually one of the "hot topics" in statistics. It is not that the method is not theoretical, it is just that there is not unique way of comparing two data sets. It usually depends on your aims and your model. If you have a model and can identify sufficient statistics for it, then, by comparing the sufficient statistics of both samples you can assess how different the information contained in each sample is. If they are very close, then the associated [likelihood functions] (http://en.wikipedia.org/wiki/Likelihood_function) would be similar, and therefore the inferences on the corresponding parameters would be similar as well. 1 answered Dec 3 '13 at 10:34 AlphaOmega 2922 bronze badges An area in statistics where this problem arises naturally is Approximate Bayesian Computation. What you actually want to do is to summarise the whole sample into "informative" statistics that can later be compared using a suitable metric: this problem is not trivial at all. I would even say that it is actually one of the "hot topics" in statistics. It is not that the method is not theoretical, it is just that there is not unique way of comparing two data sets. It usually depends on your aims and your model. If you have a model and can identify sufficient statistics, then, by comparing the sufficient statistics of both samples you can assess how different the information contained in each sample is.


text:
• Advertisement

# Just a simple 2D vector

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

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hi, I'm pretty new to C++, but an experienced AS programmer, and currently learning a lot about the ways C++ does things. I'm trying to make a simple 2D vector to save some classes in, but I can't seem to do it. Basically, I need multiple levels in which to save multiple classes and the amount of classes per level must be able to grow and shrink. To save just one level I would say like: vector<someclass*> classes(size); But then how do I make this into a 2D-vector? I know i need something like: vector<vector<someclass*>> With arrays it's pretty easy to do, but I don't get it yet when it comes to vectors. How do I do that? Thanks in advance.

#### Share this post

##### Share on other sites
Advertisement
vector<vector<some_type> > (note the space between trailing >'s).

#### Share this post

##### Share on other sites
Yes! I got it working. Thanks very much!
Hmm... a space...

#### Share this post

##### Share on other sites
I have another question and I hope this one's less stupid. I want to put the vector inside a class. I allready read I can't set the size inside the class itself, so I declared the size in the constructor for the class, just using the same syntax as normal for declaring a vector. Now, the class with the vector is inside another class (and I really hope I know how to do that).
The problem is that my vector still doesn't have a size as if it weren't set. So it either doesn't do my constructor (I just used: myclass someclass to declare the class) or the size isn't set the way I did it.
What am I doing wrong? Thanks in advance.

#### Share this post

##### Share on other sites
Should look something like this:
#include <vector>#include <iostream>class CInside{  public:    CInside() : mVector(20)    {    }    int Size()    {      return mVector.size();    }  private:    std::vector<int> mVector;};class COutside{  public:    COutside()    {    }    int Size()    {      return mInside.Size();    }  private:    CInside mInside;};int main(){  COutside Outside;  std::cout << Outside.Size();  return 0;}

Is there any major difference between your version and this?

#### Share this post

##### Share on other sites
Quote:
 Original post by IgnifexI have another question and I hope this one's less stupid. I want to put the vector inside a class. I allready read I can't set the size inside the class itself, so I declared the size in the constructor for the class, just using the same syntax as normal for declaring a vector. Now, the class with the vector is inside another class (and I really hope I know how to do that).The problem is that my vector still doesn't have a size as if it weren't set. So it either doesn't do my constructor (I just used: myclass someclass to declare the class) or the size isn't set the way I did it.What am I doing wrong? Thanks in advance.

If i understood what you where saying you mean't something like this (with 2D vectors):

#include <vector>struct containee {};class contained {public:   typedef std::vector< containee >  vec1D;   typedef std::vector< vec1D >      vec2D;   typedef vec2D::size_type          size_type;private:   vec2D matrix_of_containee;public:   contained(size_type rows = 0,             size_type cols = 0,             const containee& c = containee())   : matrix_of_containee(rows, vec1D(cols, c)) {}   //la-la-la};class someclass {   contained c;public:   typedef contained::size_type size_type;   someclass(size_type rows = 0,             size_type cols = 0,             const containee& c = containee())   : c(rows, cols, c) {}};

#### Share this post

##### Share on other sites
Ok Agony, I understand everything of your code, except this:
CInside() : mVector(20)
{
}
This is the declaration of the size of the vector, but I really don't recognise the syntax here. Just a single : ? And what are the bracelets for?
Thanks for your reply, I'll just try something like this.

<EDIT>
Ok I found this is the constructor.
But I need more in my constructor because the class uses other variables as well. Can I just set mVector(20) in my constructor?

Snk_kid, I don't really understand what your code does. What I see in a 2D-vector is simply a vector-a with some other vectors as every item in the vector-a.

#### Share this post

##### Share on other sites
Quote:
 Original post by IgnifexOk, I understand everything of your code, except this:CInside() : mVector(20) { }This is the declaration of the size of the vector

Yes but if your using a vector of vector of some type to make a matrix then you probably wont to set the size of coloums/rows aswell like in my above code.

Quote:
 Original post by Ignifex but I really don't recognise the syntax here. Just a single : ?

It's called a constructor intializer list, it's how you intialize members & base classes prorperly.

Quote:
 Original post by IgnifexOk I found this is the constructor.But I need more in my constructor because the class uses other variables as well. Can I just set mVector(20) in my constructor?

Intialize all your members in a intializer list.

#### Share this post

##### Share on other sites
Hmm ok thanks! It's all working properly again now.
Just one final question:
Why is the vector set outside the bracelets? Can't it also just be set inside of them?

#### Share this post

##### Share on other sites
Yeah, as snk_kid said, it's an initializer list. And it was an inlined constructor as well, but for a normal constructor, you can follow the function name and parameters by a colon, and then a comma separated list of constructors for your member objects, like this:
class CClass{  public:    CClass();    CClass(int AnInt, float AFloat);  private:    int mInt;    float mFloat;    std::vector<int> mVector1;    std::vector<float> mVector2;};CClass::CClass() : mInt(0), mFloat(0.0f), mVector1(0), mVector2(4, 0.0f){  //Any additional stuff}CClass::CClass(int AnInt, float AFloat) : mInt(AnInt), mFloat(AFloat), mVector1(AnInt), mVector2(AnInt, AFloat){  //Any additional stuff}

Also, like snk_kid said, I suppose you wouldn't be able to initialize the internal vector sizes without actually using code from within the constructor body itself, but you could still resize the outside vector (of vectors) to the proper size using the initializer list.

Also, just if you're curious, the reason vector<vector<int>> (without the spaces between the last two >s) doesn't work is because the compiler sees a shift operator (>>) instead of the two close brackets. The space makes it clear that it isn't a shift operator.

#### Share this post

##### Share on other sites
Quote:
 Original post by IgnifexWhy is the vector set outside the bracelets? Can't it also just be set inside of them?

Because intialization/construction is different from assigment even if the final result is the same, what i mean is this:
int i;i = 10;

is different from this:
int i(10);or int i = 10; //implicitly invokes constructor

all built-in types and standard library types in c++ have constructors to intialize instances.

The intializer list allows you to use the members constructors to intialize a type's members.

EDIT: with assignment the variable may have had a previous value

#### Share this post

##### Share on other sites
Quote:
 Original post by IgnifexJust one final question:Why is the vector set outside the bracelets? Can't it also just be set inside of them?
Initializer lists are more efficient in some cases. In most cases, it's trivial, but sometimes, you could cause a major performance loss by not using an initializer list. Basically, if you have a class that has a complex default constructor as a member, then when you construct the outer class, the inner member class's default constructor will get called, which could take a while. Then, after doing the default construction, you might do other stuff that member object that takes more time. With an initializer list, however, the default constructor isn't used, and it skips to initializing it precisely how it needs to be. Consider this example:
class CInside{  public:    CInside(const std::string& FileName = "Default.dat");    void GetFileData(const std::string& FileName);  private:    std::vector<char> mData;};CInside::CInside(const std::string& FileName){  GetFileData(FileName);}void CInside::GetFileData(const std::string& FileName){  //Open file, and read in all data into mData, then close file}class COutside{  public:    COutside(const std::string& FileName);  private:    CInside mInside;};COutside::COutside(const std::string& FileName){  mInside.GetFileData(FileName);}
What will happen here is that when you create a COutside object, the mInside member will get its default constructor called, thus opening "Default.dat" and reading all the data in. This could take a while if it is a large file. Then, immediately after doing all that, the COutside constructor calls GetFileData(), and another file is opened and read. Twice as much work done, when it isn't needed. If you change the COutside constructor to this, though:
COutside::COutside(const std::string& FileName) : mInside(FileName){}
then it will call mInside's constructor with the proper filename, and totally skips the default step. More efficient.

#### Share this post

##### Share on other sites
Thanks Agony/snk_kid, you're both really great!
To Agony:
second point: Yes, I allready realised that, but since the vectors inside the vectors are supposed to start at size 0, that's no problem at all.
third point: So that's why! I should've figured that one out myself. I hardly use < and > operators, so I'm no used to their combination together. Thanks for the explanation here.
To snk_kid:
Ok, right. It all makes sense to me now. Thanks again.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### Popular Tags

• Advertisement
• ### Popular Now

• 26
• 11
• 17
• 11
• 13
• Advertisement


text:
# Why did my book write S2- if hydrogen sulfide isn't ionic?

Problem:

Balance the following reaction using the ion-electron method:

$$\ce{KMnO4 + H2SO4 + H2S -> MnSO4 + S + K2SO4 +H2O}$$

My book's solution:

Oxidation half-reaction:

$$\ce{S^{2-}->S + 2e^{-}}\tag{1}$$

$$...$$

My question:

1. Is writing $$(1)$$ correct? I'm asking this because $$\ce{H2S}$$ is not an ionic compound. How can my book write $$\ce{S^2-}$$ then?
• Your book is wrong. And you are right. In acidic solution $\ce{H2S}$ is not dissociated, and not deprotonized. It reacts as $\ce{H2S}$. Anyway the ion $\ce{S^{2-}}$ is nearly inexistant even in rather basic solution. The main ion produced by $\ce{H2S}$ in basic solution is $\ce{HS-}$ May 10 at 16:18

$$\ce{H2S -> S +2H^+ + 2e^-}.$$
$$\ce{5 H2S + 2 MnO4^- + 6H^+ -> 5 S + 2 Mn^{2+} + 8 H2O,}$$
where the net hydrogen ions on the left side are interpreted as coming from the sulfuric acid (which is not oxidized or reduced, so does not appear directly in the half-equations). You should then infer that the balanced ratio of reactants is $$\ce{5H2S:2KMnO4:3H2SO4}$$.


text:
# 5 Suppose that a simple economy has the following parameters. C = 200+0.5Y 1 = 200...

###### Question:

5 Suppose that a simple economy has the following parameters. C = 200+0.5Y 1 = 200 a. Complete the following table. 0 100 200 300 400 500 600 700 800 900 1.000 b. The value of expenditures equilibrium Is SL 800 c. At the expenditures equilibrium, the value of Injections is $200 and the value of leakages is$ 200

#### Similar Solved Questions

##### A 30.0-g object connected to a spring with a force constant of 25.0 N/m oscillates with...
A 30.0-g object connected to a spring with a force constant of 25.0 N/m oscillates with an amplitude of 4.00 cm on a frictionless, horizontal surface. (a) Find the total energy of the system. mJ (b) Find the speed of the object when its position is 1.15 cm. (Let 0 cm be the position of equilibrium....
##### 3. An article in Fortune magazine reported on the rapid rise of fees and expenses charged...
3. An article in Fortune magazine reported on the rapid rise of fees and expenses charged by mutual funds. Assuming that stock fund expenses and municipal bond fund expenses are each approximately normally distributed, suppose a random sample of 12 stock funds gives a mean annual expense of 1.63 per...
##### Calculate the rate constant at 25 degrees celsius for a reaction that has a rate constant...
calculate the rate constant at 25 degrees celsius for a reaction that has a rate constant of 5.5x10^-5 s^-1 at 100 degrees celsius and an activation energy of 40.0 KJ/mol...
##### How do you solve |\frac { 3x - 6} { 4} | < 9?
How do you solve |\frac { 3x - 6} { 4} | < 9?...
##### Considering the formation of CH4 from the following process C(s) +2H2(g)-CH4(g). show that the standard chemical...
Considering the formation of CH4 from the following process C(s) +2H2(g)-CH4(g). show that the standard chemical potential of methane (i.e. molar Gibbs free energy of formation) is 50.7 kJ mol1 at 298.15 K based on the literature values of entropy and enthalpy of the species involved....
##### List common causes of fluid volume deficit and fluid volume overload. In a chart format, provide...
List common causes of fluid volume deficit and fluid volume overload. In a chart format, provide the assessment findings that constitute a patient with Fluid deficit (hypovolemia) vs. Fluid overload (hypervolemia). What health challenges does your patient face? (Please give more than one). - (This ...
The computer workstation furniture manufacturing that Santana Rey started in January is progressing well. As of the end of June, Business Solutions's job cost sheets show the following total costs accumulated on three furniture jobs. Job 602 $1,300 Direct materials Direct labor Job 603$3,100 1,...


text:
Unit Cell Video Lessons

Concept

# Problem: In solid KCl the smallest distance between the centers of a potassium ion and a chloride ion is 314 pm. Calculate the length of the edge of the unit cell and the density of KCl, assuming it has the same structure as sodium chloride.

###### FREE Expert Solution

Sodium chloride is face-centered cubic unit cell. Recall that a Face-Centered Cubic (FCC) unit cell has 4 atoms per unit cell.

And the formula for the edge length (a) of FCC unit cell:

Since the given is the distance between the center of potassium ion and chloride ion (not only the radius of one ion), the equation becomes:

88% (442 ratings)
###### Problem Details

In solid KCl the smallest distance between the centers of a potassium ion and a chloride ion is 314 pm. Calculate the length of the edge of the unit cell and the density of KCl, assuming it has the same structure as sodium chloride.


text:
# condition for minimum attenuation

The attenuation constant $\alpha$ of a transmission line  is

$\alpha&space;=\sqrt{\frac{(RG-\omega&space;^{2}LC)+\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}{2}}-----EQN(1)$

$\alpha$ depends up on the  4 primary constants  along with frequency $\omega$. In order to achieve the minimum attenuation , these primary constants should be varied in turn.

case 1:-

consider the  case where the attenuation ($\alpha$ )  variation depends only on Inductance(L) .

i.e by considering R, G , C and $\omega$ as constants

from EQN(1), $2\alpha&space;^{2}&space;=(RG-\omega&space;^{2}LC)+\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}$

differentiating the above equation w.r. to L

$\therefore&space;4\alpha&space;\frac{d\alpha&space;}{dL}&space;=&space;-\omega&space;^{2}C&space;+&space;\frac{2L(\omega&space;^{2}G^{2}+\omega&space;^{4}C^{2})}{2&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}$.

$4\alpha&space;\frac{d\alpha&space;}{dL}&space;=\frac{-\omega&space;^{2}C&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}+\omega&space;^{2}L(G^{2}+\omega&space;^{2}C^{2})}{\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}$.

$\frac{d\alpha&space;}{dL}&space;=\frac{-\omega&space;^{2}C&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}+\omega&space;^{2}L(G^{2}+\omega&space;^{2}C^{2})}{4\alpha\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}$.

now      $\frac{d\alpha&space;}{dL}=0$.

$-\omega&space;^{2}C&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}+\omega&space;^{2}L(G^{2}+\omega&space;^{2}C^{2})=0$.

$\omega&space;^{2}C&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}=\omega&space;^{2}L(G^{2}+\omega&space;^{2}C^{2})$.

$C&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})}=L\sqrt{(G^{2}+\omega&space;^{2}C^{2})}$.

$C&space;(R^{2}+\omega&space;^{2}L^{2})=L(G^{2}+\omega&space;^{2}C^{2})$.

$\Rightarrow&space;LG=RC$.

$\therefore&space;L=\frac{RC}{G}$  H/m.

The condition for L to get minimum attenuation is   $\frac{RC}{G}$  H/m but in general L should be maintained at  less than this value.

case 2:-

consider the  case where the attenuation ($\alpha$ )  variation depends only on Capacitance(C) .

i.e by considering R, L, G and $\omega$ as constants

from EQN(1), $2\alpha&space;^{2}&space;=(RG-\omega&space;^{2}LC)+\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}$

differentiating the above equation w.r. to L

$\therefore&space;4\alpha&space;\frac{d\alpha&space;}{dL}&space;=&space;-\omega&space;^{2}L&space;+&space;\frac{2C(\omega&space;^{2}R^{2}+\omega&space;^{4}L^{2})}{2&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}$.

$4\alpha&space;\frac{d\alpha&space;}{dL}&space;=\frac{-\omega&space;^{2}L&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}+\omega&space;^{2}C(R^{2}+\omega&space;^{2}L^{2})}{\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}$.

$\frac{d\alpha&space;}{dL}&space;=\frac{-\omega&space;^{2}L&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}+\omega&space;^{2}C(R^{2}+\omega&space;^{2}L^{2})}{4\alpha\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}}$.

now      $\frac{d\alpha&space;}{dL}=0$.

$-\omega&space;^{2}L&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}+\omega&space;^{2}C(R^{2}+\omega&space;^{2}L^{2})=0$.

$\omega&space;^{2}L&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})(G^{2}+\omega&space;^{2}C^{2})}=\omega&space;^{2}C(R^{2}+\omega&space;^{2}L^{2})$.

$C&space;\sqrt{(R^{2}+\omega&space;^{2}L^{2})}=L\sqrt{(G^{2}+\omega&space;^{2}C^{2})}$.

$C&space;(R^{2}+\omega&space;^{2}L^{2})=L(G^{2}+\omega&space;^{2}C^{2})$.

$\Rightarrow&space;LG=RC$.

$\therefore&space;C=\frac{LG}{R}$ F/m.

The condition for C to get minimum attenuation is  $\frac{LG}{R}$  F/m but in general C should be maintained at  more  than this value.

## Author: vikramarka

Completed M.Tech in Digital Electronics and Communication Systems and currently working as a faculty.


text:
# Find all additive real valued functions such that $f(x^{2019})=f(x)^{2019}$

Find all the functions $$f:\mathbb{R}\rightarrow \mathbb{R}$$ such that $$f(x+y)=f(x)+f(y) \; \; \; \forall \,x,y\in \mathbb{R}$$ and also (this is the important part) $$f(x^{2019})=f(x)^{2019}\tag{*}$$

My idea is to prove that $$f(x)=x \; \; \forall x \in \mathbb{R}$$, $$f(x)=-x \; \; \forall x \in \mathbb{R}$$ or $$f\equiv 0$$.

If we change $$2019$$ for an even number this is easy because it implies that the image of a positive number is positive and from there $$f$$ is linear and hence the identity or zero.

If we change $$2019$$ by $$3$$ then this is related (although I don't know how to deal with the case $$f(1)=0$$ or $$f(1)=-1$$)

But in this case I don't know how to prove any type of regularity from $$(*)$$ to conclude that $$f$$ must be linear.

• You have tagged this as "contest-math". Can you please provide a link to the contest that this problem comes from? – Xander Henderson Aug 16 '19 at 19:14
• @XanderHenderson Oh sorry, but I don't know if it comes from a contest. My source is that it is problem 10 of the proposed problems of this blog entry how-did-i-get-here.com/61 – A123 Aug 16 '19 at 19:51
• I have edited your question to include the link (in the future, you should provide such references yourself---these provide valuable context). Given that this problem is not from a contest, is there any particular reason that you have chosen to tag it as a contest problem? – Xander Henderson Aug 16 '19 at 23:29
• @XanderHenderson Similar problems (e.g. replacing 2019) have appeared as training exercises before. I can't link one off the top of my head, but I think the tag is perfectly fine here, even if it does not come from an explicit contest. – user574848 Aug 17 '19 at 0:35

Let $$f$$ satisfy the premises. Then $$f(ax)=af(x)$$ for any $$x\in\mathbb{R}$$ and $$a\in\mathbb{Q}$$. Now $$f\big((a+x)^{2019}\big)=f(a+x)^{2019}$$ (with both sides expanded using the binomial formula and the above), being a polynomial identity in $$a\in\mathbb{Q}$$, implies $$f(x^k)=f(1)^{2019-k}f(x)^k\qquad(0\leqslant k\leqslant 2019).$$ Taking $$k=2$$, we get $$f(x^2)=f(1)f(x)^2$$. This reduces to the case you have worked out (after replacing $$f$$ by $$-f$$ if needed).

• That's really cool, thanks!! – A123 Aug 16 '19 at 21:33
• @metamorphy I still seem to be missing something. Why cannot $f$ satisfy something like e.g., $f(e)=e^2$? [where $e$ is the base of the natural logarithm]. – Mike Aug 17 '19 at 1:53
• @Mike If $f(x+y)=f(x)+f(y)$ and $x\geqslant 0\implies f(x)\geqslant 0$, then $f$ is (necessarily) linear. The Wikipedia article suggests this as an easy consequence of the fact that nonlinear solutions must have graphs (everywhere) dense in $\mathbb{R}^2$. – metamorphy Aug 17 '19 at 9:07
• I think I see it now: the condition $f(x^2)=f(1)(f(x)^2$ implies that for all positive $y$, the sign of $f(y)$ has to be the same as the sign of $f(1)$. Which implies that there is at least one quadrant of $\mathbb{R}^2$ not covered by the graph of $f$, which implies (via the reasoning in the link you posted) that $f$ has to be linear. Thank you for explaining @metamorphy ! – Mike Aug 17 '19 at 16:01

The first equation is Cauchy's functional equation, and hence the existence of nonlinear solutions depends on the axiom of choice.

If we assume that $$f$$ is linear, then it must be of the form $$f(x)=ax$$ for some $$a \in \mathbb{R}$$. The second equation then says that $$\forall x \in \mathbb{R} (ax)^{2019} = ax^{2019}$$. Setting $$x=1$$, it follows that $$a$$ must be its own 2019th power. The only real numbers that are their own 2019th (or nth for any odd $$n>1$$) powers are $$0$$, $$1$$, and $$-1$$. Hence, the three linear solutions are $$f(x)=0$$, $$f(x)=x$$, and $$f(x)=-x$$.

If instead of considering solutions over $$\mathbb{R}$$, we had considered solutions over $$\mathbb{C}$$, then there would be 2016 more linear solutions, with one corresponding to each non-real 2018th root of unity.

For nonlinear solutions (assuming AC), we don't know.

We can prove that $$f$$ is continuous at $$\mathbb{R}$$. Furthermore $$f$$ has the first derivative on $$(0, 0)$$. Using these properties leads to show that $$f(x) = x$$ for every $$x \in \mathbb{R}$$ or $$f \equiv 0$$.

• Can you please show the continuity? – Virtuoz Aug 16 '19 at 18:49
• I agree that there is more work to be done. If $f$ were a function on $\mathbb{Q}$ instead of $\mathbb{R}$ then this would be much easier. But e.g., just because one has $f(e)$ does not mean that one has $f(e^2)$. – Mike Aug 16 '19 at 19:48
• For example, let $X$ be the subset of $\mathbb{R}$ of the form $\{a +be+ce^2\}$; $a,b,c \in \mathbb{Q}$. Consider $f$ defined as follows: $f(1)=1$; $f(e)=0$; $f(e^2)=100000$. Then this could be extended to an additive real-valued function on $X$. Now there may very well be "something else" happening for the entire real line $\mathbb{R}$ but if so what is it. – Mike Aug 16 '19 at 19:51


text:
Inspired by Michael Mendrin

Calculus Level 5

A rectangle's base lie on the $$x$$-axis while it's top corners are on the curve $$\displaystyle y =\dfrac{x}{x^2 + 1}$$. Now a cylinder is obtained by revolving Rectangle about x-axis, if the maximum volume of cylinder is $$V_{max}$$. Find $$\displaystyle \lfloor 1000V_{max} \rfloor$$.

Inspired by this awesome problem

×


text:
Classifying functors of abelian categories - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-21T12:34:40Z http://mathoverflow.net/feeds/question/38793 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/38793/classifying-functors-of-abelian-categories Classifying functors of abelian categories Martin Brandenburg 2010-09-15T08:21:45Z 2010-09-16T13:46:06Z
Let $AbCat$ denote the $2$-category of abelian categories with additive functors. Is the forgetful functor $AbCat \to Cat$ representable; i.e. is there an abelian category $T$ such that for every abelian category $A$, the category $Hom(T,A)$ is naturally isomorphic to (the category underlying) $A$?

This would be nice, because then it is possible to reconstruct an abelian category which has only a universal property.

I try to work out the structure of $T$: The isomorphism $Hom(T,T) \cong T$ maps $1_T$ to some object $x \in T$. If $A$ is arbitrary, then the isomorphism $Hom(T,A) \cong A$ is given by mapping a functor $F : T \to A$ to $F(x)$ and mapping a natural transformation $\eta : F \Rightarrow G$ to the morphism $\eta(x) : F(x) \to G(x)$.

Let $T'$ be the smallest full abelian subcategory of $T$, which contains $x$ (Existence: Construct inductively subcategories $T_{n+3k}$, which contain direct sums $(n=0)$, kernels $(n=1)$ and cokernels $(n=2)$ from $T_{n+3k-1}$.). Then $T'$ has the same universal property as $T$. Thus $T'=T$, and we see that $T$ is generated by $x$. Now we have to find such a $T$, which has no additional relations. In particular, we have to ensure that a natural transformation between additive functors on $T$ is determined by the morphism at $x$, although the functors don't have to be exact.
 http://mathoverflow.net/questions/38793/classifying-functors-of-abelian-categories/38963#38963 Answer by Laurent Moret-Bailly for Classifying functors of abelian categories Laurent Moret-Bailly 2010-09-16T12:17:25Z 2010-09-16T13:46:06Z
If we require an isomorphism (as opposed to an equivalence) the answer is no, for reasons having little to do with the (interesting aspect of) the question.

Assume there exists an abelian category $T$ and an object $x$ of $T$ such that for every abelian category $A$ and object $a$ there is a unique functor $F_a:T\to A$ sending $x$ to $a$. Clearly, $x$ is nonzero, so the object $x^2$ has a nontrivial automorphism $\sigma$. Consider the functor $\Phi:T\to T$ defined as follows:

$\Phi$=identity on objects,

for a map $f:u\to v$, put:

$\Phi(f)=f$ if $u\neq x^2\neq v$ or $u=x^2=v$,

$\Phi(f)=\sigma f$ if $u\neq x^2$ and $v=x^2$,

$\Phi(f)=f\sigma^{-1}$ if $u=x^2$ and $v\neq x^2$.

Now $\Phi$ is indeed a functor (case-by-case inspection) sending $x$ to $x$. So it should be equal to the identity functor but isn't.


text:
To the Editor.

Minocycline, a synthetic derivative of tetracycline, is the most widely prescribed oral systemic antibiotic for acne vulgaris because it does not appear to induce resistance in Propionobacterium acnes and can be administered only once or twice a day. Interestingly, minocycline is lipophilic and penetrates the blood-brain barrier more readily than other tetracyclines, thus attaining higher cerebrospinal fluid (CSF) levels. Despite its widespread use among adolescents, it does not appear that adequate prospective studies have been published to investigate its specific effects on the maturing teenager.

Recent personal experience allowed for more careful study of the effects of minocycline. Specifically, our then 12$912$-year-old son initiated minocycline (100 mg twice a day) by mouth for the treatment of moderately severe acne. Four weeks later, he was examined by a senior pediatric ophthalmologist for his annual assessment of myopia. An entirely normal examination (including pupil dilation and...


text:
# math

1. What is the first step to evaluate this expression? 73 – 4 • 3 + 8 (1 point)
exponent
subtraction
multiplication*
addition
2. Simplify 2 + (5 × 4 + 3). (1 point)
31*
25
37
43
3. Which shows the product of a number n and 12? (1 point)
n – 12
n over twelve
12n*
n + 12
4. Simplify 14 – 3 • 4 ÷ 6 (1 point)
14
12*
6
3
5. Simplify 6 • 3 ÷ 3 – 1 (1 point)
2
3*
5
6

1. 👍
2. 👎
3. 👁
4. ℹ
5. 🚩
1. correct my answers pls :)

1. 👍
2. 👎
3. ℹ
4. 🚩
2. 1. yes
2. 2 + 23 = ?????

1. 👍
2. 👎
3. ℹ
4. 🚩
👤
Damon
3. 3. yes
4. yes
5. 6 • 3 ÷ 3 – 1 = 18 ÷ 3 - 1 = 6 - 1 = 5

1. 👍
2. 👎
3. ℹ
4. 🚩
👤
Damon
4. i thought u said it’s multiplication 🤦🏽♂

1. 👍
2. 👎
3. ℹ
4. 🚩

## Similar Questions

1. ### Math PIZZAZZZ

how does a rodeo star get around?? well if you cant give me an answer can you help me. heres the instructions First Simplify the expression below. Then evaluate the expression for the given value or the variable. Find the

2. ### math

a)simplify the expression and explain each step 4(3x+2)-2 b)Factor the expression below 20b-16 help please

3. ### math

Consider the sequence of steps to solve the equation: 2(x − 4) + 6x = 9x − 10 Which step in solving this equation is justified by the Commutative Property of Addition? Given ⇒ 2(x − 4) + 6x = 9x − 10 Step 1 ⇒ 2x − 8

4. ### Math

Exploring Two-Step Equations Practice Evaluate the expression for the given value of the variable. 1. 8q + 6; q = 2 (1 point) 10 14 20 22

1. ### math *functions*

Find the first four terms of the sequence represented by the expression. n(n-1)-5 Pls just write down a step by step process of what to do, dont just give me the answer

2. ### math

Consider the sequence of steps to solve the equation: 5(x - 3) = 7x 2 Step 1 ⇒ 10(x - 3) = 7x Step 2 ⇒ 10x - 30 = 7x Step 3 ⇒ 3x - 30 = 0 Step 4 ⇒ 3x = 30 Step 5 ⇒ x = 10 Identify the property of equality which yields

3. ### algebra

I need a step by step explanation/ answer plzzz Simplify the following radical expression sqrt 72x^13y^11/8xy^13

4. ### trigonometry

Evaluate the following expression. Your answer must be in exact form: for example, type pi/6 for π6 or DNE if the expression is undefined. arctan(tan(−31π6))

1. ### Quick math help

In which step below does a mistake first appear in simplifying the expression? 0.5(-12c+6)-3(c+4)+10(c-5) Step 1: -6c+3-3(c+4)+10(c-5) Step 2: -6c+3-3c-12+10(c-5) Step 3: -6c+3-3c-12+10c-50 Step 4: 7c-41 Please help me!!! Thank

2. ### algebra

Let X be a number. Translate the English phrase or sentence into a mathematical expression. Then evaluate the expression for X =8. The expression is ?

3. ### algebra

help me please im confused Consider the quadratic expression X^2 + 4x + c = 0. For what range of values does the equation have two complex roots? what am i doing here can someone show me step by step so i can at least try to do

4. ### MATH plz help

what is the first step to evaluate this expression? 7^3 - 4 * 3 + 8 A. Exponent B. Subtraction C. Multiplication D. Addition