text:
# convergence of $\sum_{k=1}^\infty \sin^2(\frac 1 k)$

convergence of $\sum_{k=1}^\infty \sin^2(\frac 1 k)$

How can I do this? Should I use the Ratio Test (I tried this but it started getting complicated so I stopped)? Or the Comparison test(what should I compare it to?)?

• Comparison or Limit comparison with $\sum \frac{1}{k^2}$. The Ratio Test won't work, the convergence of the terms to $0$ is too slow for that. Jul 12 '15 at 1:25

Comparison: $\displaystyle \left(\sin \frac 1 k \right)^2 < \left( \frac 1 k \right)^2$.

• How did you derive that inequality? Jul 12 '15 at 1:27
• For $x\in (0,\pi/2)$, define $g(x)=x-\sin x$. Then, we have $g'(x)=1-\cos x >0$ for every $x$ in that interval. That means that the function is strictly increasing, and $g(0)=0$, so we have $x-\sin x>0 \implies \sin x<x$. Note that $1/k < \pi/2$ for every $k\geq 1$. Jul 12 '15 at 1:35
• @TanMath : Notice that $\sin'(0)=1$ but $\sin'x = \cos x<1$ for $0<x\le1$. The mean value theorem says $\Big( \sin x - \sin 0\Big)/\Big(x-0\Big) = \sin' c = \cos c < 1$ for some $c$ between $0$ and $x$. Hence $\sin x \cdot \cos c = x$, so $\sin x < x$. (This assumes $x>0$, since multiplying both sides by $x$ would otherwise require changing "$<$" to "$>$". That is a rigorous solution, but you should also know another approach: Think about what the graph of sine function looks like, with its slope of $1$ at $x=0$, and what the line $y=x$ looks like. That should tell you${}\,\ldots\qquad{}$ Jul 12 '15 at 1:35
• $\ldots\,{}$that the curve lies below the line, so $\sin x<x$ whenever $x>0$. Your understanding of the sine-in-radians function is incomplete if you haven't got that. ${}\qquad{}$ Jul 12 '15 at 1:36
• So $x=1/k$. When I say $\sin x<x$ whenever $x>0$, that's saying something about ALL positive numbers. And $1/k$ is a positive number. Whatever applies to ALL positive numbers applies to $1/k$. ${}\qquad{}$ Jul 12 '15 at 1:40

With equivalents: $\sin^2\dfrac1k\sim_\infty \dfrac1{k^2}$. The series $\displaystyle\sum\dfrac1{k^2}$ converges absolutely, hence $\displaystyle\sum\sin^2\dfrac1k$ converges absolutely.

I recall $f(x)\sim_\infty g(x)$, for two functions defined in a neighbourhood of $\infty$ roughly means $$\lim_{x\to\infty}\frac{f(x)}{g(x)}=1$$ To take into account that $g(x)$ can be equal to $0$, there is a technical definition: $$f(x)-g(x)=_{\infty}o\bigl(g(x)\bigr),$$ which is equivalent to the previous definition in case $g(x)\neq 0$ in some neighbourhood of $\infty$.

• I think you ought to say what $\sim_\infty$ means when posting something like this. Is this the same as limit comparison? ${}\qquad{}$ Jul 12 '15 at 1:52
• Don't you think it's clear from emphasising the word ‘equivalent’? Jul 12 '15 at 2:03
• No. There are many equivalence relations. ${}\qquad{}$ Jul 12 '15 at 2:05
• OK, I'll dot it. Buts as far as I know there is only one sense for the noun ‘equivalent’ Jul 12 '15 at 2:07
• There are certainly many senses of the word "equivalent". ${}\qquad{}$ Jul 12 '15 at 12:11

format: plain


text:
# Output the list of musical notes

This task is simple: Write a program or function that outputs the list of all musical notes (using English note names) from A♭ to G♯.

All notes without a name consisting of a single letter (i.e. black notes on a musical keyboard) should have their name printed twice, once as the sharp of a note, once as the flat of one. Sharp or flat notes that can be described with a single letter, like B♯ (C) or F♭ (E) should not be outputted.

Here is an example of the output:

Ab, A, A#, Bb, B, C, C#, Db, D, D#, Eb, E, F, F#, Gb, G, G#

# Specifications

• The program or function must not take any input.

• The notes may be printed in any order, and in any list output permitted by our standard I/O rules

• The sharp and flat Unicode symbols (♯/♭) may be substituted with b and #

• As always, Standard loopholes are forbidden.

• As this is , the smallest program, in bytes, wins.

• related – Jonathan Allan Aug 14 at 22:32
• May we output "C " instead of "C"? – Arnauld Aug 14 at 22:55
• @Arnauld yes you may – TheOnlyMrCat Aug 14 at 23:04
• By the way, B# exists in music notation; it's for example in the key signature for the key of C#, where it serves as the leading tone. – Kaz Aug 14 at 23:39
• I don't know, it feels like Cb is missing here ;) – AJFaraday Aug 15 at 11:31

# Malbolge, 482370 353 bytes

R1: Removed commas inbetween (as not required by the challenge)

R2: Shave off a few bytes

