text:
# 内存管理：内存分配器-slub调试

slub内存分配器是目前linux kernel中最常用的分配器，它基于slab分配器改造而来，保留了slab的设计思想、大部分的数据结构、完整的API接口，摒弃了slab的着色机制、优化了slab的管理数据结构，比slab更加简单和高效，目前已经取代slab分配器成为kernel的默认分配器。
Kernel中大部分动态的内存分配都来自slub分配器，分析kernel层面内存踩踏问题，几乎无法避免slub的调试功能。

## SOURCE CODE TREE

/kernel/mm/slab.h : 三个分配器本地公共头文件
/kernel/mm/slab_common.c : 三个分配器公共源码
/kernel/mm/slab.c : slab分配器源码，最开始出现的分配器，是另外两个的基础
/kernel/mm/slub.c : slub分配器源码，当前主流首选分配器
/kernel/mm/slob.c : slob分配器源码，主要适用于内存有限的嵌入式设备
/kernel/include/linux/slub_def.h : slab分配器对外头文件
/kernel/include/linux/slab_def.h : slub分配器对外头文件
/kernel/include/linux/slab.h : 三个分配器公共对外头文件，提供对外接口
/kernel/include/linux/poison.h : 其中定义了slab debug用的内存填充值

## MECHANISM

### 数据结构

 1 2 if (unlikely(s->flags & SLAB_POISON)) memset(start, POISON_INUSE, PAGE_SIZE << order);

② redzone区域：

③ object区域：

TODO

## RUNNING DEBUG

### Debug Feature

Feature的特点
[动态/静态] - slub可以动态开/关该feature而不必重新编译kernel（此时一般slub的调试feature默认是关闭状态），也可以静态开启该feature；而相比之下，slab开启调试则需要重新编译kernel

Tips:
1. All options can be set on a slab that does not contain objects.
2. If the slab already contains objects then sanity checks and tracing may only be enabled. The other options may cause the realignment of objects.
3. 以上，基本上可以通过尝试用echo修改"运行时debug节点"小节各个节点的值来确认，不能修改的一定是无法动态开关的

[非耦合] - slub可以只针对选中的某个slab cache开/关调试，而不影响其它slab cache的运行
Feature的开启
[on runtime] - 可在/sys/kernel/slab/<slab name>路径动态开启

• 具体见下面"运行时debug节点"
• echo值（0，1，其它）到对应的节点下

[on compile] - 可在编译时通过CONFIG_SLUB_DEBUG_ON开启

• 具体见下面"CONFIG_SLUB_DEBUG_ON"一节

[on boot] - 也可在kernel command line可携带字符串参数开启

• "slub_debug" : 为所有slab cache开启全部的debug选项
• "slub_debug=<Debug-Options>" : 为所有slub cache开启该选项
• "slub_debug=<Debug-Options>,<slab name>" : 为选中的slub cache开启该选项
Debug-Options description
F Sanity checks on (enables SLAB_DEBUG_CONSISTENCY_CHECKS Sorry SLAB legacy issues)
Z Red zoning
U User tracking (free and alloc)
T Trace (please only use on single slabs)
A Toggle failslab filter mark for the cache
O Switch debugging off for caches that would have caused higher minimum slab orders
- Switch all debugging off (useful if the kernel is configured with CONFIG_SLUB_DEBUG_ON)
例如：
slub_debug=FZ : to boot just with sanity checks and red zoning
slub_debug=,dentry : to find an issue in the dentry cache

### Debug Tools

slabinfo的使用
[编译] - 默认编译kernel时，并不编译该工具，需要可以自行编译

• 代码路径：/kernel/tools/vm/slabinfo.c
• 编译 $(CROSS_COMPILE)gcc -Wall -Wextra -I../lib/ -o slabinfo slabinfo.c ../lib/api/libapi.a Tips：或者直接cd到代码目录下设置好CROSS_COMPILE变量后 make slabinfo [使用] - 可以获取slub cahe的统计数据，以及对slub cache的debug节点执行操，如Tips：通过slabinfo -h查看具体用法 • 默认情况命令只返回有数据的slub cache的信息 • 其中某些命令的执行，需要在kernel command line中开启slub debug.比如：未开启slab debug on时，获取不到stack tracking的信息 例如： ace.an@tjandroid02:~/sprdroid8.1_trunk/kernel/tools/vm$ ./slabinfo -h
slabinfo 4/15/2011. (c) 2007 sgi/(c) 2011 Linux Foundation.

slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]
-a|--aliases           Show aliases
-A|--activity          Most active slabs first
-d<options>|--debug=<options> Set/Clear Debug options
-D|--display-active    Switch line format to activity
-e|--empty             Show empty slabs
-f|--first-alias       Show first alias
-h|--help              Show usage information
-i|--inverted          Inverted list
-l|--slabs             Show slabs
-n|--numa              Show NUMA information
-o|--ops                Show kmem_cache_ops
-s|--shrink            Shrink slabs
-r|--report             Detailed report on single slabs
-S|--Size              Sort by size
-t|--tracking          Show alloc/free information
-T|--Totals            Show summary information
-v|--validate          Validate slabs
-z|--zero              Include empty slabs
-1|--1ref              Single reference
-N|--lines=K           Show the first K slabs
-L|--Loss              Sort by loss
-X|--Xtotals           Show extended summary information
-B|--Bytes             Show size in bytes

Valid debug options (FZPUT may be combined)
a / A          Switch on all debug options (=FZUP)
-              Switch off all debug options
f / F          Sanity Checks (SLAB_DEBUG_FREE)
z / Z          Redzoning
p / P          Poisoning
u / U          Tracking
t / T          Tracing

### Slab Cache Debug Node

/sys/kernel/slab

• The /sys/kernel/slab directory contains a snapshot of the internal state of the SLUB allocator for each cache.
• Certain files may be modified to change the behavior of the cache (and any cache it aliases, if any).

Tips: 有该目录表示开启 slub分配器，该目录下各种目录都是并行的不同类型的slub分配器

/sys/kernel/slab/<slab name>/aliases

• The aliases file is read-only and specifies how many caches have merged into this cache.

/sys/kernel/slab/<slab name>/align

• The align file is read-only and specifies the cache's object alignment in bytes.

/sys/kernel/slab/<slab name>/alloc_calls

• The alloc_calls file is read-only and lists the kernel code locations from which allocations for this cache were performed.
• The alloc_calls file only contains information if debugging is enabled for that cache (see Documentation/vm/slub.txt).

/sys/kernel/slab/<slab name>/alloc_fastpath

• The alloc_fastpath file shows how many objects have been allocated using the fast path.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/alloc_from_partial

• The alloc_from_partial file shows how many times a cpu slab has been full and it has been refilled by using a slab from the list of partially used slabs.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/alloc_refill

• The alloc_refill file shows how many times the per-cpu freelist was empty but there were objects available as the result of remote cpu frees.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/alloc_slab

• The alloc_slab file is shows how many times a new slab had to be allocated from the page allocator.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/alloc_slowpath

• The alloc_slowpath file shows how many objects have been allocated using the slow path because of a refill or allocation from a partial or new slab.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/cache_dma

• The cache_dma file is read-only and specifies whether objects are from ZONE_DMA.
• Available when CONFIG_ZONE_DMA is enabled.

/sys/kernel/slab/<slab name>/cpu_slabs

• The cpu_slabs file is read-only and displays how many cpu slabs are active and their NUMA locality.

/sys/kernel/slab/<slab name>/cpuslab_flush

• The file cpuslab_flush shows how many times a cache's cpu slabs have been flushed as the result of destroying or shrinking a cache, a cpu going offline, or as the result of forcing an allocation from a certain node.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/ctor

• The ctor file is read-only and specifies the cache's object constructor function, which is invoked for each object when a new slab is allocated.

/sys/kernel/slab/<slab name>/deactivate_empty

• The deactivate_empty file shows how many times an empty cpu slab was deactivated.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/deactivate_full

• The deactivate_full file shows how many times a full cpu slab was deactivated.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/deactivate_remote_frees

• The deactivate_remote_frees file shows how many times a cpu slab has been deactivated and contained free objects that were freed remotely.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

• The deactivate_to_head file shows how many times a partial cpu slab was deactivated and added to the head of its node's partial list.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/deactivate_to_tail

• The deactivate_to_tail file shows how many times a partial cpu slab was deactivated and added to the tail of its node's partial list.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/destroy_by_rcu

• The destroy_by_rcu file is read-only and specifies whether slabs (not objects) are freed by rcu.

• The free_add_partial file shows how many times an object has been freed in a full slab so that it had to added to its node's partial list.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/free_calls

• The free_calls file is read-only and lists the locations of object frees if slab debugging is enabled (see Documentation/vm/slub.txt).

/sys/kernel/slab/<slab name>/free_fastpath

• The free_fastpath file shows how many objects have been freed using the fast path because it was an object from the cpu slab.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/free_frozen

• The free_frozen file shows how many objects have been freed to a frozen slab (i.e. a remote cpu slab).
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/free_remove_partial

• The free_remove_partial file shows how many times an object has been freed to a now-empty slab so that it had to be removed from its node's partial list.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/free_slab

• The free_slab file shows how many times an empty slab has been freed back to the page allocator.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/free_slowpath

• The free_slowpath file shows how many objects have been freed using the slow path (i.e. to a full or partial slab).
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/hwcache_align

• The hwcache_align file is read-only and specifies whether objects are aligned on cachelines.

/sys/kernel/slab/<slab name>/min_partial

• The min_partial file specifies how many empty slabs shall remain on a node's partial list to avoid the overhead of allocating new slabs.
• Such slabs may be reclaimed by utilizing the shrink file.

/sys/kernel/slab/<slab name>/object_size

• The object_size file is read-only and specifies the cache's object size.

/sys/kernel/slab/<slab name>/objects

• The objects file is read-only and displays how many objects are active and from which nodes they are from.

/sys/kernel/slab/<slab name>/objects_partial

• The objects_partial file is read-only and displays how many objects are on partial slabs and from which nodes they are from.

/sys/kernel/slab/<slab name>/objs_per_slab

• The file objs_per_slab is read-only and specifies how many objects may be allocated from a single slab of the order specified in /sys/kernel/slab/cache/order.

/sys/kernel/slab/<slab name>/order

• The order file specifies the page order at which new slabs are allocated.
• It is writable and can be changed to increase the number of objects per slab.
• If a slab cannot be allocated because of fragmentation, SLUB will retry with the minimum order possible depending on its characteristics.
• When debug_guardpage_minorder=N (N > 0) parameter is specified (see Documentation/admin-guide/kernel-parameters.rst), the minimum possible order is used and this sysfs entry can not be used to change the order at run time.

/sys/kernel/slab/<slab name>/order_fallback

• The order_fallback file shows how many times an allocation of a new slab has not been possible at the cache's order and instead fallen back to its minimum possible order.
• It can be written to clear the current count.
• Available when CONFIG_SLUB_STATS is enabled.

/sys/kernel/slab/<slab name>/partial

• The partial file is read-only and displays how long many partial slabs there are and how long each node's list is.

/sys/kernel/slab/<slab name>/poison

• The poison file specifies whether objects should be poisoned when a new slab is allocated.

/sys/kernel/slab/<slab name>/reclaim_account

• The reclaim_account file specifies whether the cache's objects are reclaimable (and grouped by their mobility).

/sys/kernel/slab/<slab name>/red_zone

• The red_zone file specifies whether the cache's objects are red zoned.

/sys/kernel/slab/<slab name>/remote_node_defrag_ratio

• The file remote_node_defrag_ratio specifies the percentage of times SLUB will attempt to refill the cpu slab with a partial slab from a remote node as opposed to allocating a new slab on the local node.
• This reduces the amount of wasted memory over the entire system but can be expensive.
• Available when CONFIG_NUMA is enabled.

/sys/kernel/slab/<slab name>/sanity_checks

• The sanity_checks file specifies whether expensive checks should be performed on free and, at minimum, enables double free checks.
• Caches that enable sanity_checks cannot be merged with caches that do not.

/sys/kernel/slab/<slab name>/shrink

• The shrink file is written when memory should be reclaimed from a cache.
• Empty partial slabs are freed and the partial list is sorted so the slabs with the fewest available objects are used first.

/sys/kernel/slab/<slab name>/slab_size

• The slab_size file is read-only and specifies the object size with metadata (debugging information and alignment) in bytes.

/sys/kernel/slab/<slab name>/slabs

• The slabs file is read-only and displays how long many slabs there are (both cpu and partial) and from which nodes they are from.

/sys/kernel/slab/<slab name>/store_user

• The store_user file specifies whether the location of allocation or free should be tracked for a cache.

/sys/kernel/slab/<slab name>/total_objects

• The total_objects file is read-only and displays how many total objects a cache has and from which nodes they are from.

/sys/kernel/slab/<slab name>/trace

• The trace file specifies whether object allocations and frees should be traced.

/sys/kernel/slab/<slab name>/validate

• Writing to the validate file causes SLUB to traverse all of its cache's objects and check the validity of metadata.

### Debug Output

Output数据模板

===============================================
BUG <slab cache affected>: <What went wrong>
-----------------------------------------------

INFO: Allocated in <kernel function> age=<jiffies since alloc> cpu=<allocated by cpu> pid=<pid of the process>
INFO: Freed in <kernel function> age=<jiffies since free> cpu=<freed by cpu> pid=<pid of the process>

stackdump

FIX <slab cache affected>: <corrective action taken>

Tips:
1. Object allocation / free information is only available if SLAB_STORE_USER is set for the slab. slub_debug sets that option.
2. Redzone information is only available if SLAB_RED_ZONE is set.

Output数据解析

[头部] - INFO区域

• 这个区域的每一行以INFO起始，基本描述都在上面output模板中标记清晰

[中间] - 内存区域

• Bytes b4：Object区域开始前一小部分内存区域，现在kernel已经用Redzone区域替代了
• Redzone：保护区，在free时填充bb，在malloc时填充cc

[中间] - 调用栈区域

• 出现错误时函数调用栈

[尾部] - 问题自动处理区域

• 为了系统继续运行，slub会尝试修复被覆盖的区域，然后正常跑后续流程。注意并不是每种情况下都能修复被覆盖的内存。
例如：

## CONFIG_SLUB_DEBUG_ON

[依赖] - 如下2个配置选项

• CONFIG_SLUB
• CONFIG_SLUB_DEBUG

feature

feature

feature

## OTHERS

feature

### 参考文档

@2018-01-29 15:55


text:
square alignment of prepositions

I would like to mirror this format of alignment, looks like a matrix but has no brackets.

maybe start a column exception?

• Is it only about the alignment or also about the content? Because the alignment is simply a \begin{array}{*{4}{cl}} or similar. – campa Mar 9 at 15:23
• @campa ty hehe I'm new to LaTeX, about the content I've managed to do '''\textcircled{\raisebox{-0.9pt}{etc}}''' , mhm, but how would I sort them through the columns? I only know of arrays like [ \left( \begin{array}{ccc} x \\ y\\ z \end{array} \right)] and such – Bruno Stühler Mar 9 at 15:30
• Does this help? Auto-numbering table environment with aligned numbers. BTW, what do you mean by 'prepositions' (Präposition auf Deutsch)? – Alan Munn Mar 9 at 15:33
• @AlanMunn yeah I'm not really looking for a table but ty, and unfortunately it's not from german xD well a mathematical preposition would be x>0, 2 isn't a prime number... I get lost at titles hehe – Bruno Stühler Mar 9 at 15:58
• If you're using this for exam/worksheet questions, then perhaps the tasks package might be of some help. There are various ways to make circled numbers. See Good way to make \textcircled numbers? – Alan Munn Mar 9 at 16:29

Perhaps something like this is what you want. Adapted from the answers linked in the comments. (The one about numbering used the tabu package, which I don't recommend, and it's not relevant to the numbering issue.)

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{array}
\usepackage{etoolbox}
\newcounter{cellnum}
\renewcommand{\thecellnum}{\textcircled{\raisebox{-.9pt}{\arabic{cellnum}}}}

\newcolumntype{N}{>{\stepcounter{cellnum}\makebox[1em][r]{\thecellnum}\hspace{0.5em}}l}
\AtBeginEnvironment{array}{\setcounter{cellnum}{-1}} % set to 0 to start at 1

\begin{document}
$\begin{array}{NNNN} 2 & 5 & -2 & -5 \\ a \geqq 2 & a \geqq 3 & a \geqq 4 \end{array}$

$\begin{array}{NNNN} 2 & 5 & -2 & -5 \\ a \geqq 2 & a \geqq 3 & a \geqq 4 \end{array}$
\end{document}

format: plain


text:
# Bisectors of angles made by intersection of vectors

Find point of intersection and the bisectors of the angles made by line $k$ passing through point $(3, -1)$ with direction vector $-\vec i + 2\vec j$ and line $l$ passing through point $(-2, 5)$ with direction vector $3\vec i - 2j$.

Assuming the lines intersect I went about finding the point of intersection like so,

Direction vector of line $k$ and $l$,

$$m_k = (-1, 2), m_l = (3, -2)$$

Vector equation of line $k$ is,

$$r_k = (3, -1) + \lambda (-1, 2) = (-\lambda + 3, 2 \lambda - 1)$$

And Vector equation of line $l$ is,

$$r_l = (-2, 5) + \mu (3, -2) = (-2 + 3\mu, 5 - 2\mu)$$

At intersection,

$$(-\lambda + 3, 2 \lambda - 1) = (-2 + 3\mu, 5 - 2\mu)$$

Which gives the 2 equations,

$$\lambda + 3\mu = 5$$ $$\lambda + \mu = 3$$

Solving for $\lambda$ and $\mu$ gives,

$\lambda = 2, \mu = 1$

And thus the point of intersection is $(1, 1)$

The next part of the problem is eluding me. I figured that if the quadrilateral formed by the direction vectors was a rhombus/kite, the angle bisectors would be the diagonals ie:- $m_k + m_l$ and $m_k - m_l$. But the magnitude of $m_k$ and $m_l$ are $\sqrt{5}$ and $\sqrt{13}$ respectively. So that idea doesn't work.

How do i find the equation of the bisectors?

As always, thanks for all your help, Much appreciated!

-
What are the vector equations of your lines $k$ and $l$ when you normalize the given direction vectors such that they have length $1$? –  Christian Blatter Jul 24 '11 at 14:50
@Christian I am not sure how to do normalize to 1. I normalized the vectors to $m_k = \dfrac{-\vec i + 2\vec j}{\sqrt 5}$ and $m_l = \dfrac{3\vec i - 2\vec j}{\sqrt{13}}$ –  mathguy80 Jul 24 '11 at 15:26
Your calculation is correct except for the very end; substituting the values you got for $\lambda$ and $\mu$ into vector equations of the lines yields $(1,3)$. (Perhaps you substituted $1$ for $\lambda$ and $2$ for $\mu$ in calculating the $y$ component?) Regarding the bisectors, you should be able to find them like you wrote, using the normalized direction vectors instead of the unnormalized ones. –  joriki Jul 24 '11 at 15:47
Your new vectors $m_k=({-1\over\sqrt{5}},{2\over\sqrt{5}})$ and $m_l=\ldots$ have length 1, so they form a kite, as you say. –  Christian Blatter Jul 24 '11 at 15:49
@joriki, Yes I messed that up at the very end. I understand now what Christian was saying about normalize to 1. I was thinking of the magnitude of the direction vector not the unit direction vector. –  mathguy80 Jul 24 '11 at 15:56

The point of intersection is $(1, 3)$. The unit direction vectors then are,

\begin{align} m_k &= \dfrac{\vec m_k}{|m_k|} &= \dfrac{-\vec i + 2\vec j}{\sqrt 5} \\ m_l &= \dfrac{\vec m_l}{|m_l|} &= \dfrac{3\vec i - 2\vec j}{\sqrt{13}} \end{align}

Then the quadrilateral formed with the unit direction vectors is a rhombus of unit length, whose diagonals are also its angle bisectors.

Thus, the angle bisectors are,

$$m_k + m_l = \left(\dfrac{-1}{\sqrt 5} + \dfrac{3}{\sqrt{13}}\right)\vec i + \left(\dfrac{2}{\sqrt 5} - \dfrac{2}{\sqrt{13}}\right) \vec j$$

$$m_k - m_l = \left(\dfrac{-1}{\sqrt 5} - \dfrac{3}{\sqrt{13}}\right)\vec i + \left(\dfrac{2}{\sqrt 5} + \dfrac{2}{\sqrt{13}}\right) \vec j$$

-


text:
# Variational Principles: Lagrange Multipliers

I am trying to minimize the functional

$$I[\textbf{x}] = \int ||\dot{\textbf{x}}||^2 dt$$

subject to the constraint $\textbf{x}(t) \in \{\textbf{s} \in \mathbb{R}^3 : ||\textbf{s}|| = 1 \}$. The question states:

Use the Lagrange multiplier function formalism to obtain the following Euler-Lagrange equation: $$\ddot{\textbf{x}} + ||\dot{\textbf{x}}||^2 \textbf{x} = \textbf{0}$$

I'm not totally sure what it means by the "Lagrange multiplier function formalism", but anyway, introducing a Lagrange multiplier, $\lambda(t)$, we get:

$$\int L(\textbf{x}, \dot{\textbf{x}}, \lambda) dt = \int ||\dot{ \textbf{x}}||^2 + \lambda(||\textbf{x}|| - 1) dt$$

and hence the Euler-Lagrange equations are:

$$\frac{d}{dt}\Big( \frac{\partial L}{\partial \dot{\textbf{x}}}\Big) - \frac{\partial L}{\partial \textbf{x}} = 2 \ddot{\textbf{x}} - \frac{\lambda}{||\textbf{x}||} \textbf{x} = \textbf{0}$$

and also $||\textbf{x}|| - 1 = 0$. I need to find what $\lambda(t)$ is but I'm not sure how to progress.

Thanks in advance for any help.

• You might find it easier (I'm guessing -- haven't worked it out) if you wrote $\lambda( \| x \|^2 - 1)$. – John Hughes Jul 14 '14 at 16:54
• Tip: Use \| instead of ||, it looks better: $\|\mathbf x\|$ vs. $||\mathbf x||$. – user856 Jul 14 '14 at 17:26

Note that $\mathbf{x}^2 = ||\mathbf{x}||^2 = 1$ can be differentiated twice to obtain $\dot{\mathbf{x}}^2+\mathbf{x}\cdot\ddot{\mathbf{x}}=0.$ But one can also obtain $\mathbf{x}\cdot \ddot{\mathbf{x}}$ from the Euler-Lagrange equation by an appropriate dot product. These together fix $\lambda$.
• Thanks for the reply but I'm not entirely sure as to why being able to find $\textbf{x} \cdot \ddot{\textbf{x}}$ in two different ways is necessary, surely once we have $\lambda$ in terms of $\textbf{x}$ etc we're done? At any rate, it doesn't lead to the printed result. Are you sure my E-L equation is correct? – JosephML Jul 14 '14 at 17:48
• Your EL equation looks right to me. The point I was making was that, if you find two different equations involving both that dot product and $\lambda$, then you can eliminate the dot product and obtain a solution for $\lambda$. Does that clarify? – Semiclassical Jul 14 '14 at 18:02
• @JosephML: Actually, I'm wrong: I hadn't seen that you'd edited the problem from $\ddot{\mathbf{x}}$ to $\dot{\mathbf{x}}$. In that case, yes, you need a bit more info. Will revise. – Semiclassical Jul 14 '14 at 18:08
• Ah yes, I see what you mean. This gives $\lambda^2 = 4 \| \ddot{\textbf{x}} \|^2$ and when put back in gives $$\ddot {\textbf{x}} \mp \frac{2 \| \ddot{\textbf{x}}\|}{\| \textbf{x} \|} \lambda \textbf{x} = 0$$ but I can't see how one could get a $\| \dot{\textbf{x}}\|^2$ from that. – JosephML Jul 14 '14 at 18:11
• @JosephML: Right. You need the $x^2=1$ constraint for that, and that's what I've added to the solution. – Semiclassical Jul 14 '14 at 18:20


text:
# Failure in Columns

Columns can be classified as three types: short, long, and intermediate. Failure in short columns is distinguished by the crushing (yielding) of material, due to the stresses developed in the material which are greater than the yielding stress. Long column fails are due to buckling, meaning that the column actually defects laterally and bends near the middle of its length. Buckling in long columns occurs at stresses below the yielding stress of the material. Failure in intermediate columns is a combination of material yielding and buckling. Buckling in intermediate columns takes place at higher stresses.
Leonhard Euler (1707–1783), Swiss mathematician, derived a formula for a slender column that shows how the critical load would cause buckling in this type of column. The formula is the Euler equation and was named after him for his great contribution to column theory. Today it is still used as the basis for the analysis and design of slender columns. The Euler equation is expressed as
Pe =  π2EI/Le2

where
Pe = the critical load or the Euler buckling load, lb or N.
E = the modulus of elasticity of the material, psi or MPa
I = the smallest moment of inertia of the cross section, in.4 or mm4
Le = the length of the column between the hinges, in. or mm

The Euler formula is used to precisely predict the buckling load if the buckling stress is less than the proportional limit of the material. For the purpose of comparison, the Euler formula can be expressed in terms of buckling stress using and substituting Ar2 for the moment of inertia, I.

Pe/A =  (π2EI)/(Le/r)2

or
σe =  (π2EI)/(Le/r)2

The Euler equation has some limitations in the fact that it is only used if buckling occurs, as stresses on a column are low and in the material’s elastic region. The length between the hinges also known as buckling length varies with different support conditions.
 Critical loads, effective lengths and effective-length factors for ideal columns

 Buckling lengths of columns for different support conditions


text:
# Viewpoint: Wave-Shaping Surfaces

, Department of Electrical and Computer Engineering, The University of Texas at Austin, Austin, TX 78712, USA
Published May 6, 2013  |  Physics 6, 53 (2013)  |  DOI: 10.1103/Physics.6.53

#### Metamaterial Huygens’ Surfaces: Tailoring Wave Fronts with Reflectionless Sheets

Carl Pfeiffer and Anthony Grbic

Published May 6, 2013 | PDF (free)

Controlling light has fascinated mankind since the dawn of civilization, and the centuries of studies leading to the development of modern optics can still be a great source of inspiration. The advent of metamaterials—artificial materials with unconventional properties built by assembling smaller-than-wavelength constituent elements—has opened new venues for the manipulation of light propagation. Now, writing in Physical Review Letters, Carl Pfeiffer and Anthony Grbic from the University of Michigan, Ann Arbor, report the experimental demonstration, inspired by a three-century-old optical principle, of a new “metasurface”: a metamaterial-based thin screen capable of reshaping, in arbitrary ways, a radio-frequency wave transmitted through it, while at the same time minimizing undesired reflections [1].

Lenses and prisms were common tools well before the principles of modern optics had been established. Their design and operation is based on the fact that, as light propagates in a material different than air, it accumulates a phase delay along its optical path. By tailoring the shape of their entrance and exit faces, as shown in Fig. 1(a), one can change the total phase accumulation of the transmitted beam, point by point, leading to the ability of focusing, collimating, diffracting, or refracting light. These are inherently volumetric effects, implying that the relevant dimensions of these devices are larger, often much larger, than the wavelength of operation. This may not sound like a big deal for visible wavelengths—shorter than one micrometer—but it actually represents an important limitation for the miniaturization of optical devices like lenses, waveguides, beam formers, and polarizers, and for their integration into nanophotonic and optoelectronic systems. At longer wavelengths, this limitation becomes even more problematic, leading, for example, to the typically bulky designs of radio-astronomy antennas.

To address these limitations, researchers have been investigating new concepts to realize thin structures that rely on surface, rather than volumetric effects. Not by chance, these ideas were first explored and realized at longer wavelengths (radio waves), leading to the realization of frequency-selective surfaces (FSS) [2]. FSS are built of many small patterned elements, which can tailor a wave front to a certain degree by controlling, point by point, how the wave is scattered. So-called reflectarrays [3] and transmitarrays [4] are complex combinations of FSS elements that have become established tools in modern radio-antenna engineering.

Similar concepts have been recently extended to optical wavelengths by using arrays of plasmonic nanoparticles [5, 6]. Two recent studies [6] have experimentally shown that suitably designed ultrathin metasurfaces can control the propagation of transmitted light by introducing abrupt phase jumps as the wave hits the surface. Such phase discontinuities are produced by resonant nanostructures (V-shaped plasmonic “nanoantennas”) that are much smaller than the wavelength and can be designed to imprint an arbitrary phase pattern onto the transmitted beam. These solutions, however, have intrinsic limitations, stemming from the symmetries of this design and from the fact that the scheme needs to operate with orthogonally polarized incident and transmitted waves: the reflected beam is necessarily as intense as the transmitted beam, which is often not desirable, and, as we recently showed theoretically [7], the maximum transmission coupling into the desired beam cannot exceed a fundamental limit of $25%$ in this configuration.

Now, Pfeiffer and Grbic have found an elegant way to overcome these limitations at radio frequencies. Their solution was inspired by the principle introduced by Huygens in 1678 [8] to qualitatively explain how light propagates. According to the Huygens principle, each point on a wave front may be considered as a secondary source of spherical waves, and the sum of all secondary waves determines the wave propagation beyond the wave front. In the $20$th century, this concept has been more rigorously formulated as the “surface equivalence principle,” widely used in modern antenna engineering [9]: the field distribution over a surface can be modeled with “fictitious” electric and magnetic currents. These equivalent sources allow calculation of the exact field distribution at any point beyond that surface without knowing the true source distribution that originally produced it.

Pfeiffer and Grbic apply this principle to engineer thinner-than-wavelength metasurfaces that can modify the propagation of an incident wave. The authors printed, over a ceramic laminate, suitably shaped metallic inclusions that generate, when excited by the incoming wave, the electric- and magnetic-current profiles needed, according to the surface equivalence principle, to produce a certain field distribution. The concept is illustrated in Fig. 1(b): an inhomogeneous ensemble of subwavelength metallic shapes can locally control the induced electric (red in the figure) and magnetic (blue) currents through its interaction with the incident wave. The result is a new type of FSS, termed by the authors a “Huygens metasurface,” able to imprint, point by point, the desired phase discontinuity on the transmitted beam, with large transmission efficiency and at the same time to avoid unwanted reflections. What enabled this approach has been the idea of controlling both electric- and magnetic-induced currents on the surface, while previous attempts typically considered electric effects only. The symmetries that limited the scheme of Ref. [6] can be avoided by suitably tailoring the transverse magnetic currents, which radiate antisymmetric fields on the two sides of the surface. To be sustained, however, transverse magnetic currents require loops perpendicular to the screen, which implies a finite minimum thickness. In the proposed realization, the metasurface is $6$ mm thick, around $1/5$ of the wavelength at the operating frequency of $10$ gigahertz. Even thinner designs may be possible, although this would compromise the device performance.

The authors illustrate how this new concept may enable full control of wave transmission by realizing structures that perform two complex functionalities: bending an impinging wave by up to ${80}^{\circ }$ and transforming an incident Gaussian beam into a transmitted Bessel beam. The metasurfaces featured large transmission efficiency, close-to-zero reflections, and the ability to operate over a relatively broad spectrum of frequencies. Compared to more conventional transmitarrays, this technology can lead to thinner and simpler designs, and offers superior flexibility in wave manipulation. It may be applied to polarization control, beam shaping and rerouting, focusing, and possibly more advanced forms of optical manipulation with subwavelength spatial resolution.

The question of how to extend these concepts to optical wavelengths remains open, as magnetism becomes naturally weaker as the wavelength shrinks, a consequence of the small value of the fine-structure constant that characterizes the relative strength of electric and magnetic interactions in nature [10], but solutions may be available exploiting the collective resonance of arrays of plasmonic nanoparticles arranged in specific patterns (e.g., Ref. [11]). Recently, my research group has proposed an alternative scheme that may be better suited for optical wavelengths, as it does not rely on magnetic effects: we have theoretically proven that the conditions to realize, as in Pfeiffer and Grbic’s design, full control of the transmitted wave and close-to-zero reflections, may be achieved by using a subwavelength symmetric stack of three closely spaced inhomogeneous metasurfaces composed of two alternating optical materials (silicon and aluminum-zinc oxide) [7].

It is remarkable how Huygens’ ideas have inspired, several centuries later, a promising new technology for designing optical and radio-wave components that may be integrated in compact, planar systems. One day, this may allow bringing the complex optics of a lab onto a small chip or inside the board of our pocket cameras.

### References

1. C. Pfeiffer and A. Grbic, “Metamaterial Huygens’ Surfaces: Tailoring Wave Fronts with Reflectionless Sheets,” Phys. Rev. Lett. 110, 197401 (2013).
2. B. A. Munk, Frequency Selective Surfaces: Theory and Design (Wiley, New York, 2000)[Amazon][WorldCat].
3. D. M. Pozar, S. D. Targonski, and H. D. Syrigos, “Design of Millimeter Wave Microstrip Reflectarrays,” IEEE Trans. Antenn. Propag. 45, 287 (1997).
4. D. McGrath, “Planar Three-Dimensional Constrained Lenses,” IEEE Trans. Antenn. Propag. 34, 46 (1986); D. M. Pozar, “Flat Lens Antenna Concept Using Aperture Coupled Microstrip Patches,” Electronics Lett. 32, 2109 (1996).
5. B. Memarzadeh and H. Mosallaei, “Array of Planar Plasmonic Scatterers Functioning as Light Concentrator,” Opt. Lett. 36, 2569 (2011).
6. N. Yu, P. Genevet, M. A. Kats, F. Aieta, J.-P. Tetienne, F. Capasso, and Z. Gaburro, “Light Propagation with Phase Discontinuities: Generalized Laws of Reflection and Refraction,” Science 334, 333 (2011); X. Ni, N. K. Emani, A. V. Kildishev, A. Boltasseva, and V. M. Shalaev, “Broadband Light Bending with Plasmonic Nanoantennas,” 335, 427 (2012).
7. F. Monticone, N. Mohammadi Estakhri, and A. Alù, “Full Control of Nanoscale Optical Transmission with a Composite Metascreen,” Phys. Rev. Lett. 110, 203903 (2013).
8. C. Huygens, Traitè de la Lumière (Leyden, 1690).
9. S. Schelkunoff, “Some Equivalence Theorems of Electromagnetics and their Application to Radiation Problems,” Bell Syst. Tech. J. 15, 92 (1936).
10. R. Merlin, ”Metamaterials and the Landau–Lifshitz Permeability Argument: Large Permittivity Begets High-Frequency Magnetism,” Proc. Natl. Acad. Sci. U.S.A. 106, 1693 (2009).
11. A. Alù, A. Salandrino, and N. Engheta, “Negative Effective Permeability and Left-Handed Materials at Optical Frequencies,” Opt. Express 14, 1557 (2006); F. Shafiei et al., “A Subwavelength Plasmonic Metamolecule Exhibiting Magnetic-Based Optical Fano Resonance,” Nature Nanotech. 8, 95 (2013).

### About the Author: Andrea Alù

Andrea Alù is an Assistant Professor at The University of Texas at Austin. He received his Ph.D. in electronic engineering in 2007 from the University of Roma Tre, Italy. After a postdoctoral fellowship at the University of Pennsylvania, in 2009 he joined the faculty at UT Austin. His current research interests span a broad range of areas, including metamaterials and plasmonics, electromagnetic theory and applications, nanooptics and photonics, and acoustics. Over the last few years, he has received several awards for his research work, including the OSA Adolph Lomb Medal (2013), the SPIE Early Career Investigator Award (2012), the URSI Issac Koga Gold Medal (2011), the NSF CAREER award (2010), the AFOSR (2010) and DTRA (2011) Young Investigator Award. For more information, please see http://users.ece.utexas.edu/~aalu.


text:
# Chasing Turtles Problem

jpas
This is supost to be a classic. I solved it but my answer isn´t right and I can´t find out why. Hope you guys can help.

Imagine an equilateral triangle with one turtle on each side of lenth L. All turtles move with velocity V. Turtle 1 always directs its motion to turtle 2, turtle 2 to turtle 3, and turtle 3 to turtle 1, again. Calculate the time the turtles take to meet.

The movement will be something like this.

Relative to turtle 2, turtle 1 will be in uniform rectilinear motion and its velocity will be:

$$\vec V_{12}=\vec v_1 - \vec v_2$$

$$\vec v_1$$ and $$\vec -v_2$$ make an angle of 60º degrees. So,

$$V_{12}= \frac{V}{\sqrt{3}}$$

Relative to turtle 2, turtle 1 will only travel the distance that separates it from the center of the triangle, which is $$\frac{L}{3}$$

So, $$t= \frac{v_{12}}{d} = \frac{L}{3V}$$

P.S.: I guess some of you might have already solved this problem. If not, I recommend it, though I got it wrong.

Last edited by a moderator:

Bob S
You have an equilateral triangle with side length L. The velocity of each turtle is v. The triangle defined by the 3 points (turtles) is always at any time t an equilateral triangle. Because the distance d between the turtles (the side of the equilateral triangle) at time t is

d=L-vt,

the turtles meet when

L-vt = 0

Bob S

jpas

Because the distance d between the turtles (the side of the equilateral triangle) at time t is

d=L-vt,

This isn´t true. How did you arrive to this equation?

The real time the turtles take is $$\frac{2L}{3V}$$ , 1.5 times what you got.

Does anyone have other sugestions? I advise you, if you´ve got nothing to do, this is a fun problem!

Bob S
You are correct. The easiest way to get the solution is to use radial coordinates. The direct distance from the apex to the center is (from plane geometry)

R = L/√3

For a radial step dr, the turtle must always travel a distance 2·v·dt/√3

So to travel a radial distance R=L/√3,

v·t = (L/√3)(2/√3) = 2L/3

t=2L/3v

Bob S

jpas
Hi Bob, thanks for the reply.

R = L/√3

Right. On my orginal post I had a typo. I meant this.

For a radial step dr, the turtle must always travel a distance 2·v·dt/√3

Can you explain this step? What is dr and how did you calculate it?

Bob S
For a radial step dr, the turtle must always travel a distance 2·v·dt/√3.
Can you explain this step? What is dr and how did you calculate it?
A turtle step dx = v·dt is always at a 30-degree angle to the radial direction dr from the apex of the equilateral triangle (between the 3 turtles) to the center, because the radial direction always bisects the 60-degree angle of the equilateral triangle (even as the turtles move and the equilateral triangle rotates), and the instantaneous direction of v·dt is always parallel to one of the sides of the equilateral triangle. Using plane geometry, the longer side of a 30-60-90 degree triangle is equal to √3/2 times the hypotenuse. The turtle step v·dt is along the hypotenuse and the radial step projection dr is along the longer side.

So a radial step dr = (√3)·v·dt/2

Bob S


text:
# Boosted event topologies from TeV scale light quark composite partners

Mihailo Backović, Thomas Flacke, Jeong Han Kim, Seung Joon Lee

Research output: Contribution to journalArticle

13 Citations (Scopus)

### Abstract

Abstract: We propose a new search strategy for quark partners which decay into a boosted Higgs and a light quark. As an example, we consider phenomenologically viable right handed up-type quark partners of mass ∼ 1 TeV in composite pseudo-Nambu-Goldstone-boson Higgs models within the context of flavorful naturalness. Our results show that S/B > 1 and signal significance of ∼ 7σ is achievable at s=14$$\sqrt{s}=14$$ TeV LHC with 35 fb−1 of integrated luminosity, sufficient to claim discovery of a new particle. A combination of a multi-dimensional boosted Higgs tagging technique, kinematics of pair produced heavy objects and b-tagging serves to efficiently diminish the large QCD backgrounds while maintaining adequate levels of signal efficiency. We present the analysis in the context of effective field theory, such that our results can be applied to any future search for pair produced vector-like quarks with decay modes to Higgs and a light jet.

Original language English 82 Journal of High Energy Physics 2015 4 https://doi.org/10.1007/JHEP04(2015)082 Published - 2015 Apr 1

### Fingerprint

topology
quarks
composite materials
marking
decay
Higgs bosons
kinematics
quantum chromodynamics
luminosity

### Keywords

• Beyond Standard Model
• Higgs Physics
• Technicolor and Composite Models

### ASJC Scopus subject areas

• Nuclear and High Energy Physics

### Cite this

Boosted event topologies from TeV scale light quark composite partners. / Backović, Mihailo; Flacke, Thomas; Kim, Jeong Han; Lee, Seung Joon.

In: Journal of High Energy Physics, Vol. 2015, No. 4, 82, 01.04.2015.

Research output: Contribution to journalArticle

Backović, Mihailo ; Flacke, Thomas ; Kim, Jeong Han ; Lee, Seung Joon. / Boosted event topologies from TeV scale light quark composite partners. In: Journal of High Energy Physics. 2015 ; Vol. 2015, No. 4.
@article{ee565c56b14a4588b3a9b6912ea79ba7,
title = "Boosted event topologies from TeV scale light quark composite partners",
abstract = "Abstract: We propose a new search strategy for quark partners which decay into a boosted Higgs and a light quark. As an example, we consider phenomenologically viable right handed up-type quark partners of mass ∼ 1 TeV in composite pseudo-Nambu-Goldstone-boson Higgs models within the context of flavorful naturalness. Our results show that S/B > 1 and signal significance of ∼ 7σ is achievable at s=14$$\sqrt{s}=14$$ TeV LHC with 35 fb−1 of integrated luminosity, sufficient to claim discovery of a new particle. A combination of a multi-dimensional boosted Higgs tagging technique, kinematics of pair produced heavy objects and b-tagging serves to efficiently diminish the large QCD backgrounds while maintaining adequate levels of signal efficiency. We present the analysis in the context of effective field theory, such that our results can be applied to any future search for pair produced vector-like quarks with decay modes to Higgs and a light jet.",
keywords = "Beyond Standard Model, Higgs Physics, Technicolor and Composite Models",
author = "Mihailo Backović and Thomas Flacke and Kim, {Jeong Han} and Lee, {Seung Joon}",
year = "2015",
month = "4",
day = "1",
doi = "10.1007/JHEP04(2015)082",
language = "English",
volume = "2015",
journal = "Journal of High Energy Physics",
issn = "1126-6708",
publisher = "Springer Verlag",
number = "4",

}

TY - JOUR

T1 - Boosted event topologies from TeV scale light quark composite partners

AU - Backović, Mihailo

AU - Flacke, Thomas

AU - Kim, Jeong Han

AU - Lee, Seung Joon

PY - 2015/4/1

Y1 - 2015/4/1

N2 - Abstract: We propose a new search strategy for quark partners which decay into a boosted Higgs and a light quark. As an example, we consider phenomenologically viable right handed up-type quark partners of mass ∼ 1 TeV in composite pseudo-Nambu-Goldstone-boson Higgs models within the context of flavorful naturalness. Our results show that S/B > 1 and signal significance of ∼ 7σ is achievable at s=14$$\sqrt{s}=14$$ TeV LHC with 35 fb−1 of integrated luminosity, sufficient to claim discovery of a new particle. A combination of a multi-dimensional boosted Higgs tagging technique, kinematics of pair produced heavy objects and b-tagging serves to efficiently diminish the large QCD backgrounds while maintaining adequate levels of signal efficiency. We present the analysis in the context of effective field theory, such that our results can be applied to any future search for pair produced vector-like quarks with decay modes to Higgs and a light jet.

AB - Abstract: We propose a new search strategy for quark partners which decay into a boosted Higgs and a light quark. As an example, we consider phenomenologically viable right handed up-type quark partners of mass ∼ 1 TeV in composite pseudo-Nambu-Goldstone-boson Higgs models within the context of flavorful naturalness. Our results show that S/B > 1 and signal significance of ∼ 7σ is achievable at s=14$$\sqrt{s}=14$$ TeV LHC with 35 fb−1 of integrated luminosity, sufficient to claim discovery of a new particle. A combination of a multi-dimensional boosted Higgs tagging technique, kinematics of pair produced heavy objects and b-tagging serves to efficiently diminish the large QCD backgrounds while maintaining adequate levels of signal efficiency. We present the analysis in the context of effective field theory, such that our results can be applied to any future search for pair produced vector-like quarks with decay modes to Higgs and a light jet.

KW - Beyond Standard Model

KW - Higgs Physics

KW - Technicolor and Composite Models

UR - http://www.scopus.com/inward/record.url?scp=84928822907&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=84928822907&partnerID=8YFLogxK

U2 - 10.1007/JHEP04(2015)082

DO - 10.1007/JHEP04(2015)082

M3 - Article

AN - SCOPUS:84928822907

VL - 2015

JO - Journal of High Energy Physics

JF - Journal of High Energy Physics

SN - 1126-6708

IS - 4

M1 - 82

ER -


text:
# Playing a sound on collision?

I'm making a pool game. I've separated the gameplay logic and the physics into two systems, entities and physics. Each entity holds a reference to a body which the physics system uses. The body itself holds a reference back to it's owner. When an entity collides with another entity, the Collided(Entity other) method is called on both.

What I'm trying to do now is to play a sound when both entities colliding are of a certain subclass. I'm not sure how to do that. I could do it in the Collided method, but then the sound would be played two times at the same time, since the method was called on both entities.

How do you suggest I do this?

• Maybe collect all collisions each frame and only act on a pair (i.e. treat A colliding with B and B colliding with A as one event). – George Duckett Apr 13 '12 at 14:20
• I already act on pairs, and that's where I basically do: a.Collided(b); b.Collided(a); Although my problem is how I should organize the system for registering such entity-class combinations for events. – Eric McLoughlin Apr 13 '12 at 14:25
• @EricMcLoughlin that's two events. – kaoD Apr 13 '12 at 14:52
• Those events, yeah. But I want to trigger an event for the collision, passing in both entities as well. The question is where do I keep that method? – Eric McLoughlin Apr 13 '12 at 15:43

Add a flag to your Collided method, and when you call a pair of Collided events only have one of them process the sound (AUDIBLE and SILENT are simply constants for TRUE and FALSE):

a.Collided(b, AUDIBLE); b.Collided(a, SILENT);

This method is very simple, but it does require that you are calling the events in pairs... in other words, that they are explicitly called right next to each other for each collision. Another method, and this is similar to what @GeorgeDuckett was suggesting, is this:

a.Collided(b);
b.Collided(a);
Sound.collision(a,b);

Regardless of whether you have the sound code external to the objects or inside them, you will be doing a table lookup in the end... asking the sound system if it has a sound that matches objects a and b in either order. Make sure that this query is order independant... it should return the same result for (b,a) and (a,b). If you will not have every combination possible, you should also have failthrough logic... for example, you might have a generic 'a' sound that you use when there is no specific sound for collisions with 'b' (or vice versa, of course).

Both of these suggestions require locality; they require that you are processing both sides of the collision at once. If your code looks like this you will need a different answer:

for each object
...

object.Collided(other);
end

• I do process them in pairs. The code at the top you're suggesting should work, but what if I want to add sound events between another combination? Then I would either be forced to duplicate sound code or sort the entities so that a certain entity-class would appear on a certain side of the call on every call using that combination. I think I'll actually stick to using the second approach as I thought of myself in the beginning. The problem I have though, is in what class I should keep the two-sided collision callback. – Eric McLoughlin Apr 13 '12 at 15:40
• When you process the sound, it should not matter which object is the caller and which the callee; for example, there should be no difference between CueStick.Collided(Ball) and Ball.Collided(CueStick), as far as the sound is concerned. You should be calling out to a list of sounds that is object agnostic. – Myrddin Emrys Apr 13 '12 at 15:52
• I'm not sure what you mean when you're saying that the list of sounds should be object agnostic. Can you elaborate a bit more? – Eric McLoughlin Apr 13 '12 at 15:56
• I added additional clarification in the answer. The end result is a lookup... a query to see if there is a sound for the combination (a,b). You might, for example, sort sounds alphabetically. In this case, collisions between a Ball and a Stick might be stored as 'CollideBallStick' because you always list them alphabetically (never CollideStickBall). How you organize them is up to you, this is merely one possibility. – Myrddin Emrys Apr 13 '12 at 16:00

I am fairly new to this, but I would make the collided method a trigger for the individual call to each collide. Then you can keep the same call, but it would allow you test for type and then call the sound before each separate collision call is made.

I may be way off base, but they seems like the most logical approach since the sound would need to be triggered once and only when certain objects collide.


text:
This package provides efficient algorithms to generate knockoffs for hidden Markov models, with specific support for genetic data.

Installation

To install this package, run the following command in your R console:

# For the current development version
devtools::install_github("msesia/snpknock")


text:
# Why is this true for matrices? Linearly dependent columns $\implies$ not invertible

If $A$ is a square matrix with linearly dependent columns, then $A$ is not invertible.

Why is this true for matrices?

• As a very simple example to further convince yourself, take $A$ to be a $2 \times 2$ matrix of all $1$'s. Then notice if you move along the line $x+y = d = \text{const}$, $A$ sends every point on this line to the same point, $(d,d)$. – Chester Aug 17 '15 at 23:04

You should know that elementary column operations preserve a zero/nonzero determinant. You should also know that if a column is all zeros, then the determinant is zero. All that remains is to convince yourself that if the columns are linearly dependent, then you can make one column all zeros from a sequence of elementary column operators.

• Nice answer. +1 – James K Aug 17 '15 at 22:54
• The first sentence is not true; see math.stackexchange.com/questions/1991807/…. However, the -1 from a single column exchange will not change a determinant equal to 0. – sunspots Jun 17 '19 at 9:55
• @sunspots good catch, corrected. – Jahan Claes Jun 17 '19 at 12:47
• is the opposite direction (of the question) also true ? – Xhero39 May 1 '20 at 18:59
• Yes! Every step in the proof I outlined goes in both directions. – Jahan Claes May 1 '20 at 19:12

Let $A_1, \ldots, A_n$ be the columns of $A$. If they're linearly dependent, then there are constants $c_i$ (not all zero) such that $$c_1\,A_1 + \cdots + c_n \,A_n=\vec0.$$ The trick is to note that if $\vec c = \left[\begin{array}{c} c_1\\ \vdots\\ c_n\end{array}\right]$, then the above equation says precisely that $A\vec c = \vec 0$, with $\vec c \not=\vec0$. (In general, $x_1\,A_1 + \cdots + x_n \,A_n=A\vec x$, for any vector $\vec x$.)

Now you use the fact that if $A$ is invertible, then the only solution to $A\vec x = \vec0$ is $\vec x = \vec0$. So $A$ can't be invertible. $~\square$

• The fact you use at the end ("if $A$ is invertible, then the only solution to $A\vec x = \vec0$ is $\vec x = \vec0$") seems like simply restating the problem to me. How do we know (or how can we prove) that this is true? – Joe Strout Sep 14 '19 at 4:27
• is the opposite direction (of the question) also true ? – Xhero39 May 1 '20 at 18:57

If the columns of A are linearly dependent,

then $a_1\vec{c_1}+\cdots+a_n\vec{c_n}=\vec{0}$ for some scalars $a_1,\cdots, a_n$ (not all 0).

Then $Av=\vec{0}$ where $v=\begin{pmatrix}a_1\\\vdots\\a_n\end{pmatrix}\ne\vec{0}$, so A is not invertible

(since otherwise, multiplying by $A^{-1}$ would give a contradiction).

• For future searchers: this answer is closest to being complete, rather than just dropping hints. The key bit that was still unobvious to me is the parenthetical statement at the end. What this means is: multiply both sides of $Av = 0$ by $A^{-1}$, giving $A^{-1}Av = A^{-1}0$ (and this actually is valid to do, even though the right-hand side is zero). This means $v = 0$, contradicting the statement above. – Joe Strout Sep 14 '19 at 4:41
• is the opposite direction (of the question) also true ? – Xhero39 May 1 '20 at 18:57

Let your matrix be $A$ and let the columns of your matrix be $c_1,c_2,\cdots,c_n$. Saying there's a subset of linearly dependent columns means that there are columns $c_{i_1},c_{i_2},...,c_{i_k}$ that are linearly dependent, so that there exist nontrivial $a_k$ such that:

$$a_1c_{i_1}+a_2c_{i_2}+\cdots+a_kc_{i_k}=0.$$

Now define the vector $v$ so that $v_{i_k}=a_k$ and $v_i=0$ otherwise. What do you suppose $Av$ equals?

• No need for subindexing. Just $Av=c_1v_1+\ldots+c_nv_n$ is a linear combination. Lin.dependent $\Rightarrow$ $\exists v\ne 0$: $Av=0$ (by definition). – A.Γ. Aug 17 '15 at 22:53
• I think everyone jumped on this one at once. – Christopher Carl Heckman Aug 17 '15 at 22:56
• This is not an answer; it is another question. Nor is it at all clear how this new question relates to the original one. – Joe Strout Sep 14 '19 at 4:30
• @JoeStrout: $Av=0$, so... – Alex R. Sep 14 '19 at 5:41
• @FirasAliAbdelGhani: Of course. If $A$ is not invertible, it has a nontrivial kernel, so that $Ax=0$ for some nonzero $x$, so the columns of $A$ are linearly dependent. – Alex R. May 1 '20 at 19:16

Hint: If $A$ has linearly dependent columns, then $\det(A)=0$.

Another approach without using the determinant: let $A\in \mathbb R^{n\times n}$ (or any other field $\mathbb F$). We write $v_1,\dots v_n$ for the columns of $A$. As the columns are linearly dependent there exists $a_1,\dots,a_n\in \mathbb R$ and $a_i\neq 0$ for at least one $i\in \{1,\dots n\}$ such that $a_1v_1+\dots +a_nv_n=0$. Let $\varphi$ be the linear mapping associated with $A$, then: $$\varphi\left(\begin{pmatrix} a_1 \\ \vdots \\ a_n \end{pmatrix}\right)=A\cdot \begin{pmatrix} a_1 \\ \vdots \\ a_n \end{pmatrix} = a_1v_1+\dots +a_nv_n=0.$$ Thus $\varphi$ is not bijective and we conclude that $A$ is not invertible.

• Okay so this is essentially what I don't understand because $A$ is not invertible $\iff$ $\det (A)=0$ so why is your hint true? – James K Aug 17 '15 at 22:44
• Are you having problems with this excact equivalence, with the proof that $\det(A)=0$? – Hirshy Aug 17 '15 at 22:46
• is the opposite direction (of the question) also true ? – Xhero39 May 1 '20 at 18:58


text:
## Functiones et Approximatio Commentarii Mathematici

### Toeplitz operators with distributional symbols on Fock spaces

#### Abstract

We define and study Toeplitz operators $T_a$ with distributional symbols in the setting of weighted Fock spaces of entire functions on the complex plane. Sufficient conditions for boundedness and compactness are presented in terms of the symbol belonging to a weighted Sobolev space $W_\omega^{-m, \infty}$ of negative order.

#### Article information

Source
Funct. Approx. Comment. Math., Volume 44, Number 2 (2011), 203-213.

Dates
First available in Project Euclid: 22 June 2011

https://projecteuclid.org/euclid.facm/1308749124

Digital Object Identifier
doi:10.7169/facm/1308749124

Mathematical Reviews number (MathSciNet)
MR2841179

Zentralblatt MATH identifier
1259.47037

#### Citation

Perälä, Antti; Taskinen, Jari; Virtanen, Jani. Toeplitz operators with distributional symbols on Fock spaces. Funct. Approx. Comment. Math. 44 (2011), no. 2, 203--213. doi:10.7169/facm/1308749124. https://projecteuclid.org/euclid.facm/1308749124

#### References

• A. Alexandrov and G. Rozenblum, Finite rank Toeplitz operators: some extensions of D. Luecking's theorem, J. Funct. Anal. 256 (2009), no. 7, 2291–2303.
• S. Axler and D. Zheng, Compact operators via the Berezin transform, Indiana Univ. Math. J. 47 (1998), no. 2, 387–400.
• F.A. Berezin, Quantization, Math. USSR Izv. 8 (1974), 1109–1163.
• F.A. Berezin, Quantization in complex symmetric spaces, Math. USSR Izv. 9 (1975), 341–379.
• C.A. Berger and L.A. Coburn, Toeplitz operators on the Segal-Bargmann space, Trans. Amer. Math. Soc. 301 (1987), no. 2, 819–827.
• M. Dostanić and K. Zhu, Integral operators induced by the Fock kernel, Integral Eq. Operator Theory 60 (2008), no. 2, 217–236.
• V. Guillemin, Toeplitz operators in $n$-dimensions, Int. Eq. Oper. Th. 7 (1984), 145–205.
• R. Howe, Quantum mechanics and partial differential equations, J. Funct. Anal. 38 (1980), 188–254.
• J. Isralowitch and K. Zhu, Toeplitz operators on the Fock space, Integral Equations Operator Theory 66 (2010), no. 4, 593–611.
• D.H. Luecking, Trace ideal criteria for Toeplitz operators, J. Funct. Anal. 73 (1987), no. 2, 345–368.
• A. Perälä, J. Taskinen and J. Virtanen, Toeplitz operators with distributional symbols on Bergman spaces, to appear in Proc. Edinburgh Math. Soc.
• W. Rudin, Functional Analysis, Mc Graw-Hill, 1973.
• D. Suarez, The essential norm of operators in the Toeplitz algebra on $A\sp p(\ABDAbbB\sb n)$, Indiana Univ. Math. J. 56 (2007), no. 5, 2185–2232.
• J. Taskinen and J.A. Virtanen, Toeplitz operators on Bergman spaces with locally integrable symbols, Rev. Mat. Iberoam. 26 (2010), no. 2, 693–706.
• N. Vasilevski, Commutative algebras of Toeplitz operators on the Bergman space, Operator Theory: Advances and Applications, Vol. 185, Birkhäuser Verlag, 2008.
• K. Zhu, $BMO$ and Hankel operators on Bergman spaces, Pac. J. Math. 155 (1992), no.2, 377–395.
• K. Zhu, Operator Theory in Function Spaces, 2nd edition, Mathematical Surveys and Monographs, 138, American Mathematical Society, Providence, RI, 2007.
• N. Zorboska, Toeplitz operators with $BMO$ symbols and the Berezin transform, Int. J. Math. Sci. 46 (2003), 2929–2945.


text:
You are currently offline. Some features of the site may not work correctly.

# Bogoliubov inner product

The Bogoliubov inner product (Duhamel two-point function, Bogolyubov inner product, Bogoliubov scalar product, Kubo-Mori-Bogoliubov inner product) is… Expand
Wikipedia

## Papers overview

Semantic Scholar uses AI to extract papers important to this topic.
2019
2019
We study transport between Quantum Hall (QH) edge states at filling factor $\nu = 1$ in the presence of electron-acoustic-phonon… Expand
2018
2018
The pseudo-conformal field theory (PCFT) is a 4-d action, which depends on the lorentzian Cauchy-Riemann (LCR) structure, like… Expand
2004
2004
• 2004
• Corpus ID: 15534556
We show how, modulo the distinction between the antipode and the "twisted" or "renormalized" antipode, Connes and Kreimer's… Expand
2003
2003
• 2003
• Corpus ID: 16530049
Abstract We derive the analytical properties of the elastic forward scattering amplitude of two scalar particles from the axioms… Expand


text:
Formatted question description: https://leetcode.ca/all/1744.html

# 1744. Can You Eat Your Favorite Candy on Your Favorite Day?

Medium

## Description

You are given a (0-indexed) array of positive integers candiesCount where candiesCount[i] represents the number of candies of the i-th type you have. You are also given a 2D array queries where queries[i] = [favoriteType_i, favoriteDay_i, dailyCap_i].

You play a game with the following rules:

• You start eating candies on day 0.
• You cannot eat any candy of type i unless you have eaten all candies of type i - 1.
• You must eat at least one candy per day until you have eaten all the candies.

Construct a boolean array answer such that answer.length == queries.length and answer[i] is true if you can eat a candy of type favoriteType_i on day favoriteDay_i without eating more than dailyCap_i candies on any day, and false otherwise. Note that you can eat different types of candy on the same day, provided that you follow rule 2.

Return the constructed array answer.

Example 1:

Input: candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]]

Output: [true,false,true]

Explanation:

1- If you eat 2 candies (type 0) on day 0 and 2 candies (type 0) on day 1, you will eat a candy of type 0 on day 2.

2- You can eat at most 4 candies each day.

If you eat 4 candies every day, you will eat 4 candies (type 0) on day 0 and 4 candies (type 0 and type 1) on day 1.

On day 2, you can only eat 4 candies (type 1 and type 2), so you cannot eat a candy of type 4 on day 2.

3- If you eat 1 candy each day, you will eat a candy of type 2 on day 13.

Example 2:

Input: candiesCount = [5,2,6,4,1], queries = [[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]]

Output: [false,true,true,false,false]

Constraints:

• 1 <= candiesCount.length <= 10^5
• 1 <= candiesCount[i] <= 10^5
• 1 <= queries.length <= 10^5
• queries[i].length == 3
• 0 <= favoriteType_i < candiesCount.length
• 0 <= favoriteDay_i <= 10^9
• 1 <= dailyCap_i <= 10^9

## Solution

Calculate array prefixSums, where prefixSums[i + 1] = prefixSums[i] + candiesCount[i + 1] for i >= 0.

For each query that contains tuple (type, day, capacity), the allowed range of number of candies is [prefixSums[type] + 1, prefixSums[type + 1]], and the possible range of number of candies is [day + 1, (day + 1) * capacity]. The query is true if and only if the intersection of the two ranges is non-empty.

Finally, return the array of query results.

class Solution {
public boolean[] canEat(int[] candiesCount, int[][] queries) {
int length = candiesCount.length;
long[] prefixSums = new long[length + 1];
for (int i = 0; i < length; i++)
prefixSums[i + 1] = prefixSums[i] + candiesCount[i];
int queriesCount = queries.length;
for (int i = 0; i < queriesCount; i++) {
int type = queries[i][0], day = queries[i][1], capacity = queries[i][2];
long minCandies = prefixSums[type] + 1, maxCandies = prefixSums[type + 1];
long minPossible = day + 1;
long maxPossible = (long) (day + 1) * capacity;
answer[i] = minCandies <= maxPossible && maxCandies >= minPossible;
}


text:
## Noob here... Order from Disorder

I am convinced that order must come from disorder. If there is something to be disordered, then if there is nothing constraining things to become ordered, then it seems axiomatic that some order eventually arises.

Specifically, with regard to the formation of the Observable universe from a sea of undifferentiated energy.

(In my mind, I see the universe as a bubble in an eternal pool of swirling, random, chaotic "something" (Something that can create universes such as ours).

In your best layman's terms, can you help me explain order from disorder to a couple of theists who insist that the 2nd Law makes it impossible, or that in order to have order arise from disorder you need order in the first place, etc.... (the latter may be true, but in a trivial sense - the "laws" of the undifferentiated energy/quantum foam/or whatever it is that exists "outside" of the universe may have some order in this sense: "Be chaotic".)

Anyhow, looking for some decent explanations on the current understanding of how things could have arose from random chaos.

Can anyone help me out?

 PhysOrg.com science news on PhysOrg.com >> Leading 3-D printer firms to merge in $403M deal (Update)>> LA to give every student an iPad;$30M order>> CIA faulted for choosing Amazon over IBM on cloud contract

Recognitions:
Gold Member
 Quote by Dadalus ... In your best layman's terms, can you help me explain order from disorder to a couple of theists who insist that the 2nd Law makes it impossible, or that in order to have order arise from disorder you need order in the first place, etc... Thanks in advance.
I hope you get several responses exhibiting several different points of view. I will not try to contribute anything that might help you argue with your two theists, but I will try to present an idea which you yourself might enjoy thinking about.

Because gravity is normally attractive, the lowest-entropy state is normally the most uniform, with matter distributed evenly throughout all space.

[you can picture space as either infinite or finite (a boundaryless 3d hypersphere) with matter uniform throughout in either case]

The 2nd Law is satisfied because, starting from an even distribution, matter will begin to condense into a cobwebby mess under its own self-attractive gravity. Nice computer simulations of this process in George Smoot's TED talk: google "TED Smoot". The formation of structure in the universe is an increase in geometric entropy, under the assumption that gravity is attractive. We are only to the stage of galaxies however. Ultimate entropy would be black holes, but we are not there yet. They have the highest entropy (assuming grav. attractive).

So condensation, curdling, coagulation, collision and merger proceed apace. Geometry continues to get more and more entropic, as the 2nd Law would wish.

However there is a catch. Some researchers have found that when they quantize the equation of how geometry evolves (the GR equation) they get that very high density gravity repels instead of attracts. In that situation it is the UNIFORM distribution which is the one with highest entropy and the one favored by the 2nd Law.

So if the whole coagulated cobwebby mess should COLLAPSE to extreme density it would do two things
get uniform by action of 2nd Law under repellence
rebound (because of repellence) and start expanding again, resulting in a new spacetime region.

At the moment this is a speculative scenario. People are working on determining what the observable effects would be of a bounce from extreme (uniform) density causing the expansion phase we are in. They want to know what the "footprint" of such a bounce would be, so they can tell the astronomers how to look for it.
http://www-library.desy.de/cgi-bin/s...tecount%28d%29
The server is slow so you may have to wait for perhaps 15-20 seconds for the list to appear.
 This comes from a misunderstanding of the second law of thermodynamics. The second law says that entropy must increase with time, not disorder. Entropy is thermodynamics represents how much useful work a thermodynamics system can perform. In statistical mechanics, entropy represents the number of ways you can re-arrange the microstates of a system without affecting the overall macrostate. This is why it appears that the second law says the ordered systems evolve towards disorder, since this is usually the case - water is more disordered than ice, but that isn't the reason ice will tend to become water. It's because there are more ways to re-arrange the molecules in water to keep it the same than for ice, so statistics tells you the ice will become water (assuming it's in an environment that is sufficiently warm). However, there are cases where we can entropy isn't exactly disorder. If a random cloud of gas fluctuated into a miniature replica of the statue of liberty, that would seem to be far more ordered. However, the gas fluctuating into a very small and dense packet is less 'ordered', but has far less entropy. A gas that is heated to a very high temperature will have a lower entropy, since it will tend towards a lower temperature. Since the early universe was a very hot, dense, state, it had a very, very low entropy. Since our current universe is much cooler, it has a much, much higher entropy. Eventually, the universe will become a cold, dark, de Sitter space, which has an enormously high entropy. Why the early universe had such a low entropy is still an open question.

Recognitions:
Gold Member

## Noob here... Order from Disorder

 Quote by Mark M ...Why the early universe had such a low entropy is still an open question.
Yes, still open, but as I just described in my post one conjectured explanation of the low entropy of the early universe is that it resulted from a bounce.

 Quote by Dadalus I am convinced that must come from . If there is something to be disordered, then if there is nothing constraining things to become ordered, then it seems axiomatic that some eventually arises.
...of course

A Super Order.
the "Big Freeze"
a totally cool universe in the distant future.

Recognitions:
 Quote by Dadalus In your best layman's terms, can you help me explain order from disorder to a couple of theists who insist that the 2nd Law makes it impossible, or that in order to have order arise from disorder you need order in the first place, etc....
Well, there are generally two separate issues at work here. First, the second law of thermodynamics does not prevent a local decrease in entropy. This particular misunderstanding of the second law of thermodynamics is frequently trotted out in an attempt to say that evolution is wrong, but if this particular misunderstanding were correct, forget evolution: life itself wouldn't be possible! But local decreases in entropy are very common and happen all the time, both naturally and through human intervention. Air conditioning systems, which build up an out-of-equilibrium (and thus low-entropy) state by cooling the inside of a building or vehicle, lower the entropy of the area they are cooling. Moving a car in a particular direction requires a lowering of entropy for the car. The formation of a storm front is a lowering of entropy.

In each case, the lowering of entropy is allowed because entropy elsewhere increases even more than the local lowering of entropy. With the air conditioning system, you have to pump out a lot of heat to cool the system you want cooled, and that heat represents an increase in entropy. With a vehicle, you change the chemical composition of your fuel, breaking it down from large, complex molecules to a much larger number of simpler molecules. With a storm front, the entropy decrease ultimately comes from the uneven heating of the Earth by the Sun, causing worldwide wind patterns that periodically manifest as storms. The entropy decrease of the Earth is matched by a vastly larger increase of entropy of the Sun.

If you want to go all the way to talk about origins, well, things get a bit trickier because we don't know that much about the origins of the universe. That initial state did have to be an extremely ordered, low-entropy state, this is true. And right now nobody is quite sure what produced that state. However, there are many ideas. For example, the fact that it was, though ordered, exceedingly tiny (as in, smaller than an atomic nucleus) seems to offer a hint as to how it could have occurred. One idea is that the small amount of dark energy that appears to exist in our universe today (roughly equivalent to the energy of four protons per cubic meter) is an equilibrium state: that far, far in the future, our universe will become completely empty except for this dark energy stuff. At that time, it will be very big, with very high entropy, but with very low entropy per volume. So it isn't a very big jump in entropy any longer for a tiny piece of the universe to sort of "pop", producing a new, low entropy universe.

But unfortunately this is mostly speculation at the current time. We don't know the correct solution to why the early universe had such a low entropy.

 Quote by Dadalus In your best layman's terms, can you help me explain order from disorder to a couple of theists who insist that the 2nd Law makes it impossible, or that in order to have order arise from disorder you need order in the first place, etc....
First all all the second law says that global entropy must increase. Entropy is not quite the same thing as disorder/order.

 Anyhow, looking for some decent explanations on the current understanding of how things could have arose from random chaos.
Why shouldn't expect order to come from chaos? When things cool they naturally become more ordered, and the universe has been cooling.

Recognitions:
 Quote by twofish-quant First all all the second law says that global entropy must increase. Entropy is not quite the same thing as disorder/order.
Well, in the most strict sense it is, but only if you define order and disorder very carefully. The problem is that the strict definition of entropy frequently doesn't line up with what we usually think of as order or disorder.

If you want to get into the nitty-gritty of it, the entropy of a system measures how many different ways you can rearrange the microscopic pieces of the system and still have the same overall appearance. This is why smaller molecules tend to have higher entropy than larger ones, for example: smaller molecules can be rearranged in many more ways. This is why an even mixing of gases is higher in entropy than dividing oxygen into one area and nitrogen in another: when evenly-mixed, you can rearrange the pieces throughout the whole system without changing the overall appearance, while when divided you can only rearrange the oxygen within its own section, the nitrogen within its own.

Which reminds me, I didn't explain something properly in my somewhat lengthy post above about air conditioners. The entropy increase is not found in the increase in temperature of the surroundings. It's found in the increase in entropy of the fuel at the power plant that supplies the electricity to the air conditioner.

 Quote by twofish-quant Why shouldn't expect order to come from chaos? When things cool they naturally become more ordered, and the universe has been cooling.
One interesting bit is that the highest-entropy configuration of our universe is completely empty space. Eventually, this is what our universe will become.

 Quote by Chalnoth Well, in the most strict sense it is, but only if you define order and disorder very carefully. The problem is that the strict definition of entropy frequently doesn't line up with what we usually think of as order or disorder.
Exactly. Just to give an example. Imagine some hot gas in empty space. The gas cools and becomes ice crystals. Now there seems to be more order, but if you do the bookkeepping you'll find that the extra "order' of the ice crystals is outweigh by the "disorder" of radiation radiating into space.

 Quote by Dadalus I am convinced that order must come from disorder. If there is something to be disordered, then if there is nothing constraining things to become ordered, then it seems axiomatic that some order eventually arises. Specifically, with regard to the formation of the Observable universe from a sea of undifferentiated energy. (In my mind, I see the universe as a bubble in an eternal pool of swirling, random, chaotic "something" (Something that can create universes such as ours). In your best layman's terms, can you help me explain order from disorder to a couple of theists who insist that the 2nd Law makes it impossible, or that in order to have order arise from disorder you need order in the first place, etc.... (the latter may be true, but in a trivial sense - the "laws" of the undifferentiated energy/quantum foam/or whatever it is that exists "outside" of the universe may have some order in this sense: "Be chaotic".) Anyhow, looking for some decent explanations on the current understanding of how things could have arose from random chaos. Can anyone help me out? Thanks in advance.
don't need to go to cosmology for this stuff. order from disorder happens all the time. oil and water for instance. shake up a bottle of the stuff. the oil and water separate out into layers. you see this all the time with copolymers folding on themselves in solution to expose the most hydrophilic parts and hide the hydrophobic parts, proteins are just a very complicated copolymer.

global entropy must increase but local entropy can definitely decrease. what do we mean by *global* though, is the question. Even a galaxy cluster can be considered "local".

 Similar discussions for: Noob here... Order from Disorder Thread Forum Replies Cosmology 20 Classical Physics 4 General Math 13 General Discussion 6 General Discussion 13


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

When you go on Fitbit’s website and want to download your own Fitbit data, you will find your way to their Data Export utility on their settings page. Once you get there, you are greeted with what looks like a slogan: “Your data belongs to you!”. Having seen the very high level data that they provide you with when you click download, I don’t believe them.

How Orwellian!

It’s nice that they let you download even this much data (I really like the sleep tracking feature), and I can at imagine myself being interested in my daily stats as I become more competitive with myself, but:

A) Where’s the heart rate data? I got a Fitbit Charge HR for my birthday, and I happen to like the heart-rate monitor function!
B) What about the intraday data? I am interested in doing further analysis of my heart rate based on time of day.
C) What about the specific activities that I log by pressing the button on the side of my Charge HR and annotate/entitle on the website?

For these reasons, I’m convinced that they don’t really believe that my data belong to me. That’s why it was nice to find out about Corey Nissen’s fitbitScraper package. At the current time, it allows you to get steps, distance, active minutes, floors, calories burned on a 15 minute interval, and heart rate on a 5 minute interval. It basically logs on to the Fitbit website and scrapes your data from the page source code!

Below, you will see the code I cooked up showing how I used his package to start a running dataset, spanning as many days as I want, on what my heart rate is doing throughout each day. If you want to adapt this code to download the other available categories of data, note that any references to heart rate will have to be changed accordingly 🙂

Initializing the dataframe

library(lubridate)
library(plyr)
library(dplyr)
library(fitbitScraper)

hr_data = list(time = c(), hrate = c())

startdate = as.Date('2015-08-07', format = "%Y-%m-%d")
enddate = today()
s = seq(startdate, enddate, by="days")

for (i in 1:length(s)) {
names(df) = c("time","hrate")
hr_data = rbind(hr_data, df)
rm(df)}

This code might need some explanation (feel free to skip this text if you understand it just fine). First you’ll notice the login function where you’ll need to enter in the email and password with which you registered for your fitbit account. Then you’ll notice that I’ve specified a ‘startdate’ variable and have put ‘2015-08-07′ as the value within the as.Date function. This was just the first full day that I spent with the fitbit, and you can change it to whatever your first fitbit day was. Then, the seq function conveniently creates a vector containing a series of date stamps starting from the specified ‘startdate’ and ending with ‘enddate’ which you can see is whatever date today happens to be.

Finally, we have the for loop, which loops through indices representing each element in the date sequence ‘s’ so that each day’s worth of 5 minute data can be saved to a temporary data frame, and appended to the ‘hr_data’ object, which converts from being a list to being a data frame. After all that is said and done, you now have your first volley of your own fitbit data.

But wait, there’s more! What about when you want to download more data, several days from now? Do you have to run this same code again, overwriting data from days that have already been processed? You could do that, or you could use the more complex code below, which only scrapes the fitbit website for data from days that aren’t complete, or there at all!

Code for when you want more and more and more fitbit data!!!

library(lubridate)
library(plyr)
library(dplyr)
library(fitbitScraper)

startdate = as.Date('2015-08-07', format = "%Y-%m-%d")
enddate = today()
s = seq(startdate, enddate, by="days")

completeness = hr_data %>% group_by(dte = as.Date(time)) %>% summarise(comp = mean(hrate > 0))
incomp.days = which(completeness$comp < .9) missing.days = which(s %in% completeness$dte == FALSE)
days.to.process = c(incomp.days, missing.days)

for (i in days.to.process) {
names(df) = c("time","hrate")

# the pre-existing dataframe, then the following applies:

if (mean(df$time %in% hr_data$time) == 1) {

# Get pct of nonzero hrate values in the pre-existing dataframe
# where the timestamp is the same
# as the current timestamp being processed in the for loop.

pct.complete.of.local.day = mean(hr_data$hrate[yday(hr_data$time) == yday(s[i])] > 0)

# Get pct of nonzero hrate values in the temporary dataframe
# where the timestamp is the same
# as the current timestamp being processed in the for loop.

pct.complete.of.server.day = mean(df$hrate[yday(df$time) == yday(s[i])] > 0)

# If the newly downloaded data are more complete for this day
# than what is pre-existing, overwrite the heart rate data
# for that day.

if (pct.complete.of.local.day < pct.complete.of.server.day) {
rows = which(hr_data$time %in% df$time)
hr_data$hrate[rows] = df$hrate}
}
else {

# the pre-existing dataframe, then use rbind to just add them!

hr_data = rbind(hr_data, df)
}
rm(df)
}

The first thing I’d like to draw your attention to in this code in the block beginning with the definition of the ‘completeness’ object and ending with the ‘days.to.process’ object. What I’m trying to accomplish with these objects is:

A) To get a list of which days in my pre-existing data frame might benefit from a complete data refresh due to too much missing data (you’ll notice I’ve defined an incomplete day as one with less than 90% of non-zero data), and
B) Which days worth of data I am missing because I just didn’t download data on that day.

The ‘days.to.process’ object is just a vector that puts together the date stamps of any days that are incomplete, and any days that are missing in my data frame.

In the for loop, I loop through the date stamps represented in the ‘days.to.process’ object, and proceed like I did before at first, but then a few new things happen:

I check to see if the date-time stamps in the temporary data frame are in my pre-existing data frame. If they are, I then do a comparison of the percent of data that is non-zero for that day in my pre-existing data frame (that’s the purpose of the ‘pct.complete.of.local.day’ variable) against the percent of data that is non-zero in the temporary data frame (hence the ‘pct.complete.of.server.day’ variable).

If there is more non-zero data in the temporary data frame for that day, I then find the row indices in the pre-existing data frame for the day in question, and then use them to update the data in place with the new data from the temporary data frame.  This particular comparison of non-zero data in the pre-existing vs the temporary data frame is probably redundant in most cases.

It would be nice to be able to easily/automatically get the physical activities that I have logged through the website (rowing machine, stationary bike, treadmill, etc.) so that I could correlate them with my heart rate at the time, but I guess I have to do that manually for now. Eventually, I’m interested in a somewhat deeper analysis of my heart rate at different times of the day.

At least now I feel more like my data belong to me, even though I had to resort to making use of someone else’s very smart coding (thank you, Corey!) to do it!


text:
# How do you simplify -3+2/3y-4-1/3y?

Nov 14, 2016

#### Answer:

$= \frac{1}{3} y - 7$

#### Explanation:

Re-arrange the terms and combine the like terms.

$\textcolor{b l u e}{\frac{2}{3} y - \frac{1}{3} y} \textcolor{red}{- 3 - 4}$

$= \textcolor{b l u e}{\frac{1}{3} y} \textcolor{red}{- 7}$


text:
# How to shrink the font size of references in Beamer

I'm preparing slides for my dissertation proposal. I want to include my bibliography on the last slide, but the references don't quite fit on one slide. Here's a small example of what I'm trying to accomplish:

\documentclass{beamer}
\usepackage{graphicx}
\usepackage{bm}
\usepackage[utf8]{inputenc}
\usepackage{apacite}

\title[A BNP Beta-Mixture IRT Model]
{A Bayesian Nonparametric Beta-Mixture\\Item Response Model}
\author[E. A. Arenson]
{Ethan A. Arenson}
\date{August 30, 2017}

\begin{document}

\begin{frame}
\frametitle{Sample Slide}
Random text \cite{Random Author}
\end{frame}

\begin{frame}
\frametitle{References}
\footnotesize
\bibliographystyle{apacite}
\bibliography{Dissertation}
\end{frame}
\end{document}

The \footnotesize command in the "References" frame does not reduce the font size of the references. How can I either reduce the font size or split the reference list across two slides?

• Split the reference with with \frame[allowframebreaks]{ – Bobyandbob May 25 '17 at 9:08
• Thanks for the tip. Although I had to use the command \begin{frame}[allowframebreaks]. – Ethan Arenson May 25 '17 at 9:36
• You are absolutly right, sorry for missspelling. – Bobyandbob May 25 '17 at 9:45

It is in the manual of apacite.

\documentclass{beamer}
\usepackage{apacite}
\renewcommand\bibliographytypesize{\footnotesize}
\begin{document}

\nocite{knuth:ct:c}

\begin{frame}{References}
\bibliographystyle{apacite}
\bibliography{biblatex-examples}
\end{frame}

\end{document}

• @EthanArenson It's \renewcommand not \renewcomammand. Also this has to come after \usepackage{apacite}. – Henri Menke May 25 '17 at 10:08


text:
## Understanding Varieties

Varieties are a basic structure in algebraic geometry. They were the central objects of study before Grothendieck reinvented the entire theory in his treatise Éléments de géométrie algébrique by introducing schemes. In the following we will introduce varieties and define algebraic curves.

Tangent vectors of functions are discussed early on in a standard calculus course. They are described either as directional derivatives or as velocities as curves. In manifold theory, we would like to generalize these ideas of calculus on $\mathbb{R}$ to calculus on manifolds. While there is an algebraic and geometric viewpoint of tangent vectors on manifolds, the algebraic realization is often faster to devlope the theory with. However, the geometric realization can be incredibly useful for computations. In the following, we’ll discuss both the algebraic and geometric viewpoints of tangent vectors, prove the equivalence between then, and see how both are useful by discussing the differential of a map.


text:
## Essential University Physics: Volume 1 (4th Edition)

We simplify equation 16.4 to find: $0 = m_wc_w(T-T_w) + m_pc_p(T-T_p)$ We solve for T and plug in the given values to find: $T = \frac{m_pc_pT_p + m_wc_wT_w}{m_pc_p + m_wc_w} = 26\ C$


text:
## Lukecrayonz 4 years ago Drawing: Solve for x

1. Lukecrayonz

|dw:1327600028704:dw|

2. anonymous

Use $$\Large SohCahToa$$ to solve.

3. Lukecrayonz

WHY AM I DOING SUCH STUPID MISTAKES TODAY

4. Lukecrayonz

today is not my math day, i literally forgot how to use Sohcahtoa.

5. anonymous

Did you remember? $\Large \begin{array}{l} \sin \theta = \frac{o}{h}\\ \cos \theta = \frac{a}{h}\\ \tan \theta = \frac{o}{a} \end{array}$So in this question, we have the hypotenuse, and x is either opposite 68 or adjacent to 22; so we can use sine or cosine to find the unknown. $\Large \begin{array}{l} \sin \theta = \frac{o}{h}\\ \sin 68 = \frac{x}{{6.6}}\\ x = \sin 68 \cdot 6.6 = 6.12\\ \cos \theta = \frac{a}{h}\\ \cos 22 = \frac{x}{{6.6}}\\ x = \cos 22 \cdot 6.6 = 6.12 \end{array}$ Since it's a right triangle (we know this since 180 - 68 - 22 = 90), we can work out the other unknown using Pythagoras' theorem, or just using the same rules as above.


text:
Understanding randomness

A Japanese journal “Susemi”, which means a seminar of mathematics, features randomness titled “understanding randomness” on the February number in 2011.

A Random Sequence of Reals

Since this paper was rejected by a Journal, I will divide the results, extend them and publish by some papers.

News
Jan 11, 2011, Rejected
Aug 2, 2010, Submitted to a Journal

Title
A Random Sequence of Reals

Type
Fullpaper

Journal
Unpublished


text:
# Thread: EXPONENTS AND ROOTS What is the m root of (16^2m + 64^m) /(8^m + 32^m)?

1. ## EXPONENTS AND ROOTS What is the m root of (16^2m + 64^m) /(8^m + 32^m)?

Sorry, I'm not good with notations, if you can't understand this: the m root of (16^2m + 64^m) /(8^m + 32^m)

Here's an image of the equation:

The answer, according to the book, is 8, but, unfortunately, it doesn't show the solution. Can you show me why it's 8 please?

Thanks a lot!

2. ## Re: EXPONENTS AND ROOTS What is the m root of (16^2m + 64^m) /(8^m + 32^m)?

I'll get you started,

$\displaystyle \frac{16^{2m}+64^m}{8^m+32^m}$

$\displaystyle =\frac{(2^4)^{2m}+(2^6)^m}{(2^3)^m+(2^5)^m}$

$\displaystyle =\frac{2^{8m}+2^{6m}}{2^{3m}+2^{5m}}$

Now factorise..

3. ## Re: EXPONENTS AND ROOTS What is the m root of (16^2m + 64^m) /(8^m + 32^m)?

Originally Posted by a tutor
I'll get you started,

$\displaystyle \frac{16^{2m}+64^m}{8^m+32^m}$

$\displaystyle =\frac{(2^4)^{2m}+(2^6)^m}{(2^3)^m+(2^5)^m}$

$\displaystyle =\frac{2^{8m}+2^{6m}}{2^{3m}+2^{5m}}$

Now factorise..
Actually, that's where I get stuck. I can't get past that point, but good to know I was on the right track

4. ## Re: EXPONENTS AND ROOTS What is the m root of (16^2m + 64^m) /(8^m + 32^m)?

$\displaystyle =\frac{2^{8m}+2^{6m}}{2^{3m}+2^{5m}}$

$\displaystyle =\frac{2^{6m}(2^{2m}+1)}{2^{3m}(2^{2m}+1)}=2^{3m}$


text:
Related Tags

generate
random
string
c#

How to generate a random string in C#

Generating a random string in C# uses the same concepts that are used to generate a random number in C#. The StringBuilder class and the NextDouble() method in the Random class are used to generate a random string.

Algorithm

• Use the Random.NextDouble() method to generate a float (flt) that is between $0.0$ and $1.0$ and is inclusive.
• Multiply flt with $25$ and take the Floor of the result. This will return an integer (shift) that is between $0$ and $25$ and is inclusive.
• Add the shift integer to $65$, which is the ASCII value of the character A. This will return an inclusive value between $65$ and $90$, which will be the ASCII value of some character. Converting that value to a character will return an uppercase character.
• Repeat the above steps as required to obtain a randomly generated string.

Code

The code snippet below illustrates the algorithm described above:

using System.Text;
using System;
class GenerateRandomString
{
static void Main()
{
int length = 7;

// creating a StringBuilder object()
StringBuilder str_build = new StringBuilder();
Random random = new Random();

char letter;

for (int i = 0; i < length; i++)
{
double flt = random.NextDouble();
int shift = Convert.ToInt32(Math.Floor(25 * flt));
letter = Convert.ToChar(shift + 65);
str_build.Append(letter);
}
System.Console.WriteLine(str_build.ToString());
}
}

RELATED TAGS

generate
random
string
c#