text:
• Create Account

# MSAA issues

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1dongsaturn  Members   -  Reputation: 115

Like
0Likes
Like

Posted 17 October 2013 - 06:48 AM

Hi guys,

I have read some articles [A Quick Overview of MSAA] [Rasterization Rules] about MSAA and rasterization, and tried to understand how MSAA works.

I articles are great and helpful. But I still have a little question, in the [Rasterization Rules] they said each pixel is only shading once at the pixel center with the interpolated attributes:

For a triangle, a coverage test is performed for each sample location (not for a pixel center). If more than one sample location is covered, a pixel shader runs once with attributes interpolated at the pixel center. The result is stored (replicated) for each covered sample location in the pixel that passes the depth/stencil test.

Also mentioned in the [A Quick Overview of MSAA]:

Instead, the pixel shader is executed only once for each pixel where the triangle covers at least one subsample. Or in other words, it is executed once for each pixel where the coverage mask is non-zero.

Please think about this situation: With 4xMSAA, In the rasterization stage we have 2 triangles both coverage 2 sub pixel samples(passes depth/stencil test) with the same pixel.

Does the pixel center attributes are interpolated from the 4 covered sub pixels or the same as none MSAA mode(interpolated from trangle position)?

Does only the interpolated pixel center attributes will be out put to the pixel shader in per pixel frequency shading mode?

Does the covered sub pixels will be out put to the pixel shader instead of pixel center in the per sample frequency shading mode (DX10.1)?

Update:

Another question: I found the MSAA implementation in the Deferred Shading example is a little different, instead of only shading once at the pixel center with the interpolated attributes, they use an edge detection algorithm to decided whether shading per sub pixel samples or per pixel.

Why not just use the conventional one in deferred shading? It's faster.

Thank you very much.

Edited by dongsaturn, 17 October 2013 - 07:23 AM.

### #2backstep  Members   -  Reputation: 285

Like
1Likes
Like

Posted 17 October 2013 - 07:00 PM

Hey, since nobody seems to be touching this, and I also had these questions about the deferred shading sample, I'll try to explain my understanding (again). Apologies in advance for the quality of the explanation.

First of all, given your example of forward rendering with 4xMSAA, where a single pixel has two triangles each covering 2 of the 4 sub-samples...

Does the pixel center attributes are interpolated from the 4 covered sub pixels or the same as none MSAA mode(interpolated from trangle position)?

I believe by default with MSAA it's the pixel center attributes used in the pixel shader (same as non-MSAA), regardless of which sub samples were covered. So with your example pixel, the pixel was shaded twice, once for each triangle with partial coverage of the pixel. Both pixel shaders ran as if they covered the whole pixel the same as in non-MSAA mode. The result of each pixel shader was written to the pair of the 4 subsamples that each triangle covered.

In the Rasterization Rules link you posted, there is mention of centroid sampling, which will instead use attributes interpolated closer to the covered samples rather than always using the pixel center. I think that to use it you need to specify the interpolation method in the pixel shader input struct (for each member), as detailed here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb509668(v=vs.85).aspx .

Does only the interpolated pixel center attributes will be out put to the pixel shader in per pixel frequency shading mode?

This seems like a similar question to the first one? I'm sorry if I misunderstand it. The pixel shader input is interpolated from the pixel center attributes by default, unless you specify a different method of interpolation in the pixel shader input struct.

Does the covered sub pixels will be out put to the pixel shader instead of pixel center in the per sample frequency shading mode (DX10.1)?

I assume you mean the "sample" interpolation modifier available to shader model 4.1? So far as I understand, this is equivalent to super sampling, in that the pixel shader will run for every sub-sample that is covered by a triangle, and yes each sub-sample is shaded using the interpolated sub-sample position rather than the pixel center, but only for those attributes (PS input struct members) you specifically declare with the sample modifier. Once you declare a single input struct member with sample modifier, all shaded sub-samples will invoke the pixel shader, but those input members without a sample modifier will be interpolated to the pixel center for all sub-samples of that pixel.

Another question: I found the MSAA implementation in the Deferred Shading example is a little different, instead of only shading once at the pixel center with the interpolated attributes, they use an edge detection algorithm to decided whether shading per sub pixel samples or per pixel.
Why not just use the conventional one in deferred shading? It's faster.

If you think about how conventional MSAA works during rasterization, it can share a single shading result amongst multiple sub-samples because it knows which triangle covers which sub-samples, and so, which sub-samples can share per-pixel attributes and share pixel shading cost. It has access to per-pixel attributes via interpolation of the vertex attributes.

Compare that to a deferred renderer, which only really knows about the post-rasterization attributes of each sub-sample, and has no access to per-pixel attributes. It doesn't know which sub-samples were covered by which triangle, and therefore doesn't know which sub-samples can share the same pixel attributes. Basically the deferred renderer has no knowledge of coverage or access to pixel center attributes.

It's been about a month since I looked at the tiled deferred example, but I think the edge detection looks for large discontinuities within each pixel's sub-sample attributes (normals and depth?) to try to guess whether they originate from the same triangle/surface. When no edge is detected it just splats shading for the first sample of the pixel in the gbuffer to all samples for the pixel in the output buffer.

Let's repeat your forward 4xMSAA example where two triangles each cover 2 of the 4 sub-samples for a pixel, but this time in the deferred renderer with a 4xMSAA gbuffer. It detects at least one of the sub-samples has sufficiently different attributes from another sub-sample, within the same pixel, and flags the pixel for per-sample shading. It immediately shades sub-sample 0 for the pixel and then later shades sub-samples 1-3 for the pixel that was flagged, right?

So for the same edge pixel, deferred 4xMSAA shades four times, once for each sub-sample, where forward 4xMSAA only had to shade twice to write to all four samples. But how would you have the deferred renderer detect when sub-samples belong to the same surface? And how would you interpolate the attributes for a similar effect to per-pixel shading shared between sub-samples? (since deferred cannot access the pixel center attributes, only the available sub-sample attributes in the gbuffer)

My naive guess is you'd first need to bucket sub-samples during edge detection, so in our example samples 0 and 1 belong to triangle one, while samples 2 and 3 look to belong to triangle two. For 4xMSAA your edge detection function would need to return the equivalent a 4x4 matrix of bits to show which triangle/surface each sub-sample belongs to (perhaps return a packed int). Then you'd have to interpolate the gbuffer attributes of sub-samples that share the same detected surface/triangle, then shade once for each detected surface/triangle, then write each shading result to the relevant pair of output sub-samples.

So compared to default, you'd be doing the same number of gbuffer reads and the same number of output sample writes, extra work bucketing the samples to surfaces and then interpolating gbuffer attributes per-surface, but less work shading each sample (shade once per-surface rather than once per-sample). I would suppose that how much faster it is depends upon whether the sample shading or the gbuffer reads are the limiting factor in deferred MSAA.

Unless you have a really expensive lighting shader (BRDF), I'm not certain you'd gain a whole lot from attempting to reproduce conventional MSAA's shared-shading-cost of sub-samples. I'm also not certain whether it would affect AA quality in a noticeable (bad) way, since the pixel resolve would be working with less information than before.

You could gain more if you skip interpolating the gbuffer attributes and just use the values belonging to the first sub-sample for each detected surface within a pixel. That would reduce your gbuffer reads and the computation cost. However, I expect the skipped gbuffer interpolation really would degrade the AA quality.

I should also point out I'm not that far from a beginner myself, and there might be other effects related to memory latency and access patterns, that're beyond my understanding. I also might have missed something important.

Also, I might just be wrong! It could turn out to be way faster and just as good quality as per-sample shading, perhaps one of us should try to implement it and find out for certain.

### #3dongsaturn  Members   -  Reputation: 115

Like
1Likes
Like

Posted 18 October 2013 - 06:21 AM

I believe by default with MSAA it's the pixel center attributes used in the pixel shader (same as non-MSAA), regardless of which sub samples were covered. So with your example pixel, the pixel was shaded twice, once for each triangle with partial coverage of the pixel. Both pixel shaders ran as if they covered the whole pixel the same as in non-MSAA mode. The result of each pixel shader was written to the pair of the 4 subsamples that each triangle covered.

It's seems reasonable.

Compare that to a deferred renderer, which only really knows about the post-rasterization attributes of each sub-sample, and has no access to per-pixel attributes. It doesn't know which sub-samples were covered by which triangle, and therefore doesn't know which sub-samples can share the same pixel attributes. Basically the deferred renderer has no knowledge of coverage or access to pixel center attributes.

SV_Coverage: Indicates to pixel shader which sub-samples covered during raster stage.
We can use SV_Coverage to output the coverage info to the GBuffer. But in the CryEngine3 Graphics Gems presentation they suggest: Avoid default SV_COVERAGE, since it results in redundant processing on regions not requiring MSAA!
And It seems that they used a similar approach as the Deferred Shading example to create the coverage mask, but they did not output any extra info (like the positionZGrad) in the GBuffer!

My naive guess is you'd first need to bucket sub-samples during edge detection, so in our example samples 0 and 1 belong to triangle one, while samples 2 and 3 look to belong to triangle two. For 4xMSAA your edge detection function would need to return the equivalent a 4x4 matrix of bits to show which triangle/surface each sub-sample belongs to (perhaps return a packed int). Then you'd have to interpolate the gbuffer attributes of sub-samples that share the same detected surface/triangle, then shade once for each detected surface/triangle, then write each shading result to the relevant pair of output sub-samples.

I realize that in the Deferred Shading example, they defer the scheduling of per-sample-shaded pixels until after sample 0 has been shaded across the whole tile. This allows better SIMD packing and scheduling. And I did some test, it's much faster than rendering other sub samples after sample 0 directly.

So If we have to use the interpolated attributes of sub-samples that covered by same surface/triangle, we need to out put them to an temp global buffer first to be able to defer the per-sample shading! That seems to be a big problems, and could be slower.

Edited by dongsaturn, 18 October 2013 - 06:37 AM.

### #4backstep  Members   -  Reputation: 285

Like
0Likes
Like

Posted 18 October 2013 - 02:53 PM

Hey, thanks for the discussion too, I still have plenty to learn.

I wasn't aware you could use SV_Coverage reliably for opaque geometry. I've only come across it for alpha tested surfaces, and I've not done a whole lot with those yet. So thanks for the information.

If I remember correctly, I think there's a #define in one of the hlsl files for the tiled deferred example, that allows you to immediately shade the other sub-samples with sample 0, rather than deferring them to shade in a second pass. I think it was called DEFER_PER_SAMPLE and you can just set it 0. Like you said, I remember disabling it and finding performance dropped.

This weekend I'll try to implement your idea with the original intel example app, with deferring the sub-sample interpolation to the per-sample pass (after all sample 0's complete) and then shading once per detected surface. I'll post back about how it works out.

Also since you're working with compute shaders, I thought you might not know the new Visual Studio 2013 that released yesterday has excellent new support for compute shader debugging. You can select a threadgroup and a thread, and then step through the shader execution just as you would debugging a pixel shader. Previously I was using nSight and debugging on the GPU, and as useful as that was, the new VS2013 debugging is far more usable and responsive.

### #5dongsaturn  Members   -  Reputation: 115

Like
0Likes
Like

Posted 19 October 2013 - 03:00 AM

Also since you're working with compute shaders, I thought you might not know the new Visual Studio 2013 that released yesterday has excellent new support for compute shader debugging. You can select a threadgroup and a thread, and then step through the shader execution just as you would debugging a pixel shader. Previously I was using nSight and debugging on the GPU, and as useful as that was, the new VS2013 debugging is far more usable and responsive.

Thank for your reminding, i will take a try.

### #6backstep  Members   -  Reputation: 285

Like
1Likes
Like

Posted 20 October 2013 - 01:05 PM

I spent this afternoon looking at that intel tiled deferred example again, and seeing if it was possible to implement your idea. The good news is it was workable, and it only took editing a handful of files. I'll attach them to this post in a zip file, you can just drop them into the project folder and rebuild the project to try it. I commented the code pretty heavily so it should make sense to read.

The bad news is I couldn't get it any faster than the default method of shading all sub-samples for edge pixels (it was only ~2-4% slower though). There's a couple of issues that I'm guessing are the reason sharing the shading output between samples isn't faster, but I'll explain how I implemented it before digging into that.

For reference, I always ran it at 1920x1080 with 4x MSAA, 1024 lights.

The first thing was associating sub-samples with each other, or rather associating sub-samples that shared the same surface/triangle. Usually sub-samples are only tested against sample 0 and as long as any one doesn't appear to be from the same surface as sample 0, then the pixel is added to an array of unsigned-ints in thread-group-shared-memory, and when that array is processed in a second pass by the threadgroup, all 3 remaining sub-samples in an edge pixel get shaded, each sample by a different thread. the TGSM uint array items just hold the viewport coordinates of the pixel packed as 2x 16bit uints.

It doesn't really need 16 bits per axis for pixel coords, so I cut that down to 12 bits per axis, still leaving a max resolution of 4k by 4k (computeshadertile.hlsl line:46). Anyhow that opens up 8 remaining bits to pack the sub-sample associations into. The sub-sample test against sample 0 (function is called RequiresPerSampleShading) usually returns a bool to signify if any sub-samples didn't match sample0's surface, instead I rewrote it (poorly) to pack the sub-sample association into the first 9 bits of a uint (see gbuffer.hlsl line:120). The packing is a bit branchy but I tried to keep it to a minimum. It's all commented so I won't explain it here. I will paste in how the bit packing is laid out:

//perSampleField's first 9 bits describe which samples share a surface and so can be shaded once but written to multiple output samples.
//the layout is as follows:
//
//   shaded sample:			sample0			sample1			sample2			sample3
//   samples to write:			1,2,3			1,2,3			2,3			3
//   bits:				0,1,2			3,4,5			6,7			8
//
//sample0 is always written from sample0's shading so no 4th bit is needed for sample0.  if Sample1 is a unique surface, it's shading will
//always be written for sample1, and could be written for samples 2 and 3.  Similarly if sample2 is a unique surface from samples 0 and 1,
//then sample2 will always use it's own shading, and only sample3 might also use it.  If sample3 is unique surface from all the other samples
//then only sample3 can possibly use sample3's shading result(since for sample3 to be unique, all previous samples must also be unique).
//
//here is an example bitfield, where samples 0 and 2 are the same surface, but samples 1 and 3 are unique surfaces.
//
// bits:		0	1	2	3	4	5	6	7	8
// values:		0	1	0	1	0	0	0	0	1
//
//So when sample0 is shaded, it's result is written to samples 0 and 2.  When sample1 is shaded it's only written to sample1, and when sample3
//is shaded it's only written to sample3.

The actual cost of sorting the samples and packing them into the bitfield isn't that bad. It only pushed the frametime from 8.18ms to 8.26ms.

So that's 9 bits of data and 8 bits of free space. Luckily Sample0 is always shaded and written in the first pass by the threadgroup, so once perSampleField is returned then sample0 is shaded and written to output like normal, except any others samples associated with it's surface are now also written too. that is, any samples flagged in bits 0 to 2.

That means the three bits 0-2 are no longer needed, so the bitfield can be shifted once to the right. Now it's only 8 bits long, with two unused bits at the beginning. There is a reason to keep those first 2 bits available. Normally when subsamples need to be shaded in the threadgroup's second pass, you can just add the pixel to the uint array in TGSM that acts as a list, because all three remaining samples need to be shaded. However now we only want to shade the unique samples within a pixel listed for subsample shading. Each pixel that requires per-sample shading now, may only have one or two unique samples, so that poses a scheduling problem. You can't split each pixel between every 3 threads like before, since you'd end up with idle threads when only one or two samples are unique and need shading, out of every 3 from a pixel.

This solves a problem in that no threads will be given samples that don't require shading, since the list now only contains unique samples we want shaded. However, it also causes a problem since you end up writing and reading from TGSM a bit more. On a couple of occasions while I was testing, even 4xMSAA overran the 256 item array length on a tile/threadgroup. I added a check to avoid it in future, and there's no visible degradation from it, but it is technically a bit of a hack.

You can also just extend the TGSM array, I found doubling it to 512 samples added roughly 0.20ms to the frametime. Since the hacky fix had no noticeable drawback at 4xMSAA, I left that in the uploaded files.

So bits 0 and 1 are just a packed uint of the sample to be shaded (1, 2, or 3), while bits 2-7 describe the other samples' associations to the sample being shaded, so that once it's shaded they can also be written to output along with it. The details on adding samples instead of pixels to the TGSM array are in ComputeTileShader.hlsl around line 220 onward. Similarly the details on shading the sample once and writing that to multiple output samples are in the same file around line 324. Likewise it's all commented so I won't explain the details here, it's just a little bit of bit shifting and setting/clearing, and using intrinsic functions like firstbithigh and firstbitlow to parse the values out. You can toggle between shading unique-samples or the original all-samples-per-pixel using a new #define in ShaderDefines.h called UNIQUE_SAMPLES.

There's also a COMPLEX_BRDF toggle in ShaderDefines.h. When it's enabled the compute shader uses a more involved BRDF than the default simple phong shading (the new BRDF is oren-nayar diffuse with cook-torrance specular that I think I got from this very forum!). I thought it was worth testing to see if saving the shading time associated with a more expensive BRDF would offset the increased TGSM usage. It didn't.

Here were my actual frametime results, on a nvidia 560ti, and like I mentioned, 1920x1080, 1024 lights, 4xMSAA, oh and built with Release target:

8.18ms - original unmodified intel app (newly compiled though).
8.26ms - sample surface comparison and uint packed return, original pixel-only TGSM array.
8.41ms - sample surface comparison and uint packed return, unique-sample-only TGSM array.
9.81ms - sample surface comparison and uint packed return, original pixel-only TGSM array, complex BRDF.
9.98ms - sample surface comparison and uint packed return, unique-sample-only TGSM array, complex BRDF.

As you can see, whatever gains were made reducing the number of shaded samples, more was lost in the extra TGSM usage. I also suspect the export cost when writing samples is possibly higher now. With the original pixel-only TGSM array used in the second pass for edge pixel samples, each thread shades one sample and writes one sample. With the unique-samples style TGSM array, each thread shades one sample still, but may write two or three samples afterward. I think it just makes the thread scheduling a bit 'lumpy' and uneven perhaps.

It's still pretty close in speed to the original method though, and much much faster than disabling defer_per_sample, so it's definitely a usable technique. I'm just not sure what would make it worth using over the normal implementation.

Anyhow code is attached, extract to the original project directory. It's hard to see how to optimize the technique. Ideally it'd be good to reduce the TGSM usage to per-pixel once more, but I don't see how to efficiently schedule sample shading for that when each pixel could have an undetermined number of samples to shade. Maybe you'll see some optimizations I missed, or a bug!.

Oh, I never tried to interpolate the gbuffer attributes for samples that share surfaces. It's a bunch of extra reads and ops for what would appear to be a minor benefit, since the multisample resolve on the output buffer already seems indistinguishable from the original app's output. Also, if you enable SAMPLE_COLORS in shaderdefines.h you can use the #if blocks in computetileshader_color.hlsl to check the sample outputs. Otherwise it's identical to the main compute shader file (I moved the #if blocks out for readability).

### #7dongsaturn  Members   -  Reputation: 115

Like
0Likes
Like

Posted 21 October 2013 - 01:56 AM

It's wonderful! I really appreciate it.

There is a small mistake in computeshadertile.hlsl line:33

should be:

groupshared uint sPerSamplePixels[COMPUTE_SHADER_TILE_GROUP_SIZE * 3];

I guess you forgot to change it.

Sorry I missed the code for preventing overrun.

I also suspect the export cost when writing samples is possibly higher now. With the original pixel-only TGSM array used in the second pass for edge pixel samples, each thread shades one sample and writes one sample. With the unique-samples style TGSM array, each thread shades one sample still, but may write two or three samples afterward. I think it just makes the thread scheduling a bit 'lumpy' and uneven perhaps.

I think the divergent branching also result in writing more samples.

Threads within a single warp take different paths, different execution paths are serialized.

Edited by dongsaturn, 21 October 2013 - 05:50 AM.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS


text:
시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB147777.778%

## 문제

A XOR gate has two inputs and one output. Its operation can be described by the following table

input 1   input 2    output
0         0          0
0         1          1
1         0          1
1         1          0

A system of XOR gates is called a XOR net if it has n inputs and one output and meets the following conditions:

1. Each input of the net is connected to at least one input of a gate.
2. Each input of a gate in the net is connected to one input of the net or one output of another gate.
3. The output of exactly one gate is connected to output of the net.
4. Each output of a gate in the net is connected to at least one input of another gate, or to the output of the net.
5. There exists a numbering of gates such that for every gate each of its inputs is connected to the input of the net or to the output of a gate with a smaller number.

The net of 6 gates is shown in the figure. It has 5 inputs and 1 output and meets conditions 1–5 so it is a XOR net. Observe that the numbers given in the figure do not agree with the fifth condition but there exists an appropriate numbering.

Inputs of a net are numbered from 1 to n. An input state of a XOR net can be described by an input word of the length n. Each letter of such a word is a binary digit 0 or 1. We assume that i-th digit of the word is a state of the i-th input of the net. For every input state the net returns 0 or 1 on its output. Each input word is a binary code of a natural number so we can order input words with respect to their values. We will test XOR nets by sending words from a fixed range to its input and counting the number of digits 1 returned on the output of the net.

Write a program that:

• reads the description of a XOR net from the standard input; the descriptions consists of: the number of inputs n, the number of gates m, the number of the gate connected to the output of the net and descriptions of connections;
• reads from the same file two binary words of length n — lower and upper limit of the range in which we will test the net;
• computes for how many inputs from the given range the net returns 1 on its output;
• writes the result to the standard output.

We assume that: 3 ≤ n ≤ 100, 3 ≤ m ≤ 3,000 and that the gates of the given net are numbered from 1 to m in an arbitrary order.

## 입력

In the first line of the standard input there are three integers separated by single spaces. They are respectively: the number of inputs n of the given net, the number of gates m and the number of the gate connected to the output of the net.

In the following m lines there are descriptions of the connections between gates of the net. In the i-th line, for 1 ≤ i ≤ m, there is a description of the connections of two inputs of the i-th gate. Such a description consists of two integers from the range [-n,m] separated by a single space. If an input of the gate is connected to the k-th input of the net then the description of this connection is the negative integer -k, if this input is connected to the output of the j-th gate then it is described by the positive number j.

In the following two lines there are two n-bit words a and b. They represent lower and upper limits of the range in which we test the net. We assume that in the given range there is at most 100,000 words.

## 출력

In the standard output there should be written a single non-negative integer — the number of words from the range a ≤ s ≤ b (where < is the relation consistent with the values of binary words), for which the XOR net returns 1 on its output.

## 예제 입력 1

5 6 5
-1 -2
1 3
1 -2
2 -3
4 6
-4 -5
00111
01110

## 예제 출력 1

5

format: plain


text:
# How Far Apart Are Two Random Points in a Square?

Posted by Cleve Moler,

How far apart can you expect two points chosen at random in the unit square to be? I found this problem on the YouTube channel maintained by Presh Talwalkar, Mind Your Decisions. He correctly calls it a very hard puzzle. At first, I guessed the answer might be $1/2$. But the correct answer is more interesting than that.... read more >>

# A Logo Zoetrope

Posted by Cleve Moler,

A quick post to point my readers to Ned Gulley's post in MATLAB Community, A Galloping Logo Zoetrope. Don't know what a Zoetrope is? Ned explains.... read more >>

Posted by Cleve Moler,

Do not get involved in a bar bet with Brad Efron and his dice until you have read this.... read more >>

# C^5, Cleve’s Corner Collection Card Catalog2

Posted by Cleve Moler,

I have been writing books, programs, newsletter columns and blogs since 1990. I have now collected all of this material into one repository. Cleve's Corner Collection consists of 458 "documents", all available on the internet. There are... read more >>

# Levenshtein Edit Distance Between Strings

Posted by Cleve Moler,

How can you measure the distance between two words? How can you find the closest match to a word in a list of words? The Levenshtein distance between two strings is the number of single character deletions, insertions, or substitutions required to transform one string into the other. This is also known as the edit distance.... read more >>

# Latent Semantic Indexing, SVD, and Zipf’s Law5

Posted by Cleve Moler,

Latent Semantic Indexing, LSI, uses the Singular Value Decomposition of a term-by-document matrix to represent the information in the documents in a manner that facilitates responding to queries and other information retrieval tasks. I set out to learn for myself how LSI is implemented. I am finding that it is harder than I thought.... read more >>

# What is the Condition Number of a Matrix?1

Posted by Cleve Moler,

A couple of questions in comments on recent blog posts have prompted me to discuss matrix condition numbers.... read more >>

# Householder Seminar HHXX on Numerical Linear Algebra2

Posted by Cleve Moler,

The Householder meetings on Numerical Linear Algebra have been held roughly every three years since 1961. The twentieth, with the logo HHXX, was held June 18th through 23rd at Virginia Tech in Blacksburg, Virginia. I've been to 17 of the meetings. They have been an important part of my professional life and I've written Cleve's Corner articles and blog posts about them, MathWorks News & Notes, and Householder XIX.... read more >>

# Quadruple Precision, 128-bit Floating Point Arithmetic9

Posted by Cleve Moler,

The floating point arithmetic format that occupies 128 bits of storage is known as binary128 or quadruple precision. This blog post describes an implementation of quadruple precision programmed entirely in the MATLAB language.... read more >>

These postings are the author's and don't necessarily represent the opinions of MathWorks.


text:
### Author Topic: TIConvert  (Read 7551 times)

0 Members and 1 Guest are viewing this topic.

#### Michael_Lee

• LV9 Veteran (Next: 1337)
• Posts: 1019
• Rating: +124/-9
##### Re: TIConvert
« Reply #30 on: April 23, 2011, 05:53:56 pm »
Well, not much progress.

I've been really busy with a bunch of projects lately (large essay, piano recital, trying to learn javascript (currently fail), trying to organize + make website for robotics club, somehow taking over said robotics club, large math assignment, mandatory school project (unless I don't want to graduate), etc..., all nearly at once)

The detokenizer that I've posted already should be pretty good to use, you should just be able to add it in without much modification (although it's really ugly...).

I'm going to go ahead and give you guys what I have right now, with the understanding that it doesn't work yet + might be overly complicated + is extremely different from previous versions + is written in Python 3.1 and might not work in older Python versions due to differences in how bytes are treated.

I think tokenizing in theory works, but I haven't had time to add in making checksums + generating metadata, and never really completed it.  Detokenizing should also work.

I'll probably resume development in about two weeks to a month (or I might just have to wait until summer).

I'm not too worried about licenses -- this project informally uses the Academic Free License 3.0, but really, I don't care too much about licensing as long as you don't go around claiming you wrote my code, or doing other weird stuff.
My website: Currently boring.

Projects:
Axe Interpreter
> Core: Done
> Memory: Need write code to add constants.
> Graphics: Rewritten.  Needs to integrate sprites with constants.
> IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
> Stomping bugs
> Internet version: On hold until I can make my website less boring/broken.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: TIConvert
« Reply #31 on: April 24, 2011, 08:14:31 am »
Nice to see this is still being worked on. I'll suggest alberthrocks to use this as our tokenizer for Axe GUI Libraries.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: TIConvert
« Reply #32 on: May 19, 2011, 04:27:07 pm »
I have now the need to use this program since it's cross-platform and I need to write Axe files in Linux.

The version 0.2 seems to be in .exe and I'm not sure if I can use it the same way as the last one.

I got this when running:

Code: [Select]
[email protected] ~/Documents/Calculators/TIConvert $python main_v0_3.py Traceback (most recent call last): File "main_v0_3.py", line 107, in <module> (input_path, target_path) = command_info.ReturnPaths(suffix = "_out.txt") File "main_v0_3.py", line 67, in ReturnPaths input_path = self.arg[0]IndexError: list index out of range[email protected] ~/Documents/Calculators/TIConvert$
Python 2.6.6, Linux Mint 10

#### Michael_Lee

• LV9 Veteran (Next: 1337)
• Posts: 1019
• Rating: +124/-9
##### Re: TIConvert
« Reply #33 on: May 19, 2011, 06:26:51 pm »
You probably never provided an input.

You have to drag the file you want to decompile over the python or exe.  If you don't want to do that, then here's a manual method:

Change
Code: [Select]
# Step 1: Reading arguments from the command line.command_info = CommandLine()options = command_info.RunParser()(input_path, target_path) = command_info.ReturnPaths(suffix = "_out.txt")into this:
Code: [Select]
# Step 1: Manually providing arguments.input_path = "directory/folder/THEGAME.8xp"target_path = "directory/folder/THEGAME_out.txt"'options = {'tabs': 4, 'quiet': False', 'colons': False}
Basically, that single line runs a command line parser that takes arguments inputted in from the command line, then returns the path of the 8xp you want to decompile, then path you want your output to be.
Alter those two strings to suit your needs.

Alter the 'options' dictionary to suit your needs.  If you want indenting, set 'tabs' equal the the number of spaces you want per indent.  If 'quiet' is set to True, then it won't display any info on the command line/console.  If 'colons' is set to True, then it appends a colon to the start of each line.
My website: Currently boring.

Projects:
Axe Interpreter
> Core: Done
> Memory: Need write code to add constants.
> Graphics: Rewritten.  Needs to integrate sprites with constants.
> IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
> Stomping bugs
> Internet version: On hold until I can make my website less boring/broken.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: TIConvert
« Reply #34 on: May 19, 2011, 06:28:14 pm »
This goes from Axe source to ASM files and other way around?

#### Michael_Lee

• LV9 Veteran (Next: 1337)
• Posts: 1019
• Rating: +124/-9
##### Re: TIConvert
« Reply #35 on: May 19, 2011, 06:33:30 pm »
I know for a fact it can do 8xp source to text file.

I don't think I finished text file to 8xp source, though you could give it a shot.

And I don't even want to try text or source to compiled 8xp (that's what Quigbo's working on, after all )
My website: Currently boring.

Projects:
Axe Interpreter
> Core: Done
> Memory: Need write code to add constants.
> Graphics: Rewritten.  Needs to integrate sprites with constants.
> IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
> Stomping bugs
> Internet version: On hold until I can make my website less boring/broken.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: TIConvert
« Reply #36 on: May 19, 2011, 06:40:28 pm »
I know for a fact it can do 8xp source to text file.

I don't think I finished text file to 8xp source, though you could give it a shot.

And I don't even want to try text or source to compiled 8xp (that's what Quigbo's working on, after all )

I know the latter doesn't work obviously. I need the second one.

Michael, I really think you should try and finish this

#### Michael_Lee

• LV9 Veteran (Next: 1337)
• Posts: 1019
• Rating: +124/-9
##### Re: TIConvert
« Reply #37 on: July 15, 2011, 11:57:52 am »
A quick update:

I've rewritten it all from scratch (again  ) and managed to get both detokenizing and tokenizing working nearly perfect.

All I have left is figuring out how to wrap the metadata around the tokenized part, which shouldn't be too hard (I suppose...)
My website: Currently boring.

Projects:
Axe Interpreter
> Core: Done
> Memory: Need write code to add constants.
> Graphics: Rewritten.  Needs to integrate sprites with constants.
> IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
> Stomping bugs
> Internet version: On hold until I can make my website less boring/broken.

#### Michael_Lee

• LV9 Veteran (Next: 1337)
• Posts: 1019
• Rating: +124/-9
##### Re: TIConvert
« Reply #38 on: July 15, 2011, 06:17:27 pm »
I finished!

Changes:
> You can convert .txt to .8xp now!
> Switched from Python 3.1 to Python 2.7
> Rewrote everything
> Fixed some bugs.

Edit:
I don't feel like making another post, so here's a short update.
Changes:
> A bunch of minor code fixes
> The parser can handle broken code a little better
> You can now have the .txt files have fancy output!  (characters like → and λ)
> TI-Basic tokens in .txt files will still compile normally into .8xp files.
> All .dll and other similar files have been compressed into a single .exe file for portability

I'm going to work on support for TI-Basic tomorrow.
« Last Edit: July 17, 2011, 01:05:31 am by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
> Core: Done
> Memory: Need write code to add constants.
> Graphics: Rewritten.  Needs to integrate sprites with constants.
> IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
> Stomping bugs
> Internet version: On hold until I can make my website less boring/broken.

#### BlakPilar

• Posts: 734
• Rating: +44/-1
##### Re: TIConvert
« Reply #39 on: July 18, 2011, 01:01:17 am »
Sorry, I didn't take the time to read any other posts, but what do you mean by "it probably wouldn't be able to compile" in the OP?

--EDIT--
I have "fancy output" in TBEXE implemented, too (a pain in the butt to find which characters were accounted for, though)! Great minds think alike, I guess
« Last Edit: July 18, 2011, 01:03:15 am by BlakPilar »

#### Michael_Lee

• LV9 Veteran (Next: 1337)
• Posts: 1019
• Rating: +124/-9
##### Re: TIConvert
« Reply #40 on: July 18, 2011, 03:03:06 pm »
Sorry, I didn't take the time to read any other posts, but what do you mean by "it probably wouldn't be able to compile" in the OP?

--EDIT--
I have "fancy output" in TBEXE implemented, too (a pain in the butt to find which characters were accounted for, though)! Great minds think alike, I guess

Ah.  Back then, tokenizing text was very mysterious to me, and I wasn't sure if I was capable of programming such a thing.  Converted text files should have no problem compiling now
My website: Currently boring.

Projects:
Axe Interpreter
> Core: Done
> Memory: Need write code to add constants.
> Graphics: Rewritten.  Needs to integrate sprites with constants.
> IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
> Stomping bugs
> Internet version: On hold until I can make my website less boring/broken.

#### BlakPilar

• Posts: 734
• Rating: +44/-1
##### Re: TIConvert
« Reply #41 on: July 18, 2011, 08:27:29 pm »
Sorry, I didn't take the time to read any other posts, but what do you mean by "it probably wouldn't be able to compile" in the OP?

--EDIT--
I have "fancy output" in TBEXE implemented, too (a pain in the butt to find which characters were accounted for, though)! Great minds think alike, I guess

Ah.  Back then, tokenizing text was very mysterious to me, and I wasn't sure if I was capable of programming such a thing.  Converted text files should have no problem compiling now

Psh, nahhh. (De)Tokenizing is actually pretty easy once you know which byte belongs to which command lol. But good to hear that it's working on here!

#### lunixbochs

• LV1 Newcomer (Next: 20)
• Posts: 13
• Rating: +1/-0
##### Re: TIConvert
« Reply #42 on: July 18, 2011, 10:24:11 pm »
I just started a Python TI-BASIC implementation a few weeks back. It's actually doing pretty well.

My parser/tokenizer implementation is here
I'm using a list of tokens and simply comparing each token (sorted from longest to shortest) against my position in the text until I find a match, then incrementing my position by the length of the match. It's worked perfectly so far with many tests, and it's extremely fast (5000 lines / 70k characters took <1s to tokenize). If you take away the cruft for expressions and bracket parsing, it might be useful for your purposes

This commit has the raw token lists, the current version is all dynamic. The full parser from that commit might actually be useful, as it's the raw version with just string output.

#### BlakPilar

• Posts: 734
• Rating: +44/-1
##### Re: TIConvert
« Reply #43 on: July 18, 2011, 11:23:59 pm »
Hmm... Python, eh? I personally can't deal with Python because it is wwaaayyyyy too loose of a language for me (I need order) lol. That's why I use C#. calccrypto (at least that's his name over on TIBD, not sure what it is here) made an 8xp to txt Python converter that can be found here.

In TBEXE, my detokenizer works perfectly. I just need to stop being lazy and work on my tokenizer :\

#### jnesselr

• King Graphmastur
• LV11 Super Veteran (Next: 3000)
• Posts: 2270
• Rating: +81/-20
• TAO == epic
##### Re: TIConvert
« Reply #44 on: July 18, 2011, 11:25:03 pm »
AFAIK, calccrypto doesn't have an account on omnimaga.


text:
# Murphy's law application for antigravitatory cats

Whoops! Maybe you were looking for Schrödinger's cat?
A cat stuck in a Anti-Gravity vortex known as a Gravitic Warp

## Axioms

• Murphy's Law / Finagle's corollary:
'If something can go wrong, it will'
therefore
'If you throw a slice of buttered toast into the air it will always fall with the buttered side down.'
• Cat's conservation law:
'A Cat will always land on its foots.'

## Demonstration

“Murphy was a pessimist”
~ Captain Obvious on Murphy's law
“Damn, why didn't I think of that?”
~ Oscar Wilde on Murphy's Law (or Wilde's Law)

So, what would happen if we stick a slice of toast with butter to a cat's back and we throw it to the air? The cat, by law, will land on its feet, but the toast, (by law too) will land on the butter's side. Against this problem of physics laws, the nature chooses the best (and laziest, I think) way of taking a solution: the cat may just not fall.

Advanced computer model depicting the physics of a cat-toast device.

The cat with the toast, once it's free in the air, will float at its cat-toast equilibrium point, where butter repulsion forces and cat forces are in balance. This point can be adjusted by removing some butter from the toast, adding it, or cutting some hairs (or legs) from the cat. In theory, this will cause the cat to remain stationary, however, in reality, due to varied nature of gravity and the non-uniform profile of Earth, the cat will simply spin around its center of gravity at ever-increasing speed.

In fact, most civilized species in the universe already use this principle in order to build their UFO's. Thus, the buzzing that you can hear when you see an UFO is actually the purr from the cats.

### Physics

The diagram at right shows that FBT is the force exerted by the butter so that it falls down, and FC are the forces the cat's feet exert so that it doesn't break its ass when falling. The following equation:

$\mathbf{F_{total}} = 3^k \sqrt{\mu\,\,(F_{BT}\cos\Theta\,\, - 4F_C\sin\Theta\,\,)}$

Such that Θ = π + 3μ√2 gives us that when:

$\lim_{k \to \infty}F(k) = 0$

The cat defies gravity.

### Propulsion

In order for the equilibriated cat to escape its inertia one must attach a propulsion device. The necessary item consists of cellotape (and if possible some object such as a bottle top); when the cellotape is attached to the cat's tail, the cat feels compelled to escape the anomaly caused by the disruption in tail dynamics. Thus the cat engages in accelerated motion in a direction diametric of the cellotape.

Theoretically if one attached, further, a piece of string to the tail disruptor one may have a suitable steering mechanism, however this theory has not been tested --- and some well positioned, suspended, tuna would probably suffice.

It has further been suggested that if one were to wrap the cat with rolls of insulated copper wire and rig the landing site with magnets, the cat and toast could become a rotating generator. Of course, these effects only last as long as the cat lives. Once the cat dies, the toast wins. The life of the cat could theoretically be extended by enclosing the landing site in a box containing a source of radiation, and closing said box once the cat is safely inside — thanks to the law of quantum possibilities, the cat is simultaneously both dead and alive. If the box is never opened, the quantum state of the cat being alive continues to cause the cat and toast to spin, thus generating electricity for all eternity.

And its formula:

$\int\mathrm{arsech}\,\frac{x}{c}\,dx = x\,\mathrm{arsech}\,\frac{x}{c} - c\,\mathrm{arctan}\,\frac{x\,\sqrt{\frac{c - x}{c + x}}}{x - c} \qquad\mbox{(for } x \in (0,\,c) \mbox{)}$

### Alternative Uses

A Diagramised Diagram of Theo's Perpetual motion Toast and cats theory.

A well known alternative use for the floating cat-toast combination is as the basis for a high speed hover train.

For the purposes of this explanation, the combination of 1 cat and 1 piece of buttered toast (as shown in the above drawing) will be referred to as a "floater".

While the cat-toast combination is floating in mid-air it can be utilised in the following ways:

A number of 'floater's' can be tied together to form a sort of floating raft. If a carpet (preferably of eastern design) is spread out over them, we have just made a so-called 'magic flying carpet'.

If more 'floater's' are used a larger mass such as a box-car can be placed on top forming one part of a hover train. A number of these can be linked together depending on the size of train required. The train will be able to travel at high speeds and there are no friction forces to overcome.

This property of rotating cats has also been utilised by addicts of kitten huffing to add a second hit to the huffing experience. By strapping buttered toast to the kittens they huff, the huffer begins to hover and rotate, this is known as hover-huffing and is only for the seriously serious huffer as it results in a truly disorienting experience. Do not attempt this with the orange ones.

## Oscar Wilde's Cat-Toast Device

Textbook diagram of antigravitory cat theory

The Cat-Toast Device is the never-ending source of energy that powers the Uncyclopedia (Also known as "The Buttered Cat Turbine").

The device is composed of two pure substances:

• Cats - small mammals that always land on their feet.
• Buttered Toast - tasty breakfast food that always lands butter-side down.

Oscar Wilde, always one to recognize the violation of laws of quantum mechanics, found a way to harness the limitless potential energy of the hovering cat-toast creation to power his Uncyclopedia. This discovery undermined any credit that Schroedinger's Cat Experiment had originally, which wasn't much to say the most.

All rumors about the Uncyclopedia being powered by a Stormtroopers vs. Red Shirts Device or a Wind farm are totally baseless. This, of course, makes them absolutely true.

The Cat-Toast Device will one day be used in the construction of the Shimizu Superfun Megacity Pyramid Challenge Session. It may also be used to create artificial gravity for space stations.

### History

In 1977 A.C., Oscar Wilde, frustrated in his attempts to get two bisexual women back to his place at the same time, hit upon the idea of tying a piece of buttered toast to the back of a cat and dropping it from the top of a Leaning Tower of Pisa to see which would prevail. The cat-toast hybrid fell at the constant acceleration of gravity until it stopped just above the ground, hovering. Both substances wanted to hit the ground first, canceling each other out. Wilde was thus the first person to discover the principle of 'percatual motion', a particularly powerful form of perpetual motion, the process of extracting limitless energy from household pets. Needless to say, the women came back to his place. Partially because he discovered such a principle, but mostly because he's freakin' Oscar Wilde

### Proposed inverse of device

Some quantum mechanics have suggested that an inverse of the Cat-Toast device would be possible. The inverse would consist of a piece of buttered toast glued butter-side-up to the stomach of a cat. The cat would attempt to land on its legs but the non-buttered side of the toast would prevent it. Likewise, the buttered side of the toast would want to land, but the cat's back would be unable to hit the ground. However, while this would seemingly have the same effect as a regular Cat-Toast device, it would actually have a quite different effect where the cat and toast would be crushed into singularity. This would occur because unlike a traditional Cat-Toast device where the cat and toast repel opposite each other, the inverse Cat-Toast device has the cat and toast repel towards each other. This squeezes the cat and toast into an infinitely small piece of matter, much like a black hole. The cat, however, would soon escape due to its nine lives (which are replenished during such quantum discrepancies) and the toast would get burned anyway from the massive amounts of heat released during the compression process.

### Other Documented Uses

There are over four different ways to configure this device by gluing different parts of the cat and toast together:

• If you glue the toast's buttered side to the cat's top, you'll create a device which will ram into the ground as hard and fast as possible. Many experimenters have lost their feet in this fashion.
• If you glue the toast's unbuttered side to the cat's feet, it will send the cat hundreds of feet into the air where it will turn around very quickly and land in the same fashion as the result explained above. This device cannot be stopped from turning, and thus is very handy to use for digging and deconstruction purposes if launched from a calculated starting point.
• If you glue the buttered side of the toast to the side of the cat, it will make it fall in a V-shape, thus splitting the earth and allowing for millions of demons to escape... "Here we go again!"
• If you glue the buttered side of the toast to the cat's feet, they'll fall inwards upon each other, thus creating a black hole which will eventually absorb and destroy the universe in its entirety.
• If you force a cat to swallow the toast whole it will turn inside-out so that the toast can hit the ground but then it will turn inside-out again so it's feet will hit the ground, etc.

There are many other different combinations you can do to these two products, so we at Uncyclopedia advise you to try some for yourself.

## Counter-theories

Some scientologists think that creating antigravitatory cats is impossible. They've tried to demonstrate it by doing the experiment by themselves, however the ability to successfully glue cats to toast remains a trade secret limited to most governmental agencies, mastermind evil-doers, and of course Oscar Wilde.

In order to attempt the experiment, you need:

Let's imagine you have the components ready. Now try to put the cat and the buttered toast together with the gluing dispositive. See what happens? Exactly! There is no cat!

When the gluing dispositive and the cat are in the same tetradimensional space of close proximity to buttered toast, the cat disappears. The comparison with Schrodinger's Cat is obvious, but unlike the infamous (un)dead cat, there has been no comprehensive explanation of why the disappearance takes place.

There are however several schools of thought that attempt to explain this phenomena, most however, don't explain why the cat is the one who disappears, and not the gluing agents.:

### First theory

It is known that a cat is largely built from particles called "Catilian-superquarks" (the resistance of which are measured in "meowhms"). These altered superquarks show both atomic (built of normal quarks) and feline qualities (built of charmed characteristics). Because the gluing dispositive is in no way made of quarks, when cat and glue are put together they cancel themselves out and the gluing agent remains behind to seek out better relationships.

### Second theory

Cats are pandimensional, superintelligent creatures. When in danger, they start to purr to open a travel portal to their original dimension. The reason why the cats stay in this dimension is because here they find enough food and people stupid enough to feed them.

### Third theory

The cat runs away, scratching the idiot who tried to put glue on it. (Most theorists dismiss this idea as pedantic.)

### Fourth theory

The cat and the toast spin themselves so fast that they create a black hole and people and objects are sucked into the swirling mix of the Catoastrophy. Thus far the event has always been localized to the experimenting scientologists.

### Fifth theory

Murphy's Law: If something can go wrong, it will. Therefore something will mess up this cat theory. After this, something will mess up Murphy's Law, then the cat theory has no basis and someone will discredit it and something will go wrong with the attempt at disproving it. Then the cat theory will not be proven incorrect, and relying on Murphy's Law, will prove Murphy's Law correct again. Therefore something will mess up this cat theory. After this, something will mess up Murphy's Law. Ad nauseam.

This causes an infinite cycle of the theory being viable and unviable and will mean that the cat will be beaten against the floor at frequency $\nu$, which is proportional to the highly reduced fat mass of the butter $\mu$. The cat is therefore beaten to death eventually, but if something can go wrong, it will. Therefore someone will mess up my cat theory, then Murphy's Law. It doesn't make sense! I'll go mad!

### Sixth theory

The butter drips off, or is replaced with Flora.

### Seventh theory

The cat and gluing dispositive will actually come together, but the cat spins so fast due to the invariance in the center of gravity that, following the law of time travel, it goes backward in time.

This has led to another theory stating that at the beginning of time there is an infinite number of antigravitatory cats, and therefore, causing the creation of the universe in the first place, due to the excessive gravitational forces produced by the infinite number of cats, they cause the big-bang.

However, some scientologists have pointed out that since the cat will continue going back in time, it will cease to exist due to the fact that once something goes before the start of time, it will no longer exist in this dimension, but will be warped to another dimension.

### Eighth Theory

The butter vanishes, and the cat lands on its feet. The toast, however, ends up slipping off the cat's back and landing on a taxi. Why a taxi, you ask? Because according to Murphy's Law, any object which detaches from some second object must land on a moving taxi. This has been the cause of great distress to people designing things such as multiple-stage rockets. Typically a number of taxis must be placed below said rocket's flight path to avoid a terrible fate in the nearest conurbation.

### Ninth Theory

The cat will asplode.

### Tenth Theory

Unfortunately, the tenth theory has been lost forever, as the experimenter used margarine instead of butter. Therefore, the test did nothing, and the cat turned out to be a grue which ate the scientist involved except for his head. As his head dropped to the ground, all he could say was "WTF PWNED, LOL!!!11one" and then his head asploded and was fed to his neighbour's dog.

### Eleventeenth Theory

The cat, the butter, and the applicant represent three sides of a triangle. When the mark is created, one must disappear- it is usually the cat. Investigations to find out where it goes have been fruitless. Note however, that strawberry preserves are a choice fruit for the applicant spread upon the remaining toast.

### M Theory

If one is to ascertain the outcome of this thought experiment, one needs a unified theory of cats and buttered toast. M-Theory, which was originally a theory of hardon physics, is such a unified theory. Unfortunately, M-Theory requires the cats to have 11 tails to work. M-Theory also requires that there be a specifically named dog for every cat and vice versa. E.g. if your cat is named Fluffy, then there is a dog named Fluffino. Although nobody has ever heard of dogs with such ridiculous names, M-Theorists think we will observe such dogs soon after the more powerful dog catcher accelerators are built. As for the 11-tails, well 10 of them are small and curled up or something... Oh, what happens with the cat and the toast? We can't get the theory to produce a stable vacuum cleaner solution yet. It's only a matter of time, give us more money.

### True Theory

The real reason this does not work is not because the glue is interacting with the cat but instead is reacting with the toast. You see, when the glue is applied to the toast it is ruined and therefore Murphy's law is no longer applicable. The toast then becomes subjected to the reversed Murphy's law (If something good can happen it will) causing the evil cat to disappear entirely. In accordance with Lorentz covariance, this also results in something bad that can't happen to occur somewhere in the universe, mad scientists are currently attempting to harness this power to create a powerful weapon.

### Stupidly Insane Theory

The cat and the toast come together, because cats like milk, which makes butter. Also, unknown to anyone outside Uncyclopedia, cats like to lick flour, then sneeze it on stupid people, who proceed to comment on how funny their little Tiddles looks with a white moustache and take photos, then post it on MySpace and Flickr. So, due to the attraction, the cat and the toast become one animal, so that is why the scientist couldn't find the toast. According to this theory, every single cat you see has a half-eaten mouse inside its body.

### The Actually Correct Theory

Cats are an unharnessable power of magnetic energy, and have been known to cause cats to powerfully repel, and in some case, fly away from objects that have a deep magnetical "aura". This is called catetism. Previously, scientists have been trying to deny the existence of the new energy, but the super-power created by it has changed their minds (along with the cats clawing them to death). Cats have long used this to power to power the super cat city, Hmhsfmjhsf. However, this is Uncyclopedian protected items, so it is very hush-hush. Things that have been known to be repelled by catetism include:

• Flea Medicines
• Glue
• Superglue
• Grues
• Stupid people like You
• Clowns
• Flowerpots
• Dogs
• Cheese
• Vets**

Many scientists have attempted to bring under control the strong force of catetism, which, by far is the most powerful force, trumping nuclear by tens of thousands of times, due to the uranium all being smuggled out in Homer Simpsons' pants.

However, as one young scientist pointed out, it is almost impossible to get samples of catetism, because people who try to get samples are being repelled by the force, which causes the cat to magically fly away. However, we decided to asplode that scientist, then feed his remains to a grue, because it ah...can be done. All that we need is a lot of money and you can pay us by ringing 1800-180-180. All values are accepted, but coins, especially ones that you have stolen from blind people playing the saxophone on the street, are preferred, as we don't have to claim tax on them.

Ninjas can use the awesome power of catetism to kill enemies in extremely goofy ways. Bruce Lee can harness this power, which he uses to propel the enemy into the wall just by putting out his hand.

  **Vets possess superhuman powers so that they can come into the vicinity of the cat without being propelled backwards into a wall.

## The Buttered-Cat Engine

The Buttered-Cat Engine is a well known theory of how to make energy. The energy is made by clean and safe materials, and has no known side effects.

### In Action

A buttered cat will, when released, quickly move to a height where the forces of cat-twisting and butter repulsion are in equilibrium. This equilibrium point can be modified by scraping off some of the butter, providing lift, or removing some of the cat's limbs, allowing descent.

Most of the civilized species of the Universe already use this principle to drive their ships while within a planetary system. The loud humming heard by most sighters of UFOs is, in fact, the purring of several hundred tabbies.

The one obvious danger is, of course, if the cats manage to eat the bread off their backs they will instantly plummet. Of course the cats will land on their feet, but this usually doesn't do them much good, since right after they make their graceful landing several tons of red-hot starship and ticked off aliens crash on top of them.

### Problems and Solutions

As with any other way of getting energy there is some problems with the buttered-cat engine.

• Hungry cat
• Problem: The first and biggest problem with the engine, is the cat can grow hungry, and that way lick the butter off the bread (See above).
• Solution: The best solution to this is to stop the engine and make the cat stop eating the butter. If it already has eaten a lot of the butter, it is recommended to add extra butter and before starting the engine again.
• Useless cat
• Problem: Another problem can be that the cat itself is handicapped, which can cause it not to land on its legs. And therefore it will land on its back and then the engine will stop again.
• Solution: This problem is really big, to fix the cat costs a lot of money. So it is recommended to get rid of the old cat, and buy a new one.
• Uncooperative/Angry cat
• Problem: The last problem is that, in attempting to attach the toast to the parts of the cat's body, the cat will scratch/bite you, or just get up and walk away. In rare cases, it may even summon grues from its personal dimension, because it knows you are trying to manipulate it for your amusement and not its own.
• Solution: The best way to calm the angry cat is to give it cat treats, and pretend like you're not doing anything. Sometimes this may not work, in which the only other option is to personally anaesthetize it- using whatever method necessary. But above all, do NOT give it catnip to appease it. This has shown to be highly reactive to the process, and cause the universe to Asplode.

### The Next Generation Power source (prototype)

Instead of the older and less efficient cat-toast device, there is now a more efficient and powerful solution to the anti-gravitatory generator problem (Yes , I am using big words to feel smart). The new , prototype high speed anti-gravity generator system , The cat turbine ! Instead of a buttered piece of toast attached to the back of a cat , the new prototype has multiple cats (2-?) , the only limit is to the size of the generator and the number of cats available. The system's biggest advantage is that there is far more power available, in the form of more cats. This could be the future power source for Uncyclopedia !

### A Further Scientific Development

Scientists at the University of Darmstadt have discovered that by strapping a slice of buttered toast onto the back of a cat, drilling a hole through a wall long enough for a pole with a handle, inserting end of pole way up into cat's rectum and turning the handle very fast, much the same results can be observed. PETA have been informed.

Following complaints from the public, attention has been drawn to this article, which is henceforth and with immediate effect designated to be "Ridiculous" as an interim measure, as defined under Section 4, Subsection iiiA, Regulations Pertaining to Silly Articles and will be defined as Silly as soon as the rubber stamp with "Silly" written on it is found. (ohhhh, drat...)

The theory promoted in this article, that a Buttered-Toast-Cat device (wherein the toast is buttered, not the cat) could be the foundation of a quantum engine that could produce <quote>unlimited energy<unquote> is in contradiction of Newton's Second Law pertaining to Entropy. The writers of this article have proposed that a putative Buttered-Toast-Cat engine may be considered to be a form of perpetual motion device. Such devices are impossible because they assume that an energy-producing system will not produce heat (entropy) which will then be lost to the universe.

The Ministry of Regulations Limiting Silly Devices has calculated that any aforementioned Buttered-Toast-Cat device will in fact require an energy input which will exceed any energy output (for example, if connected to a turbine). The Ministry advises that this entropy component of the device comprises but is not limited to-

1. Food for the cat(s): Since a quantum device producing energy does not by definition exist outside the dimension of Time, the cattish component of the device must also exist within time and thus the aforementioned moggy will require feeding, to maintain its consciousness and thus its must-land-on-feet capability. Energy input for each 1 kilojoule of energy produced by a putative turbine device is calculated to require 1.87 kilojoules of energy input in the form of tinned or fresh cat food (preferably salmon or tuna), crunchy kitty snacks, water or milk, the occasional mouse or small bird, and half a pound of cheese.
2. Cleaning out the cat crap: If the cat is given food, it will also shit. If the shit is not removed from the turbine, the device will - within a finite time - fill with kitty crap which will bring the spinning cat to a halt. As the cat will not have time to stop and have a crap, a 'cat nappy' or some other form of diaper must be fitted and changed regularly. A slipper may substitute as a crapping receptacle. The removal of crap is thus energy-requiring, and is calculated to absorb 0.33 kilojoules of energy per 1 kilojoule generated.
3. Grooming: As the cat will not have time to groom itself - being pre-occupied with landing on its feet - i.e. it must be regularly groomed. Energy consumption per 1 kilojoule of energy produced is estimated to be 0.47 kilojoule.
4. Purring and/or screeching: The cat will emit sound energy at regular intervals in the form of purring with contentment (at maintaining its equlibrium or after having just had a good shit) or screeching (if it suddenly becomes aware of its predicament). Energy loss due to sound is estimated to be 0.044 kilojoules.
5. Heat: As cats are homeothermic, they generate and disperse metabolic heat. This heat must be removed from the device if the cat is not be slowly baked. Indeed, the device will require an air-conditioning unit to provide the cat with an ambient air temperature suitable to maintain consciousness. The energy used for cooling is calculated to be 0.81 kilojoules.
6. Butter: Finally, the butter on the toast, revolving at high speed, will be lost through evaporation and centrifugation. The toast thus must be regularly re-buttered. Energy requirement (based on 18 kilojoules per pound of butter) is calculated to be 1.93 kilojoules.

A kilojoule of energy produced by a Buttered-Toast-Cat device will therefore require an input of, um, lots of external energy, negating the claimed efficiency of the device. The Ministry has issued a government health warning against the construction of such a device. It is proposed that such a device is classified as Silly.

An alterative quantum energy-producing "engine" has been under development by Professor Robert Goddard of the Ministry - with the assistance of a 4 squillion pound grant from the National Department of Energy Conservation. This is a torus-like device which will utilise a cat pursuing an almost-dead mouse (i.e. a mouse existing in a quantum not-really-dead-or-alive state - similar to that experienced by anyone in the morning after a hard night's drinking) whilst dragging a number of tin cans tied to its tail. This device has been classified Non-Silly or Serious. A press release to Uncyclopedia is expected within the near future, but in the interim the Ministry has provided the following advice: "Do Not Hold Your Breath Waiting."


text:
# Homework Help: Maximizing profit given cost and demand functions

1. Mar 25, 2012

### HHenderson90

1. The problem statement, all variables and given/known data

If
C(x) = 13000 + 600x − 0.6x62 + 0.004x3 is the cost function and
p(x) = 1800 − 6x is the demand function, find the production level that will maximize profit. (Hint: If the profit is maximized, then the marginal revenue equals the marginal cost.)

2. Relevant equations

R(x)=xp(x)

3. The attempt at a solution
Because of the hint, How I thought this question should be answered was to find the revenue function and take the derivative of that which is the marginal revenue and then set it equal to the derivative of the cost function which is marginal cost
So,
R(x)=x(1800-6x)
R(x)=1800x-6x^2
R'(x)=1800-12x

C'(x)=600-1.2x+.012x^2
1800-12x=600-1.2x+.012x^2
1200=10.8x+.012x^2
1200=.012x(900+x)
100,000=x(900+x)
100,000=900x+x^2

is this right? Where do I go from here, can I solve for x at this point? If so how?

2. Mar 26, 2012

### sunjin09

what mathematical function are you trying to maximize?


text:
## formulas related to gravitation

Gravity - Gravity - Experimental study of gravitation: The essence of Newton’s theory of gravitation is that the force between two bodies is proportional to the product of their masses and the inverse square of their separation and that the force depends on nothing else. Momentum is the product of mass and velocity of a body. This article set is a gravitation resource — a handy compilation of gravitational physics descriptions, methods and equations, with some related topics like inertia and centripetal force. m 1 = 5.98 x 10 24 kg, m 2 = 70 kg, r = 6.38 x 10 6 m, G = 6.6726 x 10-11 N-m 2 /kg 2. Index theorems: Manifolds without boundary 321 Appendices 7.1. The solution of the problem involves substituting known values of G (6.673 x 10-11 N m 2 /kg 2), m 1 (5.98 x 10 24 kg), m 2 (70 kg) and d (6.39 x 10 6 m) into the universal gravitation equation and solving for F grav.The solution is as follows: Two general conceptual comments can be made about the results of the two sample calculations above. Substitute the values in the below Gravitational Force formula: Linear Motion Formulas Average velocity/speed of a moving object can be calculated as v = s / t (1a) where v = velocity or speed (m/s, ft/s) s = linear distance traveled (m, ft) t = time (s) distance is the length of the path a body follows in moving from one point to another - displacement is the straight line distance between the initial and final positions of the body Force can defined as so… Answer: If the mass of one body is doubled, […] Here g' be the value of acceleration due to gravity at the depth d. Key Terms. CBSE class 11 Physics notes Chapter 8. Eg :- If a body is dropped from a certain height, it falls downwards due to earth’s The mathematical formula for gravitational force is $\text{F} = \text{G}\frac{\text{Mm}}{\text{r}^2}$ where $\text{G}$ is the gravitational constant. This pdf sheet consist of chapter-Gravitation of class 9 physics and updated with all important formula & concept with bullet points . Written by teachers for teachers and students, The Physics Classroom provides a wealth of resources that meets the varied needs of both students and teachers. Gravitation is the force of attraction between any two objects with mass or energy. What is Gravitation- Get depth knowledge of Newton's law of Gravitation with the help of Formulas, Books, Tips and Preparation plans prepare by experts . What will happen to the gravitational force between two bodies if the masses of one body is doubled? Variation of g with altitude:- g' = g (1- 2h/R), if h<


text:
# Pencil logic puzzles

Do you know Sudoku? Or maybe Paint by Numbers (also known as Nonogram)? Sudoku and Nonogram are examples of the many kinds of puzzles also known as "pencil logic puzzles" (for the lack of better terms).

Pencil logic puzzles are puzzles that usually have a grid (so you usually don't need to spare some space just to start solving), and which are typically intended to be filled with pencil or pen (and thus shouldn't be interactive). Moreover, as a logic puzzle, it should have a unique solution, reachable by (deductive) logic alone, and most often these puzzles are culture-neutral in the sense that you don't have to understand any particular culture (except possibly basic math) to solve the puzzles. This rules out things such as knights and knaves (for not having a grid and is also rather culture-heavy), logic grid puzzles (for being culture-heavy), puzzlehunt puzzles (for not being deductive), or puzzle video games (for not being doable with pencil).

So, what are examples of pencil logic puzzles? Sudoku and Nonogram are examples of them, but you might have seen examples such as Battleships, Slitherlink, or maybe recently Fillomino.

There are generally two major types of people indulging in such puzzles. The first one is publishers of these and casual consumers of such; if you've seen Sudoku books in stores, most likely they are made by these publishers. Puzzles in this kind are almost exclusively Sudoku (as the most popular sort), and mostly computer-generated. They sell pretty good, but they are usually of lower quality; after all, computers can generate plenty of puzzles, but can't determine whether they are aesthetically good and stuff.

The second one, which I belong in, is one that enjoys high-quality puzzles, those that are carefully hand-crafted. There aren't so many of us, but if you're looking, you can find a heck lot of them (with apologies to people that I can't think up their blogs fast enough). In fact, there is even a federation complete with its own puzzle and sudoku championships. (Naturally, they are about solving puzzles as fast as possible.)

Now, are you interested in exploring the world of high-class puzzles?

I have collected such puzzles I found in my set here. Feel free to comment here or notify me somehow if you want an inclusion. To be in this set, the puzzle must be a pencil logic puzzle, following the above rules. To be more succinct, puzzles in this set must be:

• Pencil (can be solved on paper, so not interactive; no Sokoban)
• Deductive (can be solved with deduction, no need of inductive logic; no puzzlehunt-style puzzles)
• Culture-neutral (can be solved without knowing any particular culture, except basic math; no crossword, no elimination grid, no knights and knaves)

Note by Ivan Koswara
4 years, 11 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
• Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

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

paragraph 1

paragraph 2

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

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

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

## Comments

Sort by:

Top Newest

Do you hear the Sudoku Wiki Page calling out for you? It feels so lonely right now.

Staff - 4 years, 11 months ago

Log in to reply

Surprisingly, I am less versed in Sudoku than in other puzzles (my favorite kinds of the type are Fillomino and Heteromino at the moment). Perhaps one of the reasons is that it is so saturated with so many tricks that normal Sudoku is mostly "look for the correct trick and apply it". If I have some ideas on what to write about Sudoku, I'll write it up.

- 4 years, 11 months ago

Log in to reply

Well Yeah! I have always solved many like Battleship, Slitherlink and Sudoku.

I didn't know that there is a federation! And man, Ulrich Voigt! He has won the Championship 7 times. God Knows what his Speed would be. I am Now Way too interested in Solving more of these! :D Thanks For Sharing, Mate!

- 4 years, 11 months ago

Log in to reply

Hi Ivan !

I have always been interested in those things in which we have to challenge ourselves . Just like Sudoku , Rubik's cube , the 15 puzzle , Brainvita , Tangram and related stuffs..

I just feel a surge of energy flow through me when I attempt such things .

How about you ?

- 4 years, 11 months ago

Log in to reply

I find a surge of energy flow through me when I'm doing some competitive puzzle solving, for obvious reasons. During casual solving I just find it pleasant, no rush or anything of the sort. (It also allows me to find and appreciate good puzzles.)

- 4 years, 11 months ago

Log in to reply

Yeah! Pumped up and already solved battleship, Sudoku, and rubik's cube

- 4 years, 11 months ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...


text:
### Artificial Neural Networks: Oscillations, Chaos, and

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 5.10 MB

PARAMETERS... dEdW_out = delta_out*input; dEdb_out = delta_out*1; %% IV. Statistics, is a field of mathematics that includes all the mathematical models, techniques and theorems that are being used in AI. It’s input will be the x- and y-values and the output the predicted class (0 or 1). If you have ever worked with graph type structures in code before, then setting up a simple network of these neurons is also relatively straight forward given the uniform structure of the network.

### Neural Network Systems Techniques and Applications, Fuzzy

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 11.07 MB

Nodes, also known as “neurons,” are arranged in multiple layers, including an input layer where the data is fed into the system; an output layer where the answer is given; and one or more hidden layers, which is where the learning takes place. Many of the other answers have covered the main points but you asked for a hierarchy if any exists and the way I see it, although they are each disciplines in their own right, there is hierarchy no one seems to have mentioned yet since each builds upon the previous one.

### The Complete Guide To Linux System Administration

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 6.25 MB

Probabilistic layer with binary and softmax methods. Mueller shows that with some work optimizing the SVM's parameters it's possible to get the performance up above 98.5 percent accuracy. In fact, a small change in the weights or bias of any single perceptron in the network can sometimes cause the output of that perceptron to completely flip, say from $0$ to $1$. This ability makes RNN very suitable to tasks such as natural handwriting recognition [5] in particular and biological recurrent processes in general.

### Criticality in Neural Systems (Annual Reviews of Nonlinear

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 14.16 MB

Abstract secondary agents with competing goals also adapt their strategies, learn a policy and the behavior of opponents. Several of these contains LaTeX fonts and this confuses postscript screen viewers such as Ghostview, to which the EPS figure appears to be missing its bounding box. Analyses of the musical events retained across variations provided support for the reductionist account of structural importance. Using these properties, representations are classified as non-generative, or generative.

### Extraction of Network Topology From Multi-Electrode

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 12.56 MB

Now AI, machine learning, and so-called neural networks seem to be everywhere. In this regime, SDNA in each step solves a proximal subproblem involving a random principal submatrix of the Hessian of the quadratic function; whence the name of the method. It even improved by one comparator a 25 years old result for the 13-input problem. Here Moreover, since the total variation distance is small, we can provably use $T \cdot X$ positive constant in error probability.

## Arthur W. Toga

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 5.65 MB

One way to reduce human involvement in this regard is to evolve how to build rather than what to build, by using prescriptive rather than descriptive representations. We describe a continuous optimization method which achieves an approximation ratio which asymptotically approaches 1-1/e. The Jetson TX1 (which has a performance of 1TFLOPs vs 1.2 TFLOPS for Tegra X1) achieved a top processing speed of 258 images/second with an efficiency of 45 img/sec/W, whereas the Core i7 achieved a peak performance of 242 img/sec with an efficiency of 3.9 img/sec/W.

## Kate A. Smith

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 6.36 MB

Hinton and Bengio’s work had empirically demonstrated that fact, but more importantly, showed the premise that deep neural nets could not be trained well to be false. In particular, we study the performance of a message propagation protocol called adaptive diffusion introduced in (Fanti et al., 2015). Can a new technique known as deep learning revolutionize artificial intelligence, as yesterday’s front-page article at the New York Times suggests?

### Advances in Self Organising Maps

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 8.53 MB

We wanted to use a reasonable number of machines to implement a powerful machine learning solution using a Neural Network approach. Without sufficient constraints on the architecture, it is too easy to pretend to explain cognitive phenomena by merely redescribing them in a story written in the vocabulary of prediction, comparison, error minimization, and optimized precison. These features alone can also cause oscillatory behavior and coevolutionary failure..

## Marc Thuillard

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 10.01 MB

Abstract We propose a novel multi-task learning method that can minimize the effect of negative transfer by allowing asymmetric transfer between the tasks based on task relatedness as well as the amount of individual task losses, which we refer to as Asymmetric Multi-task Learning (AMTL). They take an array of numbers (that can represent pixels, audio waveforms, or words), run a series of functions on that array, and output one or more numbers as outputs.

### E-Commerce and Intelligent Methods

Format: Paperback

Language: English

Format: PDF / Kindle / ePub

Size: 11.28 MB


text:
# Characteristic Function of 3D Gaussian with Boole

Context

Given the Probability Distribution

pdf=ProbabilityDistribution[(1/(8 π))675 Sqrt[5] *
(x1-x2) (x1-x3) (x2-x3)
Exp[1/2 (-x1 (6 x1-(3 x2)/2-(3 x3)/2)-x2 (-((3 x1)/2)+6 x2-(3 x3)/2)-
x3 (-((3 x1)/2)-(3 x2)/2+6 x3))],
{x1,-∞,∞},{x2,-∞,x1},{x3,-∞,x2}]

Note the Boundary on x2 and x3.

Question

I would like to compute the Characteristic Function of this PDF.

Attempt

 CF=CharacteristicFunction[pdf, {y1,y2,y3}]

takes forever.

I have tried rectifying the boundary as follows:

rs = Solve[{(x3 - x2)/2 == a, (x2 - x1)/2 == b, x3 == c}, {x1, x2, x3}][[1]];
pdf2 = Exp[I x1 y1 + I x2 y2 + I x3 y3 ] PDF[pdf,{x1,x2,x3}] /. rs // Simplify

(* (-675*Sqrt[5]ab*(a + b)* E^(-18*a^2 - 12*b^2 - (9*c^2)/2 + b*(6*c - (2*I)*y1) - 2*a*(9*b - 6*c + I*(y1 + y2)) + I * c*(y1 + y2 + y3)))/π *)

But this does not seem to converge either:

Integrate[pdf2 , {c, -∞, ∞}, {b, -∞,0}, {a, -∞, 0}]

runs forever.

I can integrate over 2 out of the 3 variables.

Integrate[pdf2 , {b, -∞, 0}, {c, -∞, ∞}]

but last integral also runs forever.

Any guidance would be welcome! :-)

Note: The purpose of knowing this Characteristic Function is to compute symbolically the matrix of scalar products involved in this question, but for 3D curvature.

• You could ask the genius integrators over at math.stackexchange.com Jan 21 '19 at 9:03
• Don't forget the factor of 4 coming from the Jacobian of your coordinate transformation. As pdf2 stands now, its integral is equal to $1/4$ instead of 1. You can find the Jacobian with D[{x1, x2, x3} /. rs, {{a, b, c}}] // Det // Abs. Jan 21 '19 at 9:08
• Thanks for your comments Jan 21 '19 at 17:55

## 1 Answer

Following the suggestion of this answer, the Characteristic function can be partially computed after the following change of variable on the PDF:

rs = Solve[{(x3 - x2)/2 == a, (x2 - x1)/2 == b, x3 == c}, {x1, x2, x3}][[1]]

as

Pdf2 = Exp[I x1 y1 + I x2 y2 + I x3 y3 ] Pdf1 /. rs // Simplify

(* -((675 Sqrt[5] a b (a+b) exp(-18 a^2-2 a (9 b-6 c+I (y1+y2))-12 b^2+b (6 c-2 I y1)-(9 c^2)/2+I c (y1+y2+y3)))/π) *)

Then the first two integrals can be done.

CF2 = 4 Integrate[Pdf2 , {b, -Infinity, 0}, {c, -Infinity, Infinity}]

The good news is that if you only want the moments (as it happens) they can still be computed exactly as follows

Clear[mom];
mom[p1_, p2_, p3_] :=
mom[p1, p2, p3] =
(1/I)^(p1 + p2 + p3) D[CF2, {y1, p1}, {y2, p2}, {y3, p3}] /.
Thread[{y1, y2, y3} -> 0] //
FullSimplify[#, Assumptions -> a < 0] & //
Integrate[#, {a, -Infinity, 0}] &

FYI they involve quantities such as

4/375 (283 Sqrt[10/π]-32 Sqrt[30 π])


text:
# Why is the empirical formula and chemical formula of "C"_12"H"_22"O"_11 the same?

Sep 15, 2017

Here's why that is the case.

#### Explanation:

The thing to remember about a compound's molecular formula is that you can determine it by multiplying its empirical formula by a whole number, let's say $n$.

color(blue)(ul(color(black)("molecular formula" = n xx "empirical formula")))" " " "color(darkorange)("(*)")

Moreover, you should know that a compound's empirical formula must show the smallest whole number ratio that exists between the elements that make up the compound.

In your case, you have ${\text{C"_12"H"_22"O}}_{11}$ as the empirical formula because the ratio that exists between carbon, $\text{C}$, hydrogen, $\text{H}$, and oxywen, $\text{O}$, is the smallest whole number ratio that can exist for this formula.

In other words, you can divide $12$, $22$, and $11$ by a whole number and still get whole numbers for all three elements.

Now, in order to see why this also represents the compound's molecular formula, you need to compare the molar mass of sucrose and the molar mass of the empirical formula.

M_ ("M sucrose") = "342.30 g mol"^(-1)

https://en.wikipedia.org/wiki/Sucrose

For the empirical formula, you have

overbrace(12 xx "12.011 g mol"^(-1))^(color(blue)("for carbon")) + overbrace(22 xx "1.008 g mol"^(-1))^(color(blue)("for hydrogen")) + overbrace(11 xx "16.0 g mol"^(-1))^(color(blue)("for oxygen"))

$\approx {\text{342.30 g mol}}^{- 1}$

Now use equation $\textcolor{\mathrm{da} r k \mathmr{and} a n \ge}{\text{(*)}}$ to find the value of $n$

overbrace("342.30 g mol"^(-1))^(color(blue)("the molar mass of sucrose")) = n xx overbrace("342.30 g mol"^(-1))^(color(blue)("the molar mass of the empirical formula"))

As you can see, you have

$n = 1$

which means that ${\text{C"_12"H"_22"O}}_{11}$ is both the empirical and the molecular formula.


text:
1-646-564-2231

# Addition and Subtraction Equations with Examples

## Key Concepts

• Write and solve an addition equation.
• Write and solve a subtraction equation.
• Solve problems using equations.

## Introduction:

Solving an equation:

You can solve an equation by using a bar diagram, a balance, or an equation.

You can also use inverse relationship and the properties of equality to solve equations.

### 4.3.1 Write and solve an addition equation

Example 1:

Joan had some markers. After she bought 12 more markers, she had 16. How many markers did Joan have at the start? Let n represent the number of markers Joan had at the start.

Solution:

One way:

You can find the value of n by getting it alone on one side of the equation.

Another way:

Draw a bar diagram to represent the situation.

n + 12 = 16

n + 12 = 16

n + 12 – 12 = 16 – 12

n = 4

To check, substitute 4 for n

n + 12 = 16

4 + 12 = 16

16 = 16

### 4.3.2 Write and solve a subtraction equation

Example 2:

Judy is 9 years younger than Grace. Judy is 12. Write and solve a subtraction equation to find Grace’s age, x

Solution:

Draw a bar diagram to represent the situation.

x – 9 = 12

x – 9 + 9 = 12 + 9

x = 21

Substitute 21 for y to check your work.

x – 9 = 12

21 – 9 = 12

21 = 12

### 4.3.3 Solve problems using equations

Example 3:

Louis read 14 fewer pages than he was assigned to read. He read 60 pages. Write and solve an equation to find how many pages, p, Louis was assigned to read.

Solution:

Draw a bar diagram to represent the situation.

One way:

Write and solve an addition equation.

p + 14 = 60

p + 14 – 14 = 60 – 14

p = 46

Another way:

Write and solve a subtraction equation.

p = 60 – 14

p = 46

Example 4:

A group of students were on a school bus. At the last stop, the bus picked up 16 students, and the bus arrived at school with 25 students. How many students were on the bus before the last stop?

Solution:

Draw a bar diagram to represent the situation.

One way:

Write and solve an addition equation.

n + 16 = 25

n + 16 – 16 = 25 – 16

n = 9

Another way:

Write and solve a subtraction equation.

n = 25 – 16

n = 9

# Exercise:

1. Solve the following equation.
g – 8 = 25
2. Solve the following equation.
25 + y =42
3. Explain how to get the variable alone from the following equation.
x + 13 = 25
x + 13 – 13 = 25 – ?
4. Explain how to get the variable alone from the following equation.
n – 30 = 10
x – 30 + 30 = 10 + ?
5. The Olympic triathlon is about 51 km. A contestant has completed two of the three legs of the race and has traveled 42 km. Solve 42 + d = 51 to find the distance of the third leg.
6. Jo loaned Al $15. She had$15 left. Solve the equation 15 = s – 15 to find how much money Jo had before she made the loan.
7. Explain how to solve the equation 35 + p = 92. Then solve.
8. Explain how you can use the inverse relationship of addition and subtraction to solve the equation n + 7 = 25.
9. You have some baseball trading cards. You give 21 baseball cards to a friend and have 9 left for yourself. How many baseball cards were in your original deck? Write and solve an equation to find t, the number of baseball cards in your original deck.

10. What operation should be used to solve the equation 153 = g + 45? Solve the equation.

### What have we learned:

• Write and solve an addition equation by using a bar diagram, a balance, or an equation.
• Write and solve a subtraction equation by using a bar diagram, a balance, or an equation.
• Solve problems using addition or subtraction equations.

## More Related TOPICS

### Use Models to Subtract Mixed Numbers

Key Concepts Using models to subtract mixed numbers Subtract mixed numbers Addition and subtraction of mixed

### Use Models to Add Mixed Numbers

Key Concepts Using models to add mixed numbers Adding mixed numbers Introduction  In this chapter, we

### Find Common Denominators

Key Concepts Equivalent fractions and common denominators Finding common denominators Introduction In this chapter, we will


text:
Mathematics

The value of $2\displaystyle \int \sin x \text{ cosec } 4x\ dx$ is equal to:

$\dfrac{1}{2\sqrt2}\ln \left|\dfrac{1+\sqrt2\sin x}{1-\sqrt2\sin x}\right|- \dfrac{1}{4}\ln \left|\dfrac{1+\sin x}{1-\sin x}\right|+c$

SOLUTION
$Q \displaystyle \int 2\sin x\, cosec\, 4 x dx$

$\displaystyle = \int \frac{2 \sin x}{\sin 4x}dx = \int\frac{2\sin x}{2\sin 2x\cos 2x}dx$

$\displaystyle = \int \frac{2 \sin x}{2 \sin x \cos x \cos 2x}dx$

$\displaystyle = \frac{1}{2} \int \frac{1}{\cos x \cos 2 x}dx = \frac{1}{2} \int \frac{\cos x}{(\cos^2 x)(1-2 \sin^2 x)}dx$

$\displaystyle = \frac{1}{2} \int \frac{\cos x}{(1-\sin^2 x)(1-2 \sin^2 x)}dx$

put $\sin x = t$
$\cos x\, dx = dt$
$\displaystyle = \frac{1}{2} \int\frac{1}{(1-t^2)(1-2t^2)}dt$

$\displaystyle = \frac{1}{2} \int \frac{2(1-t^2)-(1-2t^2)}{2(1-t^2)(1-2t^2)}dt$

$\displaystyle = \frac{1}{4} \int \frac{1}{(1-2t^2)}dt - \frac{1}{2} \int\frac{1}{(1-t^2)}dt$

$\displaystyle = \frac{1}{2} \frac{1}{2\sqrt {2}} ln \left| \frac{1+\sqrt{2}t}{1-\sqrt{2}t}\right| -\frac{1}{2}. \frac{1}{2} ln \left| \frac{1+t}{1-t}\right| +c$

$\displaystyle = \frac{1}{4 \sqrt{2}}ln \left| \frac{1+\sqrt{2}\sin x}{1- \sqrt{2}\sin x}\right| -\frac{1}{4} ln \left| \frac{1+\sin x}{1-\sin x}\right| +c$

Its FREE, you're just one step away

Single Correct Hard Published on 17th 09, 2020
Questions 203525
Subjects 9
Chapters 126
Enrolled Students 109

Realted Questions

Q1 Subjective Medium

Evaluate the following definite integral:

$\displaystyle\int_{-1}^{1}5x^{4}\sqrt{x^{5}+1}\ dx$

1 Verified Answer | Published on 17th 09, 2020

Q2 Subjective Medium
Evaluate the integrals as limit of sum $\int_{2}^{4}2^{x}\ dx$

1 Verified Answer | Published on 17th 09, 2020

Q3 Subjective Medium
Evaluate $\displaystyle\int_{0}^{1}\dfrac{\tan^{-1}x}{1+x^{2}} \ dx$

1 Verified Answer | Published on 17th 09, 2020

Q4 Subjective Medium
Evaluate the following integral:
$\displaystyle \int_{0}^{2}(x^2+x)dx$

Let $n \space\epsilon \space N$ & the A.M., G.M., H.M. & the root mean square of $n$ numbers $2n+1, 2n+2, ...,$ up to $n^{th}$ number are $A_{n}$, $G_{n}$, $H_{n}$ and $R_{n}$ respectively.