('<;_#!=6Z|{8xUwvt,PrqonKmk)"FhCUTdb?+<;:[Z7YtVU2T|/g-O+i(gJrHc#EC~B{@zZxw:tt'r5Qo"!l/K-hUfe?bP_Lo~[}|X2VCTR3Q+N_^9+7Hji3ffdAc~w|u;]\wpon4VUSSQ.PONcb(JI^]#DCYX|@?>=<:u9NMRKo32MFj.C,Ae)>'<%:^"!~5:3WxwwuRts0q(Lnml)"Fhgfe"y?a_zyxq7YXWlUj0RgfkjMb(JI^c\[Z~BAV?T=Rv987Mq44310FEi-,G@)>b&%#"8=6Z{{yyw/Sut1*)('Km$k(!Efe{zyx>uz]r8ZXnm3TTih.PkNchg&HFF[DY}Az  Try it online! # CP-1610 assembly (Intellivision), 31 DECLEs1 = 39 bytes A routine taking an output pointer in R4 and writing the notes there, separated with spaces. In the example code, we write directly to the screen. ### Hex dump (routine only) 275 001 2BD 03C 048 1DB 2B8 012 044 2A9 2BA 108 078 201 003 262 261 263 2FA 008 37A 140 225 00B 089 22C 011 2B7 018 210 000  ### Full source  ROMW 10 ; use 10-bit ROM width ORG$4800           ; map this program at $4800 ;; ------------------------------------------------------------- ;; ;; test code ;; ;; ------------------------------------------------------------- ;; 4800 SDBD ; set up an interrupt service routine 4801 MVII #isr, R0 ; to do some minimal STIC initialization 4804 MVO R0,$100
4806            SWAP    R0
4807            MVO     R0,       $101 4809 EIS ; enable interrupts 480A MVII #$200,    R4    ; R4 = backtab pointer
480C            CALL    notes           ; invoke our routine

480F            DECR    R7              ; loop forever

;; ------------------------------------------------------------- ;;
;;  ISR                                                          ;;
;; ------------------------------------------------------------- ;;
isr       PROC

4810            MVO     R0,       $0020 ; enable display 4812 CLRR R0 4813 MVO R0,$0030 ; no horizontal delay
4815            MVO     R0,       $0031 ; no vertical delay 4817 MVO R0,$0032 ; no border extension
4819            MVII    #$D, R0 481B MVO R0,$0028 ; light-blue background
481D            MVO     R0,       $002C ; light-blue border 481F JR R5 ; return from ISR ENDP ;; ------------------------------------------------------------- ;; ;; routine ;; ;; ------------------------------------------------------------- ;; notes PROC 4820 PSHR R5 ; save return address 4821 SDBD ; R5 = pointer to @@chr 4822 MVII #@@chr, R5 4825 CLRR R3 ; R3 = 0 (space) 4826 MVII #$12,     R0    ; R0 = bitmask = $12 4828 SWAP R0, 2 ; extend it to$1212

4829  @@loop    MVI@    R5,       R1    ; R1 = next symbol
482A            MVII    #('A'-32)*8, R2 ; R2 = 'A' character

482C  @@note    SARC    R0              ; right shift the bitmask
482D            BC      @@next          ; skip this note if the carry is set

482F            MVO@    R2,       R4    ; append the note
4830            MVO@    R1,       R4    ; append the symbol
4831            MVO@    R3,       R4    ; append a space

4834            CMPI    #('H'-32)*8, R2 ; is it now a 'H'?
4836            BLT     @@note          ; if not, process the inner loop

4838            TSTR    R1              ; was the symbol a space?
4839            BNEQ    @@loop          ; if not, process the outer loop

483B            PULR    R7              ; return

483C  @@chr     DECLE   ('#'-32)*8      ; '#'
483D            DECLE   ('b'-32)*8      ; 'b'
483E            DECLE   0               ; space

ENDP

### Output

screenshot from jzIntv

1. A CP-1610 opcode is encoded with a 10-bit value, known as a 'DECLE'. This routine is 31 DECLEs long, starting at $4820 and ending at$483E (included).

# Python 3, 50 bytes

print(*map(''.join,zip(3*'ADGBCEF',7*' '+5*'#b')))

Try it online!

Python 2: 48 bytes

This code can be adjusted as to include B# and Cb, at the cost of no additional bytes. This can be achieved by replacing 5 with 6.

Additionally, it is (finally) shorter than just outputting the plain string:

# Python 3, 51 bytes

exit('Ab A A# Bb B C C# Db D D# Eb E F F# Gb G G#')

Try it online!

Python 2: 50 bytes

• This is a very creative solution – TheOnlyMrCat Aug 15 at 7:46

# 05AB1E, 1615 13 bytes

Au…b #âŽ7×bûÏ

-2 bytes thanks to @maxb.

Try it online.

Outputs as a list, where the single-char notes are with a trailing space.

Explanation:

Au             # Push the lowercase alphabet, and uppercase it
…b #         # Push string "b #"
â        # Take the cartesian product of both strings to create all possible pairs:
#  ["Ab","A ","A#","Bb","B ","B#",...,"Zb","Z ","Z#"]
Ž7×     # Push compressed integer 1999
b    # Convert it to a binary string "11111001111"
û   # Palindromize it to "111110011111110011111"
Ï  # Only leave the notes in the list at the truthy values (1), (the trailing
# items beyond the length of this binary string are also discarded)
# (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress large integers?) to understand why Ž7× is 1999.

Ž7× could alternatively be ₄·< (1000, double, decrease by 1) for the same byte-count.

• Is the 7£ really necessary? Seems to run fine without it. – maxb Aug 15 at 12:38

# Jelly, 18?* 20 bytes

ØAḣ7µp⁾b#Żs6ḣ€4ẎḊ;W€

* If a mixed list of (a) lists of characters and (b) characters is acceptable remove the trailing W€ for 18.

Try it online!

### How?

ØAḣ7µp⁾b#Żs6ḣ€4ẎḊ;W€ - Link: no argument
ØA                   - list of characters     [A-Z]
ḣ7                 - head to 7              "ABCDEFG"
⁾b#            - list of characters     "b#"
p               - Cartesian product      ["Ab","A#","Bb","B#","Cb","C#","Db","D#","Eb","E#","Fb","F#","Gb","G#"]
Ż           - prepend a zero       [0,"Ab","A#","Bb","B#","Cb","C#","Db","D#","Eb","E#","Fb","F#","Gb","G#"]
s6         - split into sixes    [[0,"Ab","A#","Bb","B#","Cb"],["C#","Db","D#","Eb","E#","Fb"],["F#","Gb","G#"]]
ḣ€4      - head each to 4      [[0,"Ab","A#","Bb"],["C#","Db","D#","Eb"],["F#","Gb","G#"]]
Ẏ     - tighten              [0,"Ab","A#","Bb","C#","Db","D#","Eb","F#","Gb","G#"]
Ḋ    - dequeue                ["Ab","A#","Bb","C#","Db","D#","Eb","F#","Gb","G#"]
W€ - wrap each (of X)       ["A","B","C","D","E","F","G"]
;   - concatenate            ["Ab","A#","Bb","C#","Db","D#","Eb","F#","Gb","G#","A","B","C","D","E","F","G"]

• @mirabilos this is 20 bytes of source code, the Unicode characters each represent a byte of the source code - see the code page linked by the word bytes in the header. – Jonathan Allan Aug 15 at 18:20

# Retina 0.8.2, 33 bytes

ABCDEFG
.
$&b$& $&# [BE]#...  Try it online! Explanation:  ABCDEFG  Insert the base note names. .$&b $&$&#

Expand each note to include flat and sharp versions.

 [BE]#...

Delete B#, E# and also the notes following them (Cb and Eb).

# Perl 6, 41 bytes

{S:g/[E|B]\#...//}o{'A'..'G'X~'b #'.comb}

Try it online!

Simple cross product of the notes and the sharps/flats, followed by removing the extra invalid notes. This is an anonymous code block that produces the string:

Ab A  A# Bb B   C  C# Db D  D# Eb E   F  F# Gb G  G#

# R, 50 bytes

cat("Ab,A,A#,Bb,B,C,C#,Db,D,D#,Eb,E,F,F#,Gb,G,G#")

Try it online!

# R, 60 bytes

cat(outer(LETTERS[1:7],c("#","","b"),paste0)[-c(2,5,17,20)])

Try it online!

• I think the list of examples of redundant notes isn't meant to be exhaustive--the example output also omits Cb and E#. – Unrelated String Aug 14 at 22:09

# Charcoal, 21 bytes

Φ⪪⭆…α⁷⭆b #⁺ιλ²§↨⊖⊘φ²κ

Try it online! Link is to verbose version of code. Explanation:

    α                   Predefined variable uppercase alphabet
… ⁷                  First 7 letters i.e. ABCEDFG
⭆                     Map over characters and join
b #              Literal string b #
⭆                 Map over characters and join
⁺ιλ           Concatenate outer and inner characters
⪪           ²          Split back into substrings of length 2
Φ                       Filter where nonzero
φ     Predefined variable 1000
⊘      Halved i.e. 500
⊖       Decremented i.e 499
↨   ²    Converted to base 2 i.e. [1, 1, 1, 1, 1, 0, 0, 1, 1]
§     κ   Cyclically indexed by outer index
Implicitly print matching values on separate lines

# Japt, 23 22 bytes

;B¯7
ï"b #" fÏÄ %9%8<6

Try it

;B          Alphabet
¯7        First seven characters ("ABCDEFG")
Assign to U
ï"b #"       Cartesian product with "b #" ("Ab,A ,A#,Bb,B ,B#,Cb,C ,C#,Db,D ,D#,Eb,E ,E#,Fb,F ,F#,Gb,G ,G#")
f           Filter:
ÏÄ           Is index + 1
%9%8       Mod 9 Mod 8
<6       Less than 6
End filter ("Ab,A ,A#,Bb,B ,C ,C#,Db,D ,D#,Eb,E ,F ,F#,Gb,G ,G#")

• Your code contains <6 but it's <5 in the explanation. – TheOnlyMrCat Aug 16 at 21:11
• @TheOnlyMrCat Edited – Embodiment of Ignorance Aug 16 at 22:35

# dzaima/APL REPL, 3828 25 bytes

(⊤2056111)⌿,' b#'∘.,⍨7↑⎕A

Try it online!

• I think that you can remove the ⎕←. – Erik the Outgolfer Aug 14 at 23:22
• @EriktheOutgolfer hmm yeah, if I switch to REPL – dzaima Aug 14 at 23:23
• Oh right, I forgot to count the {} LOL. – Erik the Outgolfer Aug 14 at 23:25

# Stax, 17 15 bytes

║♠+I▬┌ó£ΔφΔ╗╨Å

Run and debug it

Bonus program: print the fancy symbols

# Ruby, 43 bytes

p (2..18).map{|i|"FCGDAEB"[i%7]+"b #"[i/7]}

Try it online!

With the range 0..20 this would print an array containing all the flats, all the naturals and all the sharps. The undesired ones Fb Cb E# B# are omitted by using the range 2..18

The notes are printed out ordered according to https://en.wikipedia.org/wiki/Circle_of_fifths , or in other words ascending by 7 semitones (a frequency ratio of almost exactly 1.5) each time.

This leads to the note letter order given, in which each note is five degrees inclusive (known as a "fifth") above the previous one. For example F->C is FGABC

• I like that you ascend by fifths. Nice. – Wayne Conrad Aug 17 at 1:18

# brainfuck, 106 bytes

+++[[-<+>>++<]>]<<[-<->]++<<++<,+<-<[->+>+<<]<+[>>>>>+>-[<.<<<.>.[<]]>[>]<+[---<.<.<.[<]]>[>]<++<.<<.<<<-]

Try it online!

Outputs each note separated by carriage returns.

# Zsh, 36 bytes

<<<${${(F):-{A..G}{b,,#}}//[BE]#???}

An uglier solution, but it saves two characters. (F) joins a list on newlines, and //[BE]#??? removes the parts of the string we need.

Try it online!

## Zsh, 38 bytes

<<<${${:-{A..G}{b,,#}}:#([BE]#|[CF]b)}

I always enjoy it when Zsh beats Perl (hopefully I don't speak too soon...).

<<<${${:-{A..G}{b,,#}}:#([BE]#|[CF]b)}
${:- } # empty-fallback, basically an anonymous parameter expansion {A..G}{b,,#} # Cross product range A-G with b,(nothing),#${                 :#             }  # Remove matching elements
([BE]#|[CF]b)   # B#, E#, Cb, Fb
<<<                                     # Print to stdout

Try it online!

# Jelly, 21 bytes

ØAḣ7;p¥⁾b#“¿€×Ø‘œPẎẎ€

Try it online!

# Brachylog, 36 bytes

"#b"ẹ,Ẹ↺;Ṇh₇ᵗ↔{∋ᵐc}ᶠ⟨h₅ct₁₄⟩⟨h₁₂ct₅⟩

Try it online!

I'm currently in the process of brute-forcing the powerset index that would let me get rid of ⟨h₅ct₁₄⟩⟨h₁₂ct₅⟩ (and by extension ↺, since the output doesn't need to be in the same order as the example output), but it's taking quite a while... maybe I should put a minute aside to actually work out what order sublists are generated in, and compute the index that way...

# Canvas, 23 bytes

Ｚ７ｍ｛#＋¹¹b＋］｛“╷!↕„２┬²＠？Ｐ

Try it here!

22 bytes with extra newlines in the output

# PHP, 65 bytes

Makes the list with a loop. Items are separated by _ with a trailing separator.

for(;$l=ABCDEFG[$i++];)echo$l._.[$a="$l#_",$a.$b=$l.b_,$b][$i%3];

Try it online!

# PHP, 43 bytes

PHP outputs anything as is, when not inside <?php and ?> tags.

Ab,A,A#,Bb,B,C,C#,Db,D,D#,Eb,E,F,F#,Gb,G,G#

Try it online!

# Pyth, 23 21 bytes

s<R7c.>*<r1G7"b #"2 9

Try it online!

s<R7c.>*<r1G7"b #"2 9   Implicit: G=lowercase alphabet
r1G            Convert G to upper case
<   7           First 7 characters
*     "b #"      Cartesian product with "b #"
.>           2     Rotate the above 2 places to the right
c               9   Chop into pieces of length 9
<R7                    Trim each to length 7
s                       Flatten, implicit print

Edit: Partial rewrite to save 2 bytes, previous version: s%2c*<r1G7"b #"xLG"fhoq Try it online!

# Commodore C64/TheC64 Mini (probably other Commodore 8-bit BASIC variants) - 52 tokenized BASIC bytes

 0?"{CTRL+N}Ab A A# Bb B C C# Db D D# Eb E F F# Gb GG#

Pressing the CTRL key plus N on the C64 keyboard goes into 'business mode' on the character set for upper/lower case characters. We may print this out in a string in one byte / token; and as we have 40 columns, the space from G to G# is not required.

We do not need to close the string in this case as it is not a multi-statemented line with a : separator.

How this looks on a Commodore C64 (and compatibles) screen is shown below.

## Keg, 43 bytes

The string, compressed.

AbAA\#BbBCC\#DbDD\#EbEFF\#GbGG\#(:H<[ $]')'  TIO # APL (Dyalog Unicode), 45 bytes 2↓(,¨⎕A)⎕R', &'⊢'AbAA#BbBCC#DbDD#EbEFF#GbGG#'  Try it online! Simple ⎕Replace operation, prepending , to each element in the string that matches each letter in the ⎕Alphabet, then dropping the first 2 characters, which are ,. # Brainfuck, 214 Bytes >>>>++++++++[<++++<++++<++++++++++++<++++++++>>>>-]<<+++<++<+.>.>>.<<<.>>>.<<<.>>.>.<<<+.>.>>.<<<.>>>.<<<+.>>>.<<<.>>.>.<<<+.>.>>.<<<.>>>.<<<.>>.>.<<<+.>.>>.<<<.>>>.<<<+.>>>.<<<.>>.>.<<<+.>.>>.<<<.>>>.<<<.>>.>.<<<+  Try it Online! # JavaScript (Node.js), 84 bytes _=>[...'ABCDEFG'].map((n,i)=>${i%3!=2?n+'b,':''}${n}${i%3!=1?,${n}#:''}).join,  Try it online! Just returning the string (as shown below) would be shorter by 36 bytes, but where's the fun in that? _=>'Ab,A,A#,Bb,B,C,C#,Db,D,D#,Eb,E,F,F#,Gb,G,G#'  # brainfuck, 255 115 bytes --[----->+<]>-----[<+>>+>+<<-]>>+<<<-[->+++<]>+++[->>>+>+< <<<]>>>>--->+++++++[-<<<<.>.>>.<<<.>>>.<<<.>>.>.<<<+>>>>]  Try it online! • I would upvote this, but it's wrong. There's no black note between B and C, or between E and F. So you're not supposed to output. B#, Cb, E# or Fb. Also, I don't see anything in the spec about it being OK to use lowercase. – Level River St Aug 15 at 22:29 • @LevelRiverSt the challenge didn't state anywhere that we don't have notes between B and C & E and F – Krzysztof Szewczyk Aug 16 at 8:12 • All notes without a name consisting of a single letter (i.e. black notes on a musical keyboard) should have their name printed twice, once as the sharp of a note, once as the flat of one. Sharp or flat notes that can be described with a single letter, like B♯ (C) or F♭ (E) should not be outputted. That seems fairly clear to me, and I'm seeing no edit history on the OP on my screen. – Level River St Aug 16 at 19:53 # Bash 5, 42 bytes x=echo {A..G}{b,,#};echo${x//[BE]#???/}

Output:

Ab A A# Bb B C C# Db D D# Eb E F F# Gb G G#

# Perl 5, 47 41 bytes

say for'AbA#DbD#GbG#BbEbC#F#'=~/../g,A..G

Try it online!

# T-SQL, 124 bytes

SELECT value+a
FROM STRING_SPLIT('A-B-C-D-E-F-G','-')
,(VALUES('b'),(''),('#'))b(a)
WHERE value+a NOT IN ('B#','E#','Cb','Fb')

Line breaks are for display purposes only.

Longer but much more interesting than the trivial version (50 bytes):

PRINT'Ab,A,A#,Bb,B,C,C#,Db,D,D#,Eb,E,F,F#,Gb,G,G#'

# Z80Golf, 31 29 bytes

00000000: 9d5b dc6d df7f 0603 3e40 d13c cb3a 3008  .[.m....>@.<.:0.
00000010: fff5 7b2f ffaf fff1 20f1 10ec 76         ..{/.... ...v

Try it online!

Explanation:

Z80Golf is just a simple fantasy machine based on the Z80 8-bit CPU. The program is loaded at memory location 0x0000, and the rest of the memory is filled with zeroes. Output is done by calling 0x8000, which will output the value of register A as a character.

The program starts with the data that will be processed, 6 bytes in total. Each pair of bytes specifies a note suffix, and a bitmask controlling which of the letters can be combined with this note. To save bytes, the suffix character is inverted (xor 0xff) -- this allows the data to be executed as instructions with little side effects, making it possible to remove a jump that skips this data:

               ;    GFEDCBA
db 0xff^'b', 0b01011011 ; Ab Bb Db Eb Gb
db 0xff^'#', 0b01101101 ; A# C# D# F# G#
db 0xff^' ', 0b01111111 ; A  B  C  D  E  F  G
skip_data:

This is how the CPU decodes this:

    sbc a, l  ; a subtraction with carry on registers we don't care about
ld e, e   ; put the E register back into itself. This instruction is useless
; but still exists to make the encoding regular.
call c, 0xdf6d ; if the carry flag is set, call a function. The carry flag isn't set
; because of the initial register values (all zeroes) when the sbc above
; was executed
ld a, a   ; as above, put A back into itself.

This data is read two bytes at a time into the DE register pair. The stack pointer is used to point to the next element. It starts out at 0, and because the Z80 uses a full, descending stack, any pops will read the next data pair -- all stack operations are 16-bit.

The outer loop is implemented with a decrementing counter in the B register, for which the Z80 provides special support in the form of the djnz instruction:

    ld b, 3
process_pair:
...
djnz process_pair
halt

The current letter is held in the A register. Because the increment fits well at the start of the loop, we load one less than the actual start value of A:

process_pair:
ld a, 'A'-1
pop de ; D = bitmask, E = suffix character
process_note:
inc a
srl d ; put the current bitmask bit in the carry flag
; also sets the zero flag if this is the last note in the pair
jr nc, skip
; Print the note. Note that we need to preserve the zero flag to check it in the
; loop condition later.
rst $38 ; Short encoding of call$0038.
; Because the program is so short, the memory in the 0038..8000 range
; is filled with zeroes, which happens to be the encoding for a no-op.
; The execution will therefore fall-through to the character-print hook.
push af ; Save the letter on the stack (which will be just to the left of the
; unprocessed data) to free up A for printing other characters.
; (only 16-bit register pairs can be saved, so we also push the flags)
ld a, e
cpl     ; Undo the inversion used to make the execution fall-through the data.
; Done again each iteration because it takes less bytes to operate
; on the A register.
rst $38 ; Print the suffix. xor a ; Standard assembly practice of setting a register to zero by XORing it ; with itself. Saves a byte over a simple ld a, 0. rst$38 ; Print a null byte as a separator.
pop af  ; Restore the current letter from the stack.
skip:
jr nz, process_note ; If the zero flag (last changed at the srl d) is not set,
; loop once again
djnz process_pair
halt


text:
# Visualizing Percentiles of a Main Ping Exponential Histogram

GLAM is great if you want to check out the behaviour of a histogram over a large population across a curated set of dimensions, but what if you have a follow-up question that doesn't fit into its UI model? This tutorial will go into the guts of how to reproduce a GLAM-like view using sql.telemetry.mozilla.org (STMO), along with some suggestions on how to dig deeper.

This tutorial tries to build up an understanding and intuition of how things work on a low-level before it gets to its main act of reproducing GLAM. If you don't care about the details, you can probably skip the earlier sections in this document.

Assumptions:

## Setting the stage: tab spinners duration

For the purposes of this tutorial, let's look at a typical performance-oriented histogram: FX_TAB_SWITCH_SPINNER_VISIBLE_MS which we use to count the number of times a tab spinner appears after a switch tab operation in Firefox, along with the duration of its appearance in milliseconds (ms). This is an unwanted operation (especially if it's long), as it makes the browser appear unresponsive and confuses / disturbs users.

FX_TAB_SWITCH_SPINNER_VISIBLE_MS is what's called an exponential histogram: it represents an exponentially increasing distribution of values in each of its "buckets". It's probably easier to visualize this using the histogram viewer than describe:

This visualization above shows how a normal distribution would map into the buckets: you'll see that it skews towards the end: the point of the exponential histogram is to be sensitive to lower values (which one would assume would be more frequent, so long as the tab spinner doesn't come up too frequently!). Each "tick" represents the range of a bucket (in milliseconds): so we have a bucket representing values between 1ms and 2ms, 2ms and 3ms, and so on. You'll note that this distribution caps out at 1000: any values greater than or equal to this will wind up in this bucket but we won't know their value with any precision. For tracking values higher than this, a separate histogram (FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS) was created.

## Getting client-level data

Before we move on, let's do up a quick example of getting some client-level data using an SQL query, hopefully building up some intuition on how this stuff works on a low-level. From there, we can build up to aggregating it in interesting ways.

As of this writing, each main ping histogram is encoded as a JSON string inside the telemetry.main table inside BigQuery.

SELECT
FROM
telemetry.main_nightly -- Use telemetry.main_1pct for a 1% sample across channels
WHERE
sample_id = 42
AND normalized_channel = 'nightly' -- Only technically necessary if using telemetry.main or telemetry.main_1pct (see above)
AND DATE(submission_timestamp) = '2020-04-20'
LIMIT
3

Running this query on STMO, we get the following output:

histogram_json
{"bucket_count":20,"histogram_type":0,"sum":118,"range":[1,1000],"values":{"80":0,"115":1,"165":0}}
{"bucket_count":20,"histogram_type":0,"sum":19145,"range":[1,1000],"values":{"237":0,"340":1,"1000":1}}
{"bucket_count":20,"histogram_type":0,"sum":1996,"range":[1,1000],"values":{"698":0,"1000":1}}

In this representation, bucket_count and range represent the number of buckets and the range of possible values. histogram_type is an enumerated value that describes whether the histogram has linear, exponential, or categorical buckets; the values are defined in the Firefox source code. values represents the number of instances in each of the buckets while sum represents the sum total of all histogram values recorded. Note how the first column has one bucket with no elements in it (the "165" bucket), this is because Firefox adds a zero-count bucket on the left and right edges of the data (unless that would be one of the extremes and that bucket already has a count in it, as is the case for the "1000" bucket in the last two examples).

In general, it is best not to rely on this representation of the histogram in production code (it is quite likely to change in the future). Instead, use the mozfun.hist.extract user-defined-function (UDF) and extract out the fields you need: for example, to just get the sum for all the histograms above, you could modify the query above to something like:

WITH intermediate AS (
SELECT
FROM
telemetry.main_nightly -- Use telemetry.main_1pct for a 1% sample across channels
WHERE
sample_id = 42
AND normalized_channel = 'nightly' -- Only technically necessary if using telemetry.main or telemetry.main_1pct (see above)
AND DATE(submission_timestamp) = '2020-04-20'
LIMIT
3
)
SELECT
histogram.sum,
histogram.bucket_count
FROM
intermediate;

Which yields:

sumbucket_count
11820
1914520
199620

Note that these are the same values in the JSON histogram above.

Obviously this by itself is not particularly useful or meaningful - generally we are interested in aggregate behaviour across a larger set of clients. Let's look at how we might get that.

## Getting percentiles from a set of histograms

Often, questions around histograms are framed as "what's the 99th percentile?" -- that is, what is the maximum value that 99% of users experience: this helps give perspective on data which may have a number of weird outliers (a.k.a the Bill Gates walks into a bar and everyone inside becomes a millionaire effect). Let's take an initial stab of grabbing some percentiles of the data we were looking at earlier using the mozfun.hist.merge and mozfun.hist.percentiles UDFs:

WITH merged_histogram AS (
SELECT
mozfun.hist.merge(
) AS spinner_visible_ms,
FROM
telemetry.main_nightly -- Use telemetry.main_1pct for a 1% sample across channels
WHERE
normalized_channel = 'nightly' -- Only technically necessary if using telemetry.main or telemetry.main_1pct (see above)
AND normalized_os = 'Windows'
AND DATE(submission_timestamp) = '2020-04-20'
),
percentiles AS (
SELECT
mozfun.hist.percentiles(spinner_visible_ms, [.05, .25, .5, .75, .95]) AS percentile_nested
FROM
merged_histogram
)
SELECT
percentile,
value
FROM
percentiles
CROSS JOIN
UNNEST(percentiles.percentile_nested);

Which gives us this set of results:

PercentileValue
0.0513
0.2556
0.50165
0.75698
0.951,000

So we see for this set of results that 95th percentile is 1000ms, the 75th percentile is 698ms, and so on.

There's a bit of intermediate-to-advanced SQL in the above query, due to the fact that the mozfun.hist.percentiles UDF returns an array of results in a column (rather than a full-blown table) -- we wrangle the results into something we can handle using the UNNEST operator combined with a cross-join at the end. If you don't immediately understand this, don't worry: it's just an implementation detail.

## Viewing change of percentiles over time

Knowing the approximate distribution of results on a given day is sort of interesting, but probably not what we really want: what we're usually interested in is the evolution of results over time. In particular, segmenting by build_id (a date-like structure in the main ping representing when Firefox was built) is a useful technique, as it allows us to see if changes to Firefox itself may have caused the distribution to change.

We can do this simply by grouping by the build id field, and then merging the histograms corresponding to each:

WITH per_build_day AS (
SELECT
PARSE_DATETIME("%Y%m%d%H%M%S", application.build_id) AS build_id,
KEY,
SUM(value) AS value,
FROM
telemetry.main_nightly -- Use telemetry.main_1pct for a 1% sample across channels,
UNNEST(
mozfun.hist.extract(
).VALUES
)
WHERE
normalized_channel = 'nightly' -- Only technically necessary if using telemetry.main or telemetry.main_1pct (see above)
AND normalized_os = 'Windows'
AND application.build_id > FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE, INTERVAL 2 WEEK))
AND application.build_id <= FORMAT_DATE("%Y%m%d", CURRENT_DATE)
AND DATE(submission_timestamp) >= DATE_SUB(CURRENT_DATE, INTERVAL 2 WEEK)
AND DATE(submission_timestamp) <= CURRENT_DATE
GROUP BY
KEY,
build_id
),
per_build_day_as_struct AS (
SELECT
build_id,
STRUCT(ARRAY_AGG(STRUCT(KEY, value)) AS VALUES) AS spinner_visible_ms
FROM
per_build_day
GROUP BY
build_id
)
SELECT
build_id,
percentile,
value
FROM
per_build_day_as_struct
CROSS JOIN
UNNEST(
mozfun.hist.percentiles(
spinner_visible_ms,
[.05, .25, .5, .75, .95]
)
)

As an implementation note, observe that we don't use histogram_merge here as we do above: doing so would require using ARRAY_AGG which can break down when processing large amounts of data. Instead we create an intermediate result (the per_build_day WITH statement) and then reprocess it into a structured representation. If you're curious what the version using histogram_merge would look like, see this example.

In any case, rendering the data this query returns, we get a chart like this:

You'll note that the 75th and the 95th percentiles are often the same. Which is to say: in 25% of cases, the value was somewhere between 698ms and 1000ms. Does this mean that 25% of the time people are seeing a very long-running tab spinner? No! It actually points to a flaw in our methodology, which GLAM was explicitly designed to address. For the last part our tutorial, let's look into how it does it, and how to reproduce its approach.

## Percentiles from client-normalized histograms

The example above basically created one giant histogram and then gathered the percentiles out of each one. But histograms are not created equal! At the extreme end of things for the tab spinner, consider a user on an extremely old computer with various kinds of malware installed, constantly interacting with complex and slow web sites. Such a condition is going to trigger the tab spinner frequently, and for long periods. But it is not representative of the overall population, and probably shouldn't overtly influence our decision-making process.

A solution used by GLAM is to give each client "one vote": that is, the aggregate histogram for a client over a day must sum up to one. Even in the extreme case where all tab spinner measurements fall between 658ms and 1000ms (the range of the highest bucket), the maximum number for that bucket is just "1".

We can reproduce this approach by using the mozfun.hist.normalize UDF, which explicitly takes a set of histograms and makes sure that the values for each one sum up to exactly one:

WITH per_build_client_day AS (
SELECT
PARSE_DATETIME("%Y%m%d%H%M%S", application.build_id) AS build_id,
client_id,
mozfun.hist.normalize(
mozfun.hist.merge(
ARRAY_AGG(
mozfun.hist.extract(
)
)
)
) AS tab_switch_visible_ms
FROM
telemetry.main_nightly -- Use telemetry.main_1pct for a 1% sample across channels
WHERE
normalized_channel = 'nightly' -- Only technically necessary if using telemetry.main or telemetry.main_1pct (see above)
AND normalized_os = 'Windows'
AND application.build_id > FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE, INTERVAL 14 DAY))
AND application.build_id <= FORMAT_DATE("%Y%m%d", CURRENT_DATE)
AND DATE(submission_timestamp) >= DATE_SUB(CURRENT_DATE, INTERVAL 14 DAY)
AND DATE(submission_timestamp) <= CURRENT_DATE
GROUP BY
build_id,
client_id
),
merged_histograms AS (
SELECT
build_id,
KEY,
SUM(value) AS value,
FROM
per_build_client_day,
UNNEST(per_build_client_day.tab_switch_visible_ms.VALUES)
GROUP BY
KEY,
build_id
),
as_struct AS (
SELECT
build_id,
STRUCT(ARRAY_AGG(STRUCT(KEY, value)) AS VALUES) AS spinner_visible_long_ms
FROM
merged_histograms
GROUP BY
build_id
),
percentiles AS (
SELECT
build_id,
mozfun.hist.percentiles(
spinner_visible_long_ms,
[.05, .25, .5, .75, .95]
) AS percentile_nested
FROM
as_struct
)
SELECT
build_id,
percentile,
value
FROM
percentiles
CROSS JOIN
UNNEST(percentiles.percentile_nested);

You'll notice this query groups by client_id in addition to build_id before mozfun.hist.normalize. Grouping by client_id gives each user equal representation and prevents "power users" from skewing the result.

In any case, the result of this query is this graph:

Things are looking much better! The 95th percentile is still capped out at 1000, but the other percentiles are much lower.

## Slicing along arbitrary dimensions

OK, so we've reproduced GLAM, but that isn't particularly exciting in and of itself: if you just wanted to see a GLAM-like view of things, GLAM by itself is going to do a better job. The power of writing SQL comes when you want to see how things look on an arbitrary set of dimensions. Let's look at an arbitrary question: what do the tab spinner percentiles look like for Windows 7? These are likely to be much older machines, so we'd expect things to look worse. But how much?

We can filter our query to just that group of users by adding a AND normalized_os_version="6.1" clause to our query above:

WITH per_build_client_day AS (
SELECT
PARSE_DATETIME("%Y%m%d%H%M%S", application.build_id) AS build_id,
client_id,
mozfun.hist.normalize(
mozfun.hist.merge(
ARRAY_AGG(
mozfun.hist.extract(
)
)
)
) AS tab_switch_visible_ms
FROM
telemetry.main_nightly -- Use telemetry.main_1pct for a 1% sample across channels
WHERE
normalized_channel = 'nightly' -- Only technically necessary if using telemetry.main or telemetry.main_1pct (see above)
AND normalized_os = 'Windows'
AND normalized_os_version = "6.1"
AND application.build_id > FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE, INTERVAL 14 DAY))
AND application.build_id <= FORMAT_DATE("%Y%m%d", CURRENT_DATE)
AND DATE(submission_timestamp) >= DATE_SUB(CURRENT_DATE, INTERVAL 14 DAY)
AND DATE(submission_timestamp) <= CURRENT_DATE
GROUP BY
build_id,
client_id
),
merged_histograms AS (
SELECT
build_id,
KEY,
SUM(value) AS value,
FROM
per_build_client_day,
UNNEST(per_build_client_day.tab_switch_visible_ms.VALUES)
GROUP BY
KEY,
build_id
),
as_struct AS (
SELECT
build_id,
STRUCT(ARRAY_AGG(STRUCT(KEY, value)) AS VALUES) AS spinner_visible_long_ms
FROM
merged_histograms
GROUP BY
build_id
),
percentiles AS (
SELECT
build_id,
mozfun.hist.percentiles(
spinner_visible_long_ms,
[.05, .25, .5, .75, .95]
) AS percentile_nested
FROM
as_struct
)
SELECT
build_id,
percentile,
value
FROM
percentiles
CROSS JOIN
UNNEST(percentiles.percentile_nested);


text:
# Wave Function

## What is wave function?

In quantum physics, a wave function is a mathematical description of a quantum state of a particle as a function of momentum, time, position and spin. The symbol used for a wave function is a Greek letter called psi, 𝚿.

By using a wave function, the probability of finding an electron within the matter wave can be explained. This can be obtained by including an imaginary number which is squared to get a real number solution resulting in the position of an electron. The concept of wave function was introduced in the year 1925 with the help of the Schrodinger equation.

## What is Schrodinger equation?

Schrodinger equation is defined as the linear partial differential equation describing the wave function, 𝚿. The equation is named after Erwin Schrodinger. Using the postulates of quantum mechanics, Schrodinger could work on the wave function.

Following is the equation of Schrodinger equation:

• Time dependent Schrodinger equation: $ih\frac{\partial }{\partial t}\Psi (r,t)=[\frac{h^{2}}{2m}\bigtriangledown ^{2}+V(r,t)]\Psi (r,t)$
• Time independent Schrodinger equation: $[\frac{-h^{2}}{2m}\bigtriangledown ^{2}+V(r)]\Psi (r)=E\Psi (r)$

Where,

m: mass of the particle

⛛: laplacian

i: imaginary unit

h=h/2𝝿 : reduced Planck constant

E: constant equal to the energy level of the system

## Properties of wave function

• All measurable information about the particle is available.
• 𝚿 should be continuous and single-valued.
• Using the Schrodinger equation, energy calculations becomes easy.
• Probability distribution in three dimensions is established using the wave function.
• The probability of finding a particle if it exists is 1.

## Postulates of quantum mechanics

• With the help of time-dependent Schrodinger equation, the time evolution of wave function is given.
• For a particle in a conservative field of force system, using wave function it becomes easy to understand the system.
• Linear set of independent functions is formed from the set of eigenfunctions of operator Q.
• Operator Q associated with a physically measurable property q is Hermitian.
• By performing the expectation value integral with respect to the wave function associated with the system, the expectation value of the property q can be determined.
• For every physical observable q, there is an operator Q operating on wave function associated with a definite value of that observable such that it yields wave function of that many times.

Stay tuned with BYJU’S to learn more on other concepts of Physics.

Related Physics Articles:


text:
### 数学代考|计算复杂性理论代写computational complexity theory代考|Agent Based Computational Economics

statistics-lab™ 为您的留学生涯保驾护航 在代写计算复杂性理论computational complexity theory方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写计算复杂性理论computational complexity theory代写方面经验极为丰富，各种代写计算复杂性理论相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 数学代考|计算复杂性理论代写computational complexity theory代考|Definition of the Subject

Mainstream economic models typically make the assumption that an entire group of agents, e.g. “investors”, can be modeled with a single “rational representative agent”. While this assumption has proven extremely useful in advancing the science of economics by yielding analytically tractable models, it is clear that the assumption is not realistic: people are different one from the other in their tastes, beliefs, and sophistication, and as many psychological studies have shown, they often deviate from rationality in systematic ways.

Agent Based Computational Economics is a framework allowing economics to expand beyond the realm of the “rational representative agent”. By modeling and simulating the behavior of each agent and the interaction among agents, agent based simulation allows us to investigate the dynamics of complex economic systems with many heterogeneous and not necessarily fully rational agents.

The agent based simulation approach allows economists to investigate systems that can not be studied with the conventional methods. Thus, the following key questions can be addressed: How do heterogeneity and systematic deviations from rationality affect markets? Can these elements explain empirically observed phenomena which are considered “anomalies” in the standard economics literature? How robust are the results obtained with the analytical models? By addressing these questions the agent based simulation approach complements the traditional analytical analysis, and is gradually becoming a standard tool in economic analysis.

## 数学代考|计算复杂性理论代写computational complexity theory代考|Introduction

For solving the dynamics of two bodies (e.g. stars) with some initial locations and velocities and some law of attraction (e.g. gravitation) there is a well-known analytical solution. However, for a similar system with three bodies there is no known analytical solution. Of course, this does not mean that physicists can’t investigate and predict the behavior of such systems. Knowing the state of the system (i. e. the location, velocity, and acceleration of each body)

at time $t$, allows us to calculate the state of the system an instant later, at time $t+\Delta t$. Thus, starting with the initial conditions we can predict the dynamics of the system by simply simulating the “behavior ” of each element in the system over time.

This powerful and fruitful approach, sometimes called “Microscopic Simulation”, has been adopted by many other branches of science. Its application in economics is best known as “Agent Based Simulation” or “Agent Based Computation”. The advantages of this approach are clear they allow the researcher to go where no analytical models can go. Yet, despite of the advantages, perhaps surprisingly, the agent based approach was not adopted very quickly by economists. Perhaps the main reason for this is that a particular simulation only describes the dynamics of a system with a particular set of parameters and initial conditions. With other parameters and initial conditions the dynamics may be different. So economists may ask: what is the value of conducting simulations if we get very different results with different parameter values? While in physics the parameters (like the gravitational constant) may be known with great accuracy, in economics the parameters (like the risk-aversion coefficient, or for that matter the entire decision-making rule) are typically estimated with substantial error. This is a strong point. Indeed, we would argue that the “art” of agent based simulations is the ability to understand the general dynamics of the system and to draw general conclusions from a finite number of simulations. Of course, one simulation is sufficient as a counterexample to show that a certain result does not hold, but many more simulations are required in order to convince of an alternative general regularity.

This manuscript is intended as an introduction to agent-based computational economics. An introduction to this field has two goals: (i) to explain and to demonstrate the agent-based methodology in economics, stressing the advantages and disadvantages of this approach relative to the alternative purely analytical methodology, and (ii) to review studies published in this area. The emphasis in this paper will be on the first goal. While Sect. “Some of the Pioneering Studies” does provide a brief review of some of the cornerstone studies in this area, more comprehensive reviews can be found in $[19,24,32,39,40]$, on which part of Sect. “Some of the Pioneering Studies” is based. A comprehensive review of the many papers employing agent based computational models in economics will go far beyond the scope of this article. To achieve goal (i) above, in Sect. “Illustration with the LLS Model” we will focus on one particular model of the stock market in some detail. Section “Summary and Future Directions” concludes with some thoughts about the future of the field.

## 数学代考|计算复杂性理论代写computational complexity theory代考|Schelling’s Segregation Model

Schelling’s [36] classical segregation model is one of the earliest models of population dynamics. Schelling’s model is not intended as a realistic tool for studying the actual dynamics of specific communities as it ignores economic, real-estate and cultural factors. Rather, the aim of this very simplified model is to explain the emergence of macroscopic single-race neighborhoods even when individuals are not racists. More precisely, Schelling found that the collective effect of neighborhood racial segregation results even from individual behavior that presents only a very mild preference for same-color neighbors. For instance, even the minimal requirement by each individual of having (at least) one neighbor belonging to ones’ own race leads to the segregation effect.

The agent based simulation starts with a square mesh, or lattice, (representing a town) which is composed of cells (representing houses). On these cells reside agents which are either “blue” or “green” (the different races). The crucial parameter is the minimal percentage of same-color neighbors that each agent requires. Each agent, in his turn, examines the color of all his neighbors. If the percentage of neighbors belonging to his own group is above the “minimal percentage”, the agent does nothing. If the percentage of neighbors of his own color is less then the minimal percentage, the agent moves to the closest unoccupied cell. The agent then examines the color of the neighbors of the new location and acts accordingly (moves if the number of neighbors of his own color is below the minimal percentage and stays there otherwise). This goes on until the agent is finally located at a cite in which the minimal percentage condition holds. After a while, however, it might happen that following the moves of the other agents, the minimal percentage condition ceases to be fulfilled and then the agent starts moving again until he finds an appropriate cell. As mentioned above, the main result is that even for very mild individual preferences for same-color neighbors, after some time the entire system displays a very high level of segregation.

A more modern, developed and sophisticated reincarnation of these ideas is the Sugarscape environment described by Epstein and Axtell [6]. The model considers a population of moving, feeding, pairing, procreating, trading, warring agents and displays various qualitative collective events which their populations incur. By employing agent based simulation one can study the macroscopic results induced by the agents’ individual behavior.

## 数学代考|计算复杂性理论代写computational complexity theory代考|Schelling’s Segregation Model

Schelling 的 [36] 经典隔离模型是最早的种群动态模型之一。Schelling 的模型并非旨在作为研究特定社区实际动态的现实工具，因为它忽略了经济、房地产和文化因素。相反，这个非常简化的模型的目的是解释宏观单一种族社区的出现，即使个人不是种族主义者。更准确地说，谢林发现，邻里种族隔离的集体效应甚至来自对同色邻居仅表现出非常温和的偏好的个人行为。例如，即使每个人（至少）有一个属于自己种族的邻居的最低要求也会导致隔离效应。

Epstein 和 Axtell [6] 描述的 Sugarscape 环境是这些想法的更现代、更发达和更复杂的转世。该模型考虑了移动、喂养、配对、繁殖、交易、交战代理的群体，并显示了他们的群体发生的各种定性集体事件。通过采用基于代理的模拟，可以研究由代理的个体行为引起的宏观结果。

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。


text:
# How can surface excess be negative?

If we have interphase of two phases $$\alpha$$ (water) and $$\beta$$ (air), surface excess is defined as

$$\Gamma_i = \frac{n_{i,\mathrm{tot}} - n_{i,\alpha} - n_{i,\beta}} A = \frac{n_{i,\mathrm{int}}} A,$$

where $$n_{i,\mathrm{tot}}$$ is total amount of some substance added in the system which can be some salt since in that case surface excess is defined as negative, and $$n_{i,\mathrm{int}}$$ is the amount of substance on the interphase.

Surface excess is the amount of some substance present on the interphase (salt or surfactant) divided by surface area $$A$$ of the interphase.

However, taking into account definition of surface excess, how can surface excess be negative when the amount of substance can't be negative number?

• It may help if there is included the source and broader context of the equation. Nov 28 '21 at 8:24
• jestr.org/downloads/volume1/fulltext1.pdf I must have forgotten this stuff because I did study adsorption phenomena at the university. After reading this I am still puzzled, but at least it seems that Surf Exc can be positive as well negative. Anyone able to explain the concept different than Wikipedia please do it. Nov 28 '21 at 9:12
• You don't seem to have problems with positive surface excess, which by the same reasoning would violate the conservation of mass just as well, only with different sign. How so? Nov 28 '21 at 9:54
• Conservation of mass does not play any role. Is the concept that we are missing (we I mean OP and I, at least). It is not clear to me what the n refer to, which volume. Perhaps n alpha and beta are those within the interface volume (across it, which has a thickness). Nov 28 '21 at 10:30
• @Ivan Neretin Positive surface excess doesn't violate law of mass conservation. For example, if you add 1 mole of surfactant in water/hexane system, 0,2 mol go in water, 0,4 mol go in hexane and 0,4 go on water/hexane interface. Everything is okay with mass conservation. Nov 28 '21 at 16:05


text:
Common Core Math 3 - 2020 Edition
8.01 Trigonometric functions as right triangle ratios
Lesson

### Trigonometric ratios

Trigonometric ratios describe the relationships between the different sides of a right triangle. These sides are described in terms of where they are compared to one of the two acute angles.

So a trigonometric ratio tells us which two sides are in a given ratio, as well as the angle the ratio is being measured from.

In the triangle below we’ve chosen one of the acute angles, labeled $x$x. The sides of the triangle can then be referred to as the side opposite $x$x, the side adjacent to $x$x and the hypotenuse.

Three trigonometric ratios are:

The sine ratio: $\sin\left(x\right)=\frac{\text{Opposite}}{\text{Hypotenuse}}$sin(x)=OppositeHypotenuse

The cosine ratio: $\cos\left(x\right)=\frac{\text{Adjacent}}{\text{Hypotenuse}}$cos(x)=AdjacentHypotenuse

The tangent ratio: $\tan\left(x\right)=\frac{\text{Opposite}}{\text{Adjacent}}$tan(x)=OppositeAdjacent

There are also what we call the reciprocal trigonometric ratios, each of which are a reciprocal of one of the three ratios above.

The cosecant ratio: $\csc\left(x\right)=\frac{1}{\sin\left(x\right)}=\frac{\text{Hypotenuse}}{\text{Opposite}}$csc(x)=1sin(x)=HypotenuseOpposite

The secant ratio: $\sec\left(x\right)=\frac{1}{\cos\left(x\right)}=\frac{\text{Hypotenuse}}{\text{Adjacent}}$sec(x)=1cos(x)=HypotenuseAdjacent

The cotangent ratio: $\cot\left(x\right)=\frac{1}{\tan\left(x\right)}=\frac{\text{Adjacent}}{\text{Opposite}}$cot(x)=1tan(x)=AdjacentOpposite

Notice similar triangles will have the same the trigonometric ratio of a particular angle, because enlarging or shrinking a triangle doesn't change the size of its angles or the ratio of its sides.
For example, if $\tan x=\frac{2}{1}$tanx=21 we can tell that the side opposite to $x$x is twice as big as the side adjacent to $x$x. The sides might have lengths $6$6 and $3$3, not necessarily $2$2 and $1$1.

Even though we don’t know the exact length of the sides just from knowing these ratios, we can still use one ratio to calculate another ratio.

### Using one ratio to find another

Given one trigonometric ratio, we can construct a right triangle that has an angle and sides that match the information described by the ratio.

We can then use the Pythagorean Theorem to find the length of the other side.

Once we have all three side lengths, we can find any other trigonometric ratio of the acute angle by using the appropriate formula.

#### Worked example

##### Question 1

A right triangle has $\sin\theta=\frac{13}{85}$sinθ=1385, find the value of $\csc\theta$cscθ and $\sec\theta$secθ.

Think: If $\sin\theta=\frac{13}{85}$sinθ=1385, then this means we can make the length of the hypotenuse is $85$85 and the length of the opposite side $13$13. We need to find the length of the adjacent side for $\sec\theta$secθ.

Do:

Finding $\csc\theta$cscθ:

 $\csc\theta$cscθ $=$= $\frac{1}{\sin\theta}$1sinθ $=$= $\frac{1}{\frac{13}{85}}$11385 $=$= $\frac{85}{13}$8513

Finding $\sec\theta$secθ, by first finding the adjacent side:

 $a^2+b^2$a2+b2 $=$= $c^2$c2 State the Pythagorean Theorem $a^2+13^2$a2+132 $=$= $85^2$852 Fill in the given information $a^2+169$a2+169 $=$= $7225$7225 Evaluate the squares $a^2$a2 $=$= $7056$7056 Subtract $169$169 from both sides $a$a $=$= $\sqrt{7056}$√7056 Take the square root of both sides $a$a $=$= $84$84 Simplify the square root

We get the triangle below

Now to find $\sec\theta$secθ

 $\sec\theta$secθ $=$= $\frac{1}{\cos\theta}$1cosθ $=$= $\frac{\text{hypotenuse }}{\text{adjacent }}$hypotenuse adjacent  $=$= $\frac{85}{84}$8584

#### Practice questions

##### Question 2

Evaluate $\cos\theta$cosθ within $\triangle ABC$ABC.

##### Question 3

Consider the following triangle.

1. Find the value of $x$x.

2. Hence find the value of $\sin\theta$sinθ.

3. Hence find the value of $\cos\theta$cosθ.

##### Question 4

Consider the triangle below. Given that $\sin x=\frac{4}{5}$sinx=45 , find the value of $\csc x$cscx.

##### Question 5

Consider the triangle below.

1. Calculate the length of the missing side.

2. Find each of the following trigonometric ratios.

 $\sin x$sinx $=$= $\editable{}$ $\cos x$cosx $=$= $\editable{}$ $\tan x$tanx $=$= $\editable{}$ $\sec x$secx $=$= $\editable{}$ $\operatorname{cosec}x$cosecx $=$= $\editable{}$ $\cot x$cotx $=$= $\editable{}$


text:
# Computing determinant

Let $$A= \begin{bmatrix} x_1^{4} & x_2^{4} & x_3^{4} \\ x_1^{2} & x_2^{2} & x_3^{2} \\ 1 &1 &1 \end{bmatrix} .$$ I want to show that the $$\det A \times \frac{1}{(x_1-x_2)(x_1-x_3)(x_2-x_3)} = x_1^2x_2+x_1^2x_3+x_2^2x_3+x_1x_2^2+x_1x_3^2+x_2x_3^2+2x_1x_2x_3.$$

The determinant of $$A$$ is trivial but trying to manipulate $$\frac{1}{(x_1-x_2)(x_1-x_3)(x_2-x_3)}$$ is where I am having some problems.

We can think of $$\frac{1}{(x_1-x_2)} = \frac{1}{x_1(1-\frac{x_2}{x_1})}=\frac{1}{x_1}(1+ \frac{x_2}{x_1}+\frac{x_2^2}{x_1^2}+\cdots)$$ but I still dont end up getting the answer after multplying the whole thing out. Is there a trick to this? any hint will be appreciated.

P.S (Combinatorics): This is an expression from the definition of Schur Functions.

• By replacing $x_i^2$ with $z_i$ you get a Vandermonde matrix, which is associated to an interpolation problem. – Jack D'Aurizio Nov 21 '18 at 22:33
• Just thinking out loud: You could subtract the 2nd column from the 1st (and the 3rd from the 2nd.) Then when you work out the det, you get some difference of squares-y things which might work well with your denominator. – B. Goddard Nov 21 '18 at 22:38
• @B.Goddard Thanks a lot. Done :) – Jaynot Nov 21 '18 at 23:08


text:
# Equality Work in Finnish Ministries

Forskningsoutput: AvhandlingMagisteruppsatsAvhandlingar

## Sammanfattning

The aim of this thesis is to contribute to knowledge about the equality work in public sector organisations. Especially, my aim is to bring light into everyday experiences of doing equality work. This is achieved through interviewing equality workers in Finnish ministries. The study draws also on my personal experiences as an equality consultant. The main question I ask is: Which issues influence the content of equality work? According to feminist research, promoting equality is always a political process, which includes conflicting interests. These conflicting interests are, however, not visible in official descriptions of equality work. For example, ministries’ equality policies mostly hide the various interests under vague definitions and beautiful structures. Despite the invisibility of the tensions in written documents, equality workers describe the negotiative nature of equality work by providing examples of equality negotiations in their organisations. In my analysis I conclude that equality workers are aware of their organisations’ capacities to change and, in their work, they adapt to these limitations by choosing their strategies to do equality work accordingly. The content of equality work reflects the strategies, which are carefully chosen based on the knowledge about the organisation. I argue that this process of choosing equality strategies by
equality workers is one of the overlooked factors shaping equality work in organisations.


text:
Sidebar

Reference

computing:datapromotion

Freshly recorded raw data generally needs to go through a number of preprocessing and annotation steps before it is ready to be analyzed. Especially when setting up a new task and/or drive layout, annotation can take a lot of time. If you want to extract spike trains, you will need to spike sort the raw data, which depending on the number of recording sites and the quality of your data can take up to 2 hours per tetrode.

Raw data should immediately be uploaded to the Incoming folder on the lab database, and backed up to a secondary location such as on your own computer or to DVD.

When preprocessing is complete, the resulting set of files moves to the Promoted folder. When you promote your first data sets, ask MvdM to verify accuracy and completeness.

We use two different data acquisition systems in the lab. Raw data from a recording session using the Neuralynx system consists of the following files:

• *.Ncs files: continuously sampled data, “local field potentials”
• *.ntt files: raw tetrode files (or *.nst, stereotrode files)
• *.Nev file: raw Events file
• *.Nvt file: video tracking file (usually zipped to save space)

For most tasks, when promotion is complete the following files are also available: The following files are the result of preprocessing and annotation:

• *.t files: spike times for one putative neuron (output from MClust, a spike sorting program)
• *.clusters: cluster information (output from MClust, you will generally not need this)
• *wv.mat and *ClusterQual.mat files: waveforms and cluster quality metrics
• *Metadata.mat file: structured task-related information such as locations of feeders, times of rewards, etc. (not included in all sessions)
• *ExpKeys.m file: basic information about this recording session, such as task, start time, end time, etc. (note this is a .m file, so needs to be run rather than loaded as you would a .mat file)
• *vt.mat file: pre-processed video tracking data

Note the naming convention for the above files: all files are identified by the RYYYY-MM-DD string in the filename, and recording files are further named with the tetrode number.


text:
# Gif Limit!

Calculus Level 2

If $$\displaystyle \lim_{x\to a} f(x) = \lim_{x\to a} \lfloor f(x) \rfloor$$ and it exist, then what can we conclude for the value of $$\displaystyle \lim_{x\to a} f(x)$$?

×

Problem Loading...

Note Loading...

Set Loading...


text:
# Oxydazation states of oxygen are :

$\begin{array}{1 1}(a)\;-II,-I,+I,+II\\(b)\;-II,+I,-I,-II\\(c)\;+II,+I,+VI,+V,-I,-II\\(d)\;+II,-I,+VI,-VI,+V,-I\end{array}$

Doesn't show higher oxidation states like +IV or VI because of absence of d-shell
Hence (a) is the correct answer.


text:
Why TimeSeries forecasts the future value poorly?

7

4

On a bank account there are many recurring entrance and expenses.

I've managed to import some sample data and to plot it.

I can see that there is a quite clear recurring trend (one wage is coming on 22 of the month and another on 27th of every month and many payments happen in the first days of the month).

What could help me in creating a forecast FutureMoney[today, futureDay, actualAmount]

ClearAll[f];
ClearAll[file1];
f = DateString[{#, {"Day", "/", "Month", "/", "Year"}}] &
file1 = Import["C:\\Users\\Utente\\Documents\\1.csv"];
data1 = file1[[2 ;;, {1, 2}]];
data = MapAt[f, data1, {All, 1}];
tsm = TimeSeriesModelFit[data];
DateListPlot[{tsm["TemporalData"], TimeSeriesForecast[tsm, {30}]}]

Any help?

3Hi Revious, have you asked this before? Or do I have some deja vu? – Carl Lange – 2019-10-30T15:47:24.813

the title has nothing to do with question and there is no failure reported. – Gosia – 2019-11-05T19:52:53.930

@CarlLange: yes, but no one answered, so I deleted it.. – Revious – 2019-11-07T23:26:51.787

2Naively using some kind of time forecasting method might not be the best approach. What about creating a histogram over money withdrawn or inserted into the account on day x? That could be a good start. If the 22nd och 27th is on a weekend that can change the pattern, so then in those cases move the money deposit to the next weekday instead. It's always good to start by implementing a simple baseline so that you know if the fancy methods you might try later add any real benefit. Otherwise you'll end up using neural networks for problems that can be solved with linear interpolation. – C. E. – 2019-11-08T08:40:20.627

3You need to devise a way to test your predictions as well. Typically, you would train on the first 3/4 of the data, say, and then predict the last 1/4. Then you would compare your prediction with your last 1/4 of real data (the so-called ground truth.) You would use some kind of distance measurement, such as the point-wise euclidean distance, and track that measurement over all of your different attempts. – C. E. – 2019-11-08T08:42:39.333

@C.E. but how a similar huge task could be achieved in Mathematica? It seems something near to Neural Network – Revious – 2019-11-08T13:37:04.090

@Revious I'm afraid I don't understand your question. – C. E. – 2019-11-08T13:44:51.343

@C.E. I'm sorry, I meant that I'm not so experienced with Mathematica.. I cannot imagine how to build a predictor or how to look for a pattern. Are there functions for that or is more about programming? – Revious – 2019-11-08T13:48:09.913

@Revious I'm afraid that programming is a prerequisite for that type of analysis, but that's true for almost any somewhat complicated data analysis these days. – C. E. – 2019-11-08T20:48:15.853

8

To get output that looks a bit more reasonable, modify the second parameter to TimeSeriesModelFit.

ds = SemanticImport["https://textbin.net/raw/ikfqPWq6Iy"]

ts = TimeSeriesResample@TimeSeries[Values@Normal@ds]

Now, we can get output that has the repetition you were expecting with, for instance, an "ARMA" (auto-regressive moving-average) model:

tsm = TimeSeriesModelFit[ts, {"ARMA", {100, 5}}];
DateListPlot[{tsm["TemporalData"], TimeSeriesForecast[tsm, {160}]}]

Modifying the parameters of the model (above, I picked 100 and 5 for the autoregressive order and moving average order respectively) will give different output. For instance, here's {20,30}:

There's a large list of models and their parameters in the documentation for TimeSeriesModelFit.

I'm not qualified to give you a good explanation of these different models or their parameters, but I hope this is a good start for you!

Thank you very much. May I ask you what the "@" syntax means? I'm trying to understand this part: TimeSeriesResample@TimeSeries[Values@Normal@ds] – Revious – 2019-11-08T13:39:45.237

2Ah, it's the prefix operator, which is equivalent to: TimeSeriesResample[TimeSeries[Values[Normal[ds]]]] - so f@x === f[x]. – Carl Lange – 2019-11-08T14:27:00.523

-2

forecast = TimeSeriesForecast[tsm, {30}] returns a TimeSeries object, so you can see what the value is on a given date by forecast[date_DateObject] or print all the values forecast["Values"].

1

it seems a very weird forecast, the timeseries is cyclic on a 30 days period and this is the forecast https://i.imgur.com/MMVsqPl.png

– Revious – 2019-11-07T23:31:54.217


text:
Divergence of product of killing vector and energy momentum tensor vanishes. Why?

1. Apr 10, 2010

Derivator

Hi,

in my book, it says:
-----------------------
Beacause of $$T^{\mu\nu}{}{}_{;\nu} = 0$$ and the symmetry of $$T^{\mu\nu}$$, it holds that

$$\left(T^{\mu\nu}\xi_\mu\right)_{;\nu} = 0$$
-----------------------

(here, $$T^{\mu\nu}$$ ist the energy momentum tensor and $$\xi_\mu$$ a killing vector. The semicolon indicates the covariant derivative, i.e. $$()_{;}$$ is the generalized divergence)

I don't understand, why from

" $$T^{\mu\nu}{}{}_{;\nu} = 0$$ and the symmetry of $$T^{\mu\nu}$$ "

it follows, that

$$\left(T^{\mu\nu}\xi_\mu\right)_{;\nu} = 0$$

must hold.

---
derivator

2. Apr 10, 2010

George Jones

Staff Emeritus
What results when

$$\left(T^{\mu\nu}\xi_\mu\right)_{;\nu} = 0$$

is expanded?

3. Apr 10, 2010

Derivator

$$\left(T^{\mu\nu}\xi_\mu\right)_{;\nu} = \left(T^{\mu\nu})_{;\nu}\xi_\mu\right + T^{\mu\nu} \left(\xi_\mu\right)_{;\nu} = 0 + T^{\mu\nu} \left(\xi_\mu\right)_{;\nu}$$

So $$T^{\mu\nu} \left(\xi_\mu\right)_{;\nu}$$ should be equal to 0. But why?

4. Apr 10, 2010

nicksauce

Use the fact that T^{\mu\nu} is symmetric.

5. Apr 10, 2010

Derivator

Lets write $$T^{\mu\nu} \left(\xi_\mu\right)_{;\nu}$$ without Einstein summation convention:

$$\sum_\mu\sum_\nu T^{\mu\nu} \left(\xi_\mu\right)_{;\nu} = \sum_\mu\sum_\nu T^{\nu\mu} \left(\xi_\mu\right)_{;\nu} = - \sum_\mu\sum_\nu T^{\nu\mu} \left(\xi_\nu\right)_{;\mu}$$

I see no chance to get it =0
:-(

6. Apr 10, 2010

George Jones

Staff Emeritus
Is

$$\sum_\mu\sum_\nu T^{\mu\nu} \left(\xi_\mu\right)_{;\nu} = \sum_\alpha\sum_\beta T^{\alpha\beta} \left(\xi_\alpha\right)_{;\beta}$$

correct?

7. Apr 10, 2010

Derivator

why shouldn't it be correct? You only changed the names of the indices?!

8. Apr 10, 2010

George Jones

Staff Emeritus

$$\sum_\mu\sum_\nu T^{\nu\mu} \left(\xi_\nu\right)_{;\mu} = \sum_\beta\sum_\alpha T^{\alpha\beta} \left(\xi_\alpha\right)_{;\beta}$$

9. Apr 10, 2010

samalkhaiat

$$T^{\mu\nu}(\xi_\mu)_{;\nu} = (1/2)\left( T^{\mu\nu}\xi_{\mu;\nu} + T^{\nu\mu}\xi_{\nu;\mu} \right) = (1/2)T^{\mu\nu}\left(\xi_{\mu;\nu} + \xi_{\nu;\mu} \right) = 0$$

Last edited: Apr 10, 2010
10. Apr 10, 2010

Derivator

Yes, it's also correct. But I don't see your point.

11. Apr 10, 2010

George Jones

Staff Emeritus
You wrote
Substitute the relabeled expressions into the left and right sides of the above.

12. Apr 10, 2010

Derivator

Oh I see! Thanks!

---------

@samalkhaiat

how do you justify this step:
$$T^{\mu\nu}(\xi_\mu)_{;\nu} = (1/2)\left( T^{\mu\nu}\xi_{\mu;\nu} + T^{\nu\mu}\xi_{\nu;\mu} \right)$$

?

is it true, that you only relabled the summation indices in
$$T^{\nu\mu}\xi_{\nu;\mu} \right)$$

Last edited: Apr 10, 2010
13. Apr 10, 2010

nicksauce

That is correct.


text:
## Stream: triage

### Topic: issue #2871: unique factorisation of polynomials over a UFD

#### Random Issue Bot (Dec 12 2020 at 14:24):

Today I chose issue 2871 for discussion!

unique factorisation of polynomials over a UFD
Created by @Johan Commelin (@jcommelin) on 2020-05-30
Labels: feature-request

Is this issue still relevant? Any recent updates? Anyone making progress?

#### Johan Commelin (Dec 12 2020 at 15:36):

@Aaron Anderson is there anything left here? I don't think so, right?

#### Johan Commelin (Dec 12 2020 at 15:36):

So I guess we can close this issue

#### Aaron Anderson (Dec 12 2020 at 17:37):

You added mv_polynomials to the issue

#### Aaron Anderson (Dec 12 2020 at 17:38):

And I haven’t done the induction on variables, because I was hoping to do it in a super-general way instead of copy-paste

aha, makes sense

#### Aaron Anderson (Dec 12 2020 at 17:47):

Perhaps I should copy-paste and then make a new issue calling for the induction principle?

#### Johan Commelin (Dec 12 2020 at 17:50):

whatever you think is best

#### Johan Commelin (Dec 12 2020 at 17:50):

I think there was some chat about an induction principle recently

#### Johan Commelin (Dec 12 2020 at 17:50):

but I don't think it got PRd in the end

No, it didn’t.

#### Aaron Anderson (Dec 12 2020 at 17:55):

I think ideally we’d have some definition of what it means to be a ring property that’s preserved under isos, but that’s got too many universe variables to be easy

#### Johan Commelin (Dec 12 2020 at 17:57):

well, there is the equiv_rw tactic that Scott wrote

#### Johan Commelin (Dec 12 2020 at 17:58):

And he has some category-theoretic machinery to support exactly this "preserved under isos" reasoning

#### Johan Commelin (Dec 12 2020 at 17:58):

But it hasn't seen a lot of use so far

#### Johan Commelin (Dec 12 2020 at 17:58):

And Scott seems to be very busy atm, so I don't think he'll be able to offer support for the time being

#### Random Issue Bot (Dec 28 2020 at 14:28):

Today I chose issue 2871 for discussion!

unique factorisation of polynomials over a UFD
Created by @Johan Commelin (@jcommelin) on 2020-05-30
Labels: feature-request

Is this issue still relevant? Any recent updates? Anyone making progress?

Last updated: May 09 2021 at 16:20 UTC


text:
# Reflexive and irreflexive

1. Feb 17, 2014

### scorpius1782

1. The problem statement, all variables and given/known data
xRy iff (x+y)2=1
determine if reflexive, irreflexive or neither

2. Relevant equations

3. The attempt at a solution
I'm having trouble understanding the definitions. I know that reflexive means that ever element is related to itself and that irreflexive means that no element is related to itself but I don't really understand what that means.

For this problem it is only true y=-x-1 or y=1-x.

But I don't understand what to do from here. Does this mean that since x and y are dependent on one another then they are reflexive? But how would I know if it an element in 'x' (say 10) is dependent onitself?

2. Feb 17, 2014

### LCKurtz

You haven't told us what set $x$ and $y$ are from. I will assume the real numbers. As you say, your relation is reflexive if for all $x \in \mathbb R$ you have $xRx$ or $(x+x)^2 = 1$. Is that true or false?

Now write carefully what it means for your relation to be irreflexive and decide whether or not it is true.

3. Feb 17, 2014

### scorpius1782

Sorry yes, x,y are Real. I would say that your example is irreflexive because x can only be $\frac{1}{2}$ or $\frac{-1}{2}$.

However, I stumble on the idea of "related". What does that even mean, specifically? Because, in the original question there is an equation that specifically relates x and y. They are related via that equation but is that what the definition is referring to? They can never be equal or divisible by one another but does that mean they can't be related? These sort of things are glossed over in my text and it is quite frustrating. I still don't understand how a number can be related to itself.

4. Feb 17, 2014

### LCKurtz

You didn't do that.

Until you write the definition of what it means to be irreflexive in this problem, you are just guessing.

In this problem $x$ and $y$ are related, written $xRy$, if $(x+y)^2=1$. That's the definition. Nothing more nor less. So try again to answer the questions above.

5. Feb 17, 2014

### scorpius1782

I guess I didn't understand what you were saying in the question (I didn't really get the 'or') part. So, this must be false because if xRx is true then x=x but this is clearly not the case in the equation.

Irreflexive-no element can be related to itself. So, for xRy it must be that the conditional equation demands that x=y. But it clearly can't and never can. They are related but not reflexive(ly) related (this part actually confused me for some reason).

Have I got the idea now?

6. Feb 17, 2014

### LCKurtz

If you want to know if you have an equivalence relation, here is what you have to prove:

I re-worded it without the "or". Now can you well me whether $R$ is reflexive and why? All you have to do is explain whether the statement is true or false and why.

No. Once you get the reflexive question figured out you need to write a careful definition for irreflexive and work it similarly.

7. Feb 17, 2014

### scorpius1782

x is reflexive because it can solve that equation as $\frac{1}{2}$ or $\frac{−1}{2}$ (I was still thinking x,y before for some reason).

This is as careful as I can be without actually understanding it. I'm not trying to be a pain but I can't define something I don't seem to understand.
Irreflexive-no element can be related to itself. So, for xRy it must be that the conditional equation demands that $x \neq y$ and is then irreflexive. No other solution can have x=y or else it would be neither reflexive or irreflexive.

8. Feb 17, 2014

### LCKurtz

It isn't $x$ that is or isn't reflexive. It is $R$. At the risk of answering the question for you:

Is it true or false that for all $x\in \mathbb R$, $(x+x)^2=1$? Why or why not? That is what $xRx$ means and that's how you answer the question.

9. Feb 17, 2014

### scorpius1782

Then false because there is only 2 real numbers that solve the equation while there is an infinite number of reals that do not.

10. Feb 17, 2014

### LCKurtz

Yes. Instead of stating a sentence like that, give an equation. Just say, for example, that it is false because $(0+0)^2\ne 1$.

Now here's your problem. State carefully, with equations, similar to what is above and using the definition of $R$ what you have to prove true or false to say whether $R$ is irreflexive. Don't give me a paragraph of explanation. Give equations.

11. Feb 18, 2014

### scorpius1782

I don't want to post the final answer since it is not homework that we're not suppose to share. However, I think I fully understand it now. Thank you very much for the help.


text:
How to define a non-standard algebra in Mathematica?

I want to define an algebra, where there are three elements: 0, 1 and $\infty$ and two operations, addition and multiplication defined, both commutative:

\begin{align*} 0+0&=0\\ 0+1&=1\\ 0+\infty&=\infty\\ 1+1&=1\\ 1+\infty&=\infty\\ \infty+\infty&=\infty\\ 0\times0&=0\\ 1\times0&=0\\ 1\times1&=1\\ 0\times\infty&=1\\ 1\times\infty&=\infty\\ \infty\times\infty&=\infty \end{align*}

I want Mathematica to simplify expressions in this system.

-
You might want to look into using CirclePlus[] and CircleTimes[] for defining your special operations, as it's usually not a good idea to modify Plus[] and Times[] willy-nilly. –  Guess who it is. May 21 '12 at 2:31
A related discussion of custom notation for an operator algebra: Having the derivative be an operator –  Jens May 21 '12 at 15:30

Here's a way to do it:

Begin["NonStandardAlgebra"];
ClearAll /@ {plus, times};
SetAttributes[#, Orderless] & /@ {plus, times};
plus[x : 0 | 1, y : 0 | 1] := Unitize[x + y]
plus[Infinity, x : 0 | 1 | Infinity] := Infinity
times[0, Infinity] := 1
times[x_, y_] := SystemTimes[x, y]
End[];

A couple of examples:

NonStandardAlgebratimes[Infinity, 0]
(* 1 *)

NonStandardAlgebraplus[1, 1]
(* 1 *)

To make the usage convenient, you can utilize an unused symbol. Here, I map these to CirclePlus and CircleTimes respectively as:

CirclePlus[x_, y_] := NonStandardAlgebraplus[x, y]
CircleTimes[x_, y_] := NonStandardAlgebratimes[x, y]

Here's your entire algebra (the bottom line is the output):

-
Will it simplify complex expressions? –  Anixx May 21 '12 at 2:37
what sort of expressions do you have in mind? Have you tried it with your expressions? You should add such info to the question before posting. –  The Toad May 21 '12 at 2:38
@Anixx: why not try it out yourself? BTW: you didn't mention if associativity is a property of your algebra... –  Guess who it is. May 21 '12 at 2:39
I wonder whether it will derive associativity ans distributivity laws itself. –  Anixx May 21 '12 at 2:41
the tables I provided are enough for such derivation. –  Anixx May 21 '12 at 2:42

Since your addition and multiplication have the usual properties (associativity, commutativity, distributivity), another option is to use normal plus and times, but different symbols, e.g. zero, one and inf for your elements. Then you can write:

zero + x_ ^= x;
inf + x_ ^= inf;
one + one ^= one;
zero * zero ^= zero;
zero * inf ^= one;
one * x_ ^= x;
one * inf ^= inf;
inf * inf ^= inf;

Then you have

{zero + zero, one + zero, zero + inf, one + inf, inf + inf, zero * zero,
one * zero, one * one, zero * inf, one * inf, inf * inf}
(*
==> {zero, one, inf, inf, inf, zero, zero, one, one, inf, inf}
*)

-
If one takes this route, symbols like \[ScriptZero] and \[ScriptOne] might be useful. –  Guess who it is. May 21 '12 at 11:04
In both methods the computer does not derive distributivity and associativity itself, –  Anixx May 21 '12 at 13:18
@Anixx: I just tried with my method (a+b)*one == a*one+b*one //Simplify and got True as expected. And associativity should be automatic due to Plus and Times having attribute Flat. The same is true for commutativity and Orderless. Do you have a concrete example that fails? –  celtschk May 21 '12 at 14:25


text:
## Clustering-based redshift estimation: application to VIPERS/CFHTLS

 Authors: V. Scottez, Y. Mellier, B. Granett, T. Moutard, M. Kilbinger et al. Journal: MNRAS Year: 2016 Download: ADS | arXiv

## Abstract

We explore the accuracy of the clustering-based redshift estimation proposed by Ménard et al. when applied to VIMOS Public Extragalactic Redshift Survey (VIPERS) and Canada-France-Hawaii Telescope Legacy Survey (CFHTLS) real data. This method enables us to reconstruct redshift distributions from measurement of the angular clustering of objects using a set of secure spectroscopic redshifts. We use state-of-the-art spectroscopic measurements with iAB < 22.5 from the VIPERS as reference population to infer the redshift distribution of galaxies from the CFHTLS T0007 release. VIPERS provides a nearly representative sample to a flux limit of iAB < 22.5 at a redshift of >0.5 which allows us to test the accuracy of the clustering-based redshift distributions. We show that this method enables us to reproduce the true mean colour-redshift relation when both populations have the same magnitude limit. We also show that this technique allows the inference of redshift distributions for a population fainter than the reference and we give an estimate of the colour-redshift mapping in this case. This last point is of great interest for future large-redshift surveys which require a complete faint spectroscopic sample.

# First round of papers published

The XXL Survey is a deep X-ray survey observed with the XMM satellite, covering two fields of 25 deg2 each. Observations in many other wavelength, from radio to IR and optical, in both imaging and spectroscopy, complement the survey. The main science case is cosmology with X-ray selected galaxy clusters, but other fields such as galaxy evolution, AGNs, cluster physics, and the large-scale structure are being studied.

The main paper (Paper I) describing the survey and giving an overview of the science is arXiv:1512.04317 (Pierre et al. 2015). Paper IV (arxiv.org:1512.03857, Lieu et al. 2015) presents weak-lensing mass measurements of the brightest clusters in the Northern field, using CFHTLenS shapes and photometric redshifts.

## Abstract

Peak counts have been shown to be an excellent tool to extract the non-Gaussian part of the weak lensing signal. Recently, we developped a fast stochastic forward model to predict weak-lensing peak counts. Our model is able to reconstruct the underlying distribution of observables for analyses. In this work, we explore and compare various strategies for constraining parameter using our model, focusing on the matter density Ωm and the density fluctuation amplitude σ8. First, we examine the impact from the cosmological dependency of covariances (CDC). Second, we perform the analysis with the copula likelihood, a technique which makes a weaker assumption compared to the Gaussian likelihood. Third, direct, non-analytic parameter estimations are applied using the full information of the distribution. Fourth, we obtain constraints with approximate Bayesian computation (ABC), an efficient, robust, and likelihood-free algorithm based on accept-reject sampling. We find that neglecting the CDC effect enlarges parameter contours by 22%, and that the covariance-varying copula likelihood is a very good approximation to the true likelihood. The direct techniques work well in spite of noisier contours. Concerning ABC, the iterative process converges quickly to a posterior distribution that is in an excellent agreement with results from our other analyses. The time cost for ABC is reduced by two orders of magnitude. The stochastic nature of our weak-lensing peak count model allows us to use various techniques that approach the true underlying probability distribution of observables, without making simplifying assumptions. Our work can be generalized to other observables where forward simulations provide samples of the underlying distribution.

## Abstract

We present weak lensing constraints on the ellipticity of galaxy-scale matter haloes and the galaxy-halo misalignment. Using data from the Canada-France-Hawaii Telescope Lensing Survey (CFHTLenS), we measure the weighted-average ratio of the aligned projected ellipticity components of galaxy matter haloes and their embedded galaxies,

$f_\mathrm{h}$

, split by galaxy type. We then compare our observations to measurements taken from the Millennium Simulation, assuming different models of galaxy-halo misalignment. Using the Millennium Simulation we verify that the statistical estimator used removes contamination from cosmic shear. We also detect an additional signal in the simulation, which we interpret as the impact of intrinsic shape-shear alignments between the lenses and their large-scale structure environment. These alignments are likely to have caused some of the previous observational constraints on

$f_\mathrm{h}$

to be biased high. From CFHTLenS we find

$f_\mathrm{h}=-0.04 \pm 0.25$

for early-type galaxies, which is consistent with current models for the galaxy-halo misalignment predicting

$f_\mathrm{h}\simeq 0.20$

. For late-type galaxies we measure

$f_\mathrm{h}=0.69_{-0.36}^{+0.37}$

from CFHTLenS. This can be compared to the simulated results which yield

$f_\mathrm{h}\simeq 0.02$

for misaligned late-type models.

## CFHTLenS: A Gaussian likelihood is a sufficient approximation for a cosmological analysis of third-order cosmic shear statistics

 Authors: P. Simon, ... , M. Kilbinger,  et al. Journal: MNRAS Year: 2015 Download: ADS | arXiv

## Abstract

We study the correlations of the shear signal between triplets of sources in the Canada-France-Hawaii Lensing Survey (CFHTLenS) to probe cosmological parameters via the matter bispectrum. In contrast to previous studies, we adopted a non-Gaussian model of the data likelihood which is supported by our simulations of the survey. We find that for state-of-the-art surveys, similar to CFHTLenS, a Gaussian likelihood analysis is a reasonable approximation, albeit small differences in the parameter constraints are already visible. For future surveys we expect that a Gaussian model becomes inaccurate. Our algorithm for a refined non-Gaussian analysis and data compression is then of great utility especially because it is not much more elaborate if simulated data are available. Applying this algorithm to the third-order correlations of shear alone in a blind analysis, we find a good agreement with the standard cosmological model: Σ8=σ8 (Ωm/0.27)0.64=0.79+0.080.11 for a flat ΛCDMcosmology with h=0.7±0.04 (68% credible interval). Nevertheless our models provide only moderately good fits as indicated by χ2/dof=2.9, including a 20% r.m.s. uncertainty in the predicted signal amplitude. The models cannot explain a signal drop on scales around 15 arcmin, which may be caused by systematics. It is unclear whether the discrepancy can be fully explained by residual PSF systematics of which we find evidence at least on scales of a few arcmin. Therefore we need a better understanding of higher-order correlations of cosmic shear and their systematics to confidently apply them as cosmological probes.

## Review: Cosmology from cosmic shear observations

Martin Kilbinger, CEA Saclay, Service d'Astrophysique (SAp), France

Find on this page general information and updates for my recent review article (arXiv:1411.0155) on cosmic shear, Reports on Progress in Physics 78 (2015) 086901 (ads link for two-column format).

Fig. 7 of the review article: The quantity $\Sigma = \sigma_8 \left( \Omega_{\rm m}/0.3 \right)^\alpha$ as function of publication year.

Updated figure!
02/2015: Added Stripe-82 and CFHTLenS peak counts
06/2016: Added DLS, two more CFHTLenS analyses, DES-SV peak counts, and KiDS-450.
08/2017: Added DES-Y1, and another KiDS-450 result.
12/2017: Added more KiDS-450 and DES-Y1 results (peak counts, lensing+clustering, density-split statistic).

In the video abstract of the article I talk about cosmic shear and the review for a broader audience.

General papers, new reviews.

• Another weak-lensing review has been published by my colleagues Liping Fu and Zu-Hui Fan (behind a pay wall, not available on the arXiv).
• Rachel Mandelbaum's short, pedagogical review to instrumental systematics and WL

Sect. 2: Cosmological background

Sect. 5: Measuring weak lensing

• News on ensemble shape measurement methods:
An implementation of the Bernstein & Armstrong (2014) Bayesian shape method has been published at arXiv:1403.7669. The team that participated at the great3 challenge with the Bayesian inference method "MBI" published their pipeline and results paper, see arXiv:1411.2608.
• Okura & Futamase (arXiv:1405.1539) came up with an estimator of ellipticity that uses 0th instead of 2nd-order moments!
• arXiv:1409.6273 discusses atmospheric chromatic effects for LSST.
• Dust in spiral galaxies  as source of shape bias, but also astrophysical probe: arXiv:1411.6724.

Scripts

Fig. 3 (b), derivatives of the convergence power spectrum with respect to various cosmological parameters.
cs_review_scripts.tgz.

Last updated 22 July 2015.

## Abstract

Weak-lensing peak counts has been shown to be a powerful tool for cosmology. It provides non-Gaussian information of large scale structures, complementary to second order statistics. We propose a new flexible method to predict weak lensing peak counts, which can be adapted to realistic scenarios, such as a real source distribution, intrinsic galaxy alignment, mask effects, photo-z errors from surveys, etc. The new model is also suitable for applying the tomography technique and non-linear filters. A probabilistic approach to model peak counts is presented. First, we sample halos from a mass function. Second, we assign them NFW profiles. Third, we place those halos randomly on the field of view. The creation of these "fast simulations" requires much less computing time compared to N-body runs. Then, we perform ray-tracing through these fast simulation boxes and select peaks from weak-lensing maps to predict peak number counts. The computation is achieved by our \textsc{Camelus} algorithm, which we make available at this http URL . We compare our results to N-body simulations to validate our model. We find that our approach is in good agreement with full N-body runs. We show that the lensing signal dominates shape noise and Poisson noise for peaks with SNR between 4 and 6. Also, counts from the same SNR range are sensitive to Ωm and σ8. We show how our model can discriminate between various combinations of those two parameters. In summary, we offer a powerful tool to study weak lensing peaks. The potential of our forward model is its high flexibility, making the use of peak counts under realistic survey conditions feasible.

## Abstract

We present new constraints on the relationship between galaxies and their host dark matter halos, measured from the location of the peak of the stellar-to-halo mass ratio (SHMR), up to the most massive galaxy clusters at redshift

$z\sim0.8$

and over a volume of nearly 0.1~Gpc

$^3$

. We use a unique combination of deep observations in the CFHTLenS/VIPERS field from the near-UV to the near-IR, supplemented by

$\sim60\,000$

secure spectroscopic redshifts, analysing galaxy clustering, galaxy-galaxy lensing and the stellar mass function. We interpret our measurements within the halo occupation distribution (HOD) framework, separating the contributions from central and satellite galaxies. We find that the SHMR for the central galaxies peaks at

$M_{\rm h, peak} = 1.9^{+0.2}_{-0.1}\times10^{12} M_{\odot}$

with an amplitude of

$0.025$

, which decreases to

$\sim0.001$

for massive halos (

$M_{\rm h} > 10^{14} M_{\odot}$

). Compared to central galaxies only, the total SHMR (including satellites) is boosted by a factor 10 in the high-mass regime (cluster-size halos), a result consistent with cluster analyses from the literature based on fully independent methods. After properly accounting for differences in modelling, we have compared our results with a large number of results from the literature up to

$z=1$

: we find good general agreement, independently of the method used, within the typical stellar-mass systematic errors at low to intermediate mass (

${M}_{\star} < 10^{11} M_{\odot}$

) and the statistical errors above. We have also compared our SHMR results to semi-analytic simulations and found that the SHMR is tilted compared to our measurements in such a way that they over- (under-) predict star formation efficiency in central (satellite) galaxies.

## Abstract

Weak-lensing peak counts has been shown to be a powerful tool for cosmology. It provides non-Gaussian information of large scale structures, complementary to second order statistics. We propose a new flexible method to predict weak lensing peak counts, which can be adapted to realistic scenarios, such as a real source distribution, intrinsic galaxy alignment, mask effects, photo-z errors from surveys, etc. The new model is also suitable for applying the tomography technique and non-linear filters. A probabilistic approach to model peak counts is presented. First, we sample halos from a mass function. Second, we assign them NFW profiles. Third, we place those halos randomly on the field of view. The creation of these "fast simulations" requires much less computing time compared to N-body runs. Then, we perform ray-tracing through these fast simulation boxes and select peaks from weak-lensing maps to predict peak number counts. The computation is achieved by our \textsc{Camelus} algorithm, which we make available at this http URL. We compare our results to N-body simulations to validate our model. We find that our approach is in good agreement with full N-body runs. We show that the lensing signal dominates shape noise and Poisson noise for peaks with SNR between 4 and 6. Also, counts from the same SNR range are sensitive to Ωm and σ8. We show how our model can discriminate between various combinations of those two parameters. In summary, we offer a powerful tool to study weak lensing peaks. The potential of our forward model is its high flexibility, making the use of peak counts under realistic survey conditions feasible.

## Summary

A new, probabilistic model for weak-lensing peak counts is being proposed in this first paper of a series of three. The model is based on drawing halos from the mass function and, via ray-tracing, generating weak-lensing maps to count peaks. These simulated maps can directly be compared to observations, making this a forward-modelling approach of the cluster mass function, in contrast to many other traditional methods using cluster probes such as X-ray, optical richness, or SZ observations.

The model prediction is in very good agreement with N-body simulations.

It is very flexible, and can potentially include astrophysical and observational effects, such as intrinsic alignment, halo triaxiality, masking, photo-z errors, etc. Moreover, the pdf of the number of peaks can be output by the model, allowing for a very general likelihood calculation, without e.g. assuming a Gaussian distribution of the observables.

## 3D Cosmic Shear: Cosmology from CFHTLenS

 Authors: T. D. Kitching, ... , M. Kilbinger, et al. Journal: MNRAS Year: 2014 Download: ADS | arXiv

## Abstract

This paper presents the first application of 3D cosmic shear to a wide-field weak lensing survey. 3D cosmic shear is a technique that analyses weak lensing in three dimensions using a spherical harmonic approach, and does not bin data in the redshift direction. This is applied to CFHTLenS, a 154 square degree imaging survey with a median redshift of 0.7 and an effective number density of 11 galaxies per square arcminute usable for weak lensing. To account for survey masks we apply a 3D pseudo-Cl approach on weak lensing data, and to avoid uncertainties in the highly non-linear regime, we separately analyse radial wave numbers k<=1.5h/Mpc and k<=5.0h/Mpc, and angular wavenumbers l~400-5000. We show how one can recover 2D and tomographic power spectra from the full 3D cosmic shear power spectra and present a measurement of the 2D cosmic shear power spectrum, and measurements of a set of 2-bin and 6-bin cosmic shear tomographic power spectra; in doing so we find that using the 3D power in the calculation of such 2D and tomographic power spectra from data naturally accounts for a minimum scale in the matter power spectrum. We use 3D cosmic shear to constrain cosmologies with parameters OmegaM, OmegaB, sigma8, h, ns, w0, wa. For a non-evolving dark energy equation of state, and assuming a flat cosmology, lensing combined with WMAP7 results in h=0.78+/-0.12, OmegaM=0.252+/-0.079, sigma8=0.88+/-0.23 and w=-1.16+/-0.38 using only scales k<=1.5h/Mpc. We also present results of lensing combined with first year Planck results, where we find no tension with the results from this analysis, but we also find no significant improvement over the Planck results alone. We find evidence of a suppression of power compared to LCDM on small scales 1.5 < k < 5.0 h/Mpc in the lensing data, which is consistent with predictions of the effect of baryonic feedback on the matter power spectrum.


text:
# Integration by substitution MkII

• January 2nd 2009, 01:34 AM
Beard
Integration by substitution MkII
Here it is

$\int_{0}^{\frac{\pi}{4}} \sin^3(2x)\cos^2(2x)\ where\ the\ sustitution\ is\ u = \cos(2x)$

$\frac{du}{dx} = -\frac{1}{2}\sin(2x)$

which means

$-2\sin^2(2x)u^2.du$

I get stuck here
• January 2nd 2009, 01:44 AM
flyingsquirrel
Hello,
Quote:

Originally Posted by Beard
which means

$-2\sin^2(2x)u^2.du$

I get stuck here

Now you have to find an expression of $\sin^2(2x)$ in terms of $u$ (recall that $\sin^2\theta=1-\cos^2\theta$).
• January 2nd 2009, 02:09 AM
tom@ballooncalculus
Just in case it appeals...

http://www.ballooncalculus.org/cosSub.png

This is only an overview - the lower equality relies on the pythag identity.

Balloon Calculus: worked examples from past papers


text:
## Dealing with mass, acceleration and velocity

1. The problem statement, all variables and given/known data
Problem: A person wearing a seatbelt can withstand an acceleration of -0.030 m/s2. How thick should barriers be to safely stop a car that hits a barrier at 110 km/h?

2. Relevant equations
F=m*a?

3. The attempt at a solution
I so far have no attempt. I do not know what sort of formula can be used or what type of problem it is ie. constant velocity, displacement, friction so on. The sort of help that I need is a possible formula you might know of or even what kind of problem this is.
 PhysOrg.com science news on PhysOrg.com >> City-life changes blackbird personalities, study shows>> Origins of 'The Hoff' crab revealed (w/ Video)>> Older males make better fathers: Mature male beetles work harder, care less about female infidelity
 Blog Entries: 4 Recognitions: Gold Member I think the key formula is, with a=acceleration, v=initial speed, t=time and s=distance, $$s = \frac{1}{2}at^2 + vt$$ Assume the barrier applies a constant deceleration.
 Thank you Mentz114. That is very helpful! I'll try the problem using that formula now. Thanks again!

 Similar discussions for: Dealing with mass, acceleration and velocity Thread Forum Replies Introductory Physics Homework 2 Introductory Physics Homework 1 Introductory Physics Homework 2 Introductory Physics Homework 3