text:
# Tag Info

5

The attack is even more simple with RSA than with symmetric keys, because the asymmetric encryption key is assumed to be public. Let me tell you a story involving Alice, Bob and Mallory :). Alice wants to send a message to Bob using RSA. Alice encrypts the message using Bob's public key and sends it Mallory performs a Man-In-The-Middle attack, and ...

4

How did they jump from the spectrogram showing the RSA exponentiation timings straight to the secret bits? Actually, they're jumping to secret bits; however those aren't the secret bits you're thinking of. The bits displayed above are not the actual bits of $p$ and $q$. Instead, those are the bits from the secret exponent; because GnuPG uses CRT (and ...

2

Two scenarios: Alice sends a document to Bob that she has signed using her private key. Bob verifies the signature. Alice sends a document to Bob. Bob encrypts a random message for Alice's public key. Alice decrypts it and sends it back to Bob. Bob verifies it's the same. Both will only be possible if Alice has access to the private key, so you might ...

2

I'm assuming you mean a base 64 encoded key file, since removing the newlines from a binary file would obviously break things. The RSA standards (e.g. RFC 2459) only define a binary representation for keys. In practice, like OpenPGP keys (RFC 4880), they are often encoded in base 64 using the otherwise obsolete PEM standards (RFC 1421). The PEM printable ...

2

In practice, no. Firstly, RSA private keys are typically stored together with the public exponent. The standard definition includes the following information: RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, -- n publicExponent INTEGER, -- e privateExponent INTEGER, -- d prime1 INTEGER, -- p ...

2

Your javascript library linked to has no restrictions on key size. Many libraries out there that implement RSA will have a restriction on the key size. This is to make sure developers are following best practices as if the key size is too small, the security of the cipher is completely blown. It looks like the Java library you are using won't let you use key ...

1

Theoretically there is no requirement for the public key to be hard to guess given the private key. The public key is assumed to be known by all parties, including the adversary, so there is usually not much point in making it hard to guess. In fact, the question depends a lot on what you define as the private and public keys: For example it is not ...

1

We all know that in a public key cryptosystem, given a public key it is extremely hard to compute private key from it. Is it the same case in reverse? Not in general. For example, in Diffie-Hellman the public key is just a constant raised to a private number, modulo another constant. In some elliptic curve algorithms, the public key is a curve ...

1

No. An RSA signature is just a single number, encoded in a certain way. The number represents $x^d$, where $x$ is a padded hash of the document and $d$ the private exponent. If you know a public key $(m,e)$, you can calculate $x = (x^d)^e \mod m$, but without a document (or at least its hash) there is nothing to compare it with to verify anything. The only ...

1

References Related to your reference request: SHA512withRSA points to the RSA Signature Scheme with Appendix based on PKCS #1 v1.5 with SHA-512 hash function. This means you’re looking for reference documentation describing RSA PKCS1 v1.5 (see: RFC2313) signatures with SHA512 (see: RFC6234) hash and X.509 encoding format. Removing “overhead” from code As ...

1

You've got the vague idea about it, but you've mixed up some terms (you say Bob uses Amy's private key in your first paragraph when I think you meant to say public key; if Bob has Amy's private key it's all over for her). Also, if it was Bob sending Amy the message, Amy would be trying to verify it was truly Bob who sent her that message, not the other way ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
On Coding X: Computer Graphics II

Now that I’ve talked about what I use computer graphics for in my last installment of On Coding, I’d like to talk about the most useful graphics package I’ve come across for writing mathematics:  TikZ.

First a word about the name, TikZ.  It’s an example of a recursive acronym, like GOD used in Douglas Hofstadter’s Gödel, Escher, Bach, which stands for “GOD Over Djinn.”  (By the way, read Gödel, Escher, Bach if you haven’t already — it’s an amazing book about Gödel’s Incompleteness Theorem.)

So TikZ stands for “TikZ ist kein Zeichenprogramm,” which is German for “TikZ is not a drawing program.”  According to its creator, Till Tantau, this indicates that TikZ is not a way to draw pictures with your mouse or tablet, but is more like a computer graphics language.  It is designed for use in LaTeX, and is built with a lower-level language called PGF, which stands for “portable graphics format.”

So enough history — you can read more in the TikZ manual.  But a word of caution — it’s over 1000 pages long, so there’s a lot there!  I’ll only be able to scratch the surface today.

The two most important features of TikZ, in my opinion, are (1) you can draw very precise graphics because you’re writing in a high-level langauge, not using a WYSIWYG environment, and (2) you can use it in LaTeX, including putting any LaTeX symbols in your graphics.  This second point is extremely important, since it means when you’re labelling a diagram, the labels (usually involving mathematical symbols) look exactly the same way as the do in your text.

I use TikZ almost exclusively for two-dimensional mathematical graphics.  In a recent paper, for example, I created the following image.

Note how precisely all the elements are rendered — this is because you give precise coordinates for all the individual graphics elements.

Let’s take a look at another, somewhat simpler example from this paper.

I chose this example for a few reasons.  First, it requires using a lot of the basic TikZ commands.  Second, it illustrates the practical side of drawing computer graphics.  No, I’m not going to submit this image to a Bridges art exhibition any time soon — but if I need to make an image for a paper, I want it to look good.

So I thought I’d take some time to explain various aspects of the code which creates this image.  Maybe not the most glamorous graphic — but you’re welcome to look at the 1000+ page manual for hundreds of neat examples.  Here is a diagram for a finite-state automaton from page 179, for example.

Here’s what you’d need to type in LaTeX to get the simple graph I mentioned a moment ago.

Let’s look at several different excerpts from this example.  The first line opens your TikZ environment, and scales the image.  The default unit is 1 cm, so you need to set the scale to get your image the right size.

The next line is just a comment — I don’t use comments much for simple images.  But for more complex images, they’re important.  Just as important as commenting computer code.

The next line draws a set of axes.  What’s important here is that I defined my own “\axes” command — so you can include user-defined functions as well.  The advantages of being able to do this are huge.  You can use any command you define in LaTeX in a TikZ image.

Another great feature is the looping construct, “\foreach.”  The red segments above are one unit long, and so the only difference is the starting points.  Also important here is that you can use mathematical expressions inside TikZ, like the “{(\x^2+9)/6}” expression in the curly brackets.

Note the directives “[thick, red]” after the “draw” command.  You have control over every aspect of the drawing routines in TikZ — and there are lots of them.  For example, there is the “dashed” directive in line 10.  But not only can you draw a dashed line, but you can also specify the lengths of the dash marks and the spaces between them, too!  Further, you can create user-defined styles if you use the same set of directives over and over again.  This is helpful if you are creating several related images, and you want to tweak the color, for example.  You only have to change the color specification in the style, and every image which uses that style will be rendered using the new color.

Notice the “\filldraw” command in line 6.  I wanted open circles, so I drew the circles in red, and filled them with white.  If I wanted to, I could have also specified precisely how thick I wanted the circles to be drawn, but the default thickness looked just fine to me.

Notice the use of “node” and “\node” throughout.  In line 9, for example, the “3” is centered at coordinates (3, -0.5).  Also note the placement of nodes at the end of line segments, as shown in lines 7 and 8.  Again, it is significant that you can include any text you can create in LaTeX in your diagram.

I hope this is enough to give you the feel of using TikZ.  As I mentioned in the last installment, I also use TikZ to create slideshow presentations since there is so much you can do.  Remember, there are over 1000 pages of examples of things you can do in TikZ in the manual.

I would like to mention one caveat, however.  I do sometimes use Mathematica to create images with mathematically intensive equations and calculations.  TikZ is closer to a markup language in its usage, as I see it — so any image that requires significant coding to produce is a bit too cumbersome syntactically.  Here is an example of an image I used Mathematica to create.

But another nice TikZ feature is that you can import images into your environment — so I can draw complex images in Mathematica, include them in my TikZ picture, and then overlay LaTeX symbols on top of the image.  With this capability, the possibilities are quite literally endless.

A final comment:  TikZ and LaTeX are both open source, so if you’re interested, you can just download them and start experimenting!  The learning curve is a little steep, admittedly, but once you’ve climbed up, you’ll be able to create astonishingly beautiful graphical images for any purpose you have in mind.  Try it!

The One Four Conjecture

I can’t remember when I first heard of the “Four Fours” puzzle.  The goal is to use four 4’s to create as many different integers as possible using basic arithmetic operations.  For example,

$42=44-\dfrac4{\sqrt 4}.$

Which numbers are possible to obtain depends on the range of operations or functions allowed.  Using a decimal point and a bar for a repeating decimal, for example, allows expressions such as

$103=\dfrac{44}{.\overline 4}+4.$

A few years ago, I wondered about what numbers are possible using just one 4.  Of course there aren’t many if you restrict yourself to the basic arithmetic operations.  But you can write $4!= 24,$ for example.

So the factorial was a way to make numbers larger, but then what about bringing those factorials back down?  The square root function does that, but then you need to convert to an integer.  So perhaps use the floor function, so that the second function you use is

$f(n)=\lfloor\sqrt n\rfloor.$

Now this is a bit trickier — even small numbers are not so easy to obtain.  For example,

$5=\left\lfloor\sqrt{\left\lfloor\sqrt{\left\lfloor\sqrt{\left\lfloor\sqrt{\left\lfloor \sqrt{(4!)!}\right\rfloor}\right\rfloor}\right\rfloor}\right\rfloor}\right\rfloor.$

That’s a lot of work just to get 5….  But as I kept on exploring using Mathematica, it seemed that eventually, you could get every positive integer this way!

At first, it was really hard to believe — but the more I worked, the more plausible it became.  It soon became obvious that other numbers other than 4 were possible to begin with.  You could start with 9, for example, since then you could get 4 by

$4=\left\lfloor\sqrt{\left\lfloor\sqrt{\left\lfloor \sqrt{9!}\right\rfloor}\right\rfloor}\right\rfloor,$

and then proceed from there.

Further, why use a square root?  Could other roots work as well?  More experimentation seemed to suggest that any root might also work.  This led me to the following:

The One $n$ Conjecture:  Suppose $n>2$ and $p>1$ are given.  Then using the factorial function and the function

$f(n)=\lfloor n^{1/p}\rfloor,$

all positive integers may be obtained by some composition of these functions.

This seemed really difficult to prove.  Suppose, for example — using the factorial and square root functions — it is impossible to obtain some particular integer no matter what input you start with.  Of course it is always possible to obtain $n$ from $n^2,$ and $n^2$ from $n^4,$ and so on, but you’ve got to get larger first, and that requires some use of the factorial.

It turns out, however — in a particular sense (which you’ll see in a moment) — it is always possible, for any $p.$

The Possibility Lemma:  Suppose $p>1$ is given.  Then for any positive integer $k>1,$ there exist positive integers $q,m$ such that

$k=f(f(f\cdots f(m!)),$

where the function $f$ is composed $q$ times.

Let’s focus on the square root for now — that is, $p=2.$  The Possibility Lemma is only a starting point, since it turns out that most of the time, the smallest $m$ need to generate a particular $k$ is actually greater than $k$ — making an induction proof based on the Lemma impossible.

For example, for $k=42,$ the smallest $m$ is $218$ with $q=8,$ so that

$42=f(f(f(f(f(f(f(f(218!)))))))).$

But for $k=43,$ we get

$43=\left\lfloor\sqrt{\left\lfloor \sqrt{10!}\right\rfloor}\right\rfloor.$

It seemed that the least $m$ needed to generate a given $k$ exhibited rather erratic behavior.  So my next step was to plot a graph of the least $m$ given $k.$

I won’t go into all the details here — but it took a little work to optimize the algorithms.  As an example, the smallest $m$ needed to generate $k=48,\!500$ is $m=890,\!827,$ and computations with such large factorials take time.  It turns out that the trick was to compute in advance the first 1,000,000 factorials as floating point numbers.  A little accuracy is lost as result, but several checks suggested that even so, the correct value of $m$ is found each time.

So here is the plot of values for the least possible $m$ for $k$ from 1 to 5,000.

And here’s the plot for values of $k$ from 1 to 40,000.

Now here’s something interesting!  You can’t help but think “fractal behavior” here.  And why the thin bands?  Not sure yet, but they somehow correspond to square roots of factorials.  For example, the $m$ for 49,998 is 470,324, and the $m$ for 49,999 is 248,312, and the square root of 470,324! is not too far off from 248,312!.

But although it looks like there are thin bands, they are not uniformly generated.  Here’s a closeup of the previous graph in the range 49,900 to 50,000.

There doesn’t seem to be a predictable pattern as to when the jumps are made.

And it does appear that the thin bands have an upward trend.  Might it be possible that every positive integer is eventually the $m$ for some $k$?  Not an easy question to answer.

And this is only a beginning!  I just generated the graph up to 50,000 yesterday, so I haven’t had time to analyze it in any more detail.  Using $p=3$ generates the following graph, so it seems that there may be similar behavior for various $p.$

I plan to keep working on this little puzzle — although I think a proof of or counterexample to the One $n$ Conjecture is rather far off.  When I do make more progress, I’ll give you an update.  Despite the difficulty of the problem, this is a really fun puzzle to play with!  I hope you might give it a try, too….

Guest Blogger: Percival Q. Plumtwiddle, II

As promised, here is the second installment of my friend Percy’s essay on the significance of our Earthly existence being three-dimensional.  I hope these few words give food for much geometrical thought….

On Threeness (continued…)

Popping over a few dimensions in the meanwhile, the knowledgeable geometer is certainly aware that in dimension four and, indeed, in all dimensions exceeding this critical dimension, the situation is somewhat overwhelming, to say the least. So many thousands of uniform polyhedra abound that the prospect of their enumeration appears beyond the scope of even the most ambitious geometer. (I might recommend such a project, however, to an advanced practitioner of one of the Eastern religions who might, as a result of sufficient spiritual development, continue the undertaking in subsequent reincarnations.)

But in dimension three, how manageable our delight!  Seventy-odd uniform polyhedra clog the pores, multitudinous compounds and stellations frolic with the celestial spheres, etc.,  such as to render the average mortal awestruck.  Details are, of course, voluminous (though within reason), and more eminent geometers than yours truly have authored copious memoranda on said frolicking.  And there is yet much left unsaid, or perhaps, unmemorandized.  To presume that our friendly Supreme B. was unaware of such phantasmagoria would be heresy first class.  Fie!, I say, to such presumption!

As convincing as I have striven to be, I shall endeavor, with difficulty, not to be so narcissistic as to suppose that I have left no room for doubt in the reader’s mind. And so I entice with a few non-Euclidean morsels…

I shall not doubt the reader’s familiarity with the method for calculating the length of a circular arc, given the appropriate parameters. Perhaps less well-known is the method for calculating the area of a spherical triangle, with the attendant formulae relating the various parts of such a triangle only slightly more obscure. I purposefully omit their statements, secretly hoping that the reader will rediscover their simplicity and elegance afresh… In any case, the knowledgeable reader is well acquainted with the vast number of beautiful yet stable geodesic structures which may be constructed, the data for which constructions being directly calculated by way of the aforementioned simple formulae. Let not the skeptical reader be amused by such hyperbole — for one who has indeed fabricated such a structure or two with a few sheets of stiff paper and a bit of rubber cement will certainly view my descriptions as grave understatement.

In any event, as the informed reader is well aware, the formula for finding the area of the spherical triangles mentioned above may be successfully implemented by a child of ten, or perhaps a precocious child of eight, with a minimum of instruction, a pocket calculator, and, if necessary, the promise of an ice cream in the event of their successful completion. The informed reader is equally well aware that analogous calculations in four dimensions may be successfully implemented by no less that a ranking member of the cranially elite given the necessary data (and perhaps a few extraneous ones for good luck), a personal computer, and, if necessary, the promise of tenure in the event of their successful calculation. The superiority of the three-dimensional scenario, both fiscally and otherwise, is evident.

And so, dear reader, I take my leave. It is my fondest hope that these few words have, at the very least, given cause for a leisurely intellectual frolic amidst sunny geometrical meadows, and at the very best, profoundly elevated the spirit. In either case, my work will not have been in vain.

Guest Blogger: Percival Q. Plumtwiddle, I

As I’m out of town for a few weeks, I thought I’d invite my good friend Percy Plumtwiddle to be a guest blogger.  He is an ardent enthusiast of geometry, and we have had many animated discussions on the geometry of three and higher dimensions.

But he has his stubborn side (don’t we all?).  And yes, his language is flowery and over the top, but well, we all have our eccentricities, too.  Nonetheless, he makes some interesting points — just how interesting, I’ll have to let you decide.

Also, his essay, while not too long, is a bit long for just one post — so I’ll break it into two installments.  I’ll return to my keyboard in a few weeks.  In the meantime, enjoy Percy’s unique perspective on geometry, and more broadly, life in general….

On Threeness

Were I God — and I assure you, dear reader, that such is not remotely an aspiration; and were it, even my dear friends and those who hold me in highest esteem (those that there may be) would chortle audibly at the consideration of such a prospect — and were it incumbent upon me to create a sentient being or two (admittedly, I would be somewhat embarrassed, were I God, to admit to the creation of many such beings which presently spoil an otherwise hospitable planet) — and had I the necessity of establishing a place of residence for the aforementioned sentient beings (not that it would be required, matter being at times inconvenient, especially when taking the form of a piece of chocolate cake hidden under one’s outer garments at the precise moment when a head-on collision with a rotund nephew is imminent) — I would not hesitate for a moment in making such a domicile, in dimension, three.

Lest the frivolous reader imagine such a dimensionality to be merely the whim of a somewhat eccentric, although omniscient, Supreme Being, or lest the pious reader imagine that such a dimensionality foreshadows the fairly recent (according to even the most conservative of cosmological estimates) doctrine of the Trinity popular in some Western religions, and lest the banal reader imagine that this third dimesion would be, as goes the cliche, a “charm,” and lest the reader of belles lettres be tempted to make a thoroughly trite reference to MacBeth — apply the cerebral brakes forthwith!  I intend to provide sound reason to dispel such imaginations, should the reader find it bearable to forage among slightly less green pastures.

I appeal not only to the reader’s intellect — being, unfortunately, acquainted much more intimately with self-proclaimed members of the cranially elite than I presently desire — but also to the reader’s aesthetic sensibilities, as potentially volatile as such an appeal may be.  But I have profound faith in this universal Threeness, so I proceed, fully cognizant of the perilous quagmire in which I may soon find myself immersed, should the fates allow.

Indeed, my argument is entirely geometrical, being of the school of thought that such argumentation is lacking in no essentials.  Should the reader be otherwise disposed, I urge an immediate cessation of the perusal of this document, the administration of a soothing tonic, and perhaps the leisurely reading of a light novella.

Several remarks of the Euclidean persuasion present themselves.  Oh, indeed, we are all familiar with the usual formulae for distance, angle, etc., etc.  These pose little difficulty, even in thirty-seven dimensions, once we are introduced to our good friend the Greek capital sigma.

But let us turn our eyes to the imaginitive world of polyhedra, a subject quite dear to my heart.  Another discussion entirely!  It is within this discussion that the force of my words comes to bear.  For indeed, I should be greatly surprised if when, upon strolling through the Pearly Gates and bidding good-day to St. Pete, I find that God did not have amongst his cabinet (a gaggle of geese, perhaps, but the precise nomenclature for an approbriation of Archangels momentarily eludes me) one for whom polyhedra are a consuming passion.

And what would give cause for raised eyebrows?  Follow along.  Examining your regular polyhedra of dimension two, we find squares, triangles, etc., etc., and, while these are no doubt pleasing to the eye, one might find oneself a trifle bored after pondering a polygon of forty-six sides.  For next comes the all-too-exciting forty-seven sider, and while one might appear to the casual observer nonplussed, the more astute attendant of human psychology would undoubtedly sense a consuming ennui.  Hardly worthy of God, or even a lesser member of his cabinet.  Of course, one may counter that I have neglected the likes of five-pointed stars, nineteen-pointed stars, and eighty-five-pointed stars, and one would be correct.  But these, too, soon become tiresome.

This ends the first installment of Percy Plumtwiddle’s essay, On Threeness.  Be sure to catch the second (and final) installment next week!

More on: What is…Inversive Geometry?

The more I thought about it, the more I realized I just couldn’t stop at just one post on inversive geometry.  There is so much interesting geometry to discuss….

This image of a cardioid, made up of a collection of tangent circles, is one of my favorite geometrical constructions.  It’s created by beginning with a base circle (in black).  Choose any point on the circle (like the one in black), which we take to be the origin.

Now for any other point on the black circle (like the point in red), draw a circle with that point as center, and the radius as the distance from the origin, as in the figure.  If you do this several times, the circles you draw will envelope a cardioid.

Why do you get a cardioid?  It’s actually not too difficult to prove using inversive geometry.  We won’t go through all the details, but you’ll see enough to get the gist of the proof.

So let’s go!  There’s actually a lot going on once you’ve added the point at infinity, ω.  If you’ve forgotten about ω, you might want to look at Day091 to refresh your memory.  One property of ω which will be important to our discussion today is that ω lies on any curve which is unbounded.  And the simplest unbounded curve is just a line.

So imagine a line, and some point P on that line.  Now chose a direction long the line, and think about moving along the line in that direction.  What happens?

Well, eventually, you’ll start moving further and further away from the origin.  And as you keep moving further from the origin, you’re actually moving “closer” to the point at infinity.  Not closer in a numerical sense of the distance from ω, since you are always infinitely far away from ω.  But closer in the sense that the line “ends” at the point at infinity.  If ω lies on the line, you’ll need to able to get there — even it takes forever….

Yeah, a bit to wrap your head around.  But it gets even better!  Think back to where you started — the point P — and then move along the other direction along the line.  Keep going…as you approach the point at infinity from the other side of the line.

Do you see what’s happening?  Both ends of the line actually meet at ω!  Yes, the line is a closed curve in inversive geometry, like a circle is in Euclidean geometry.

We’ll come back to this point in a moment, but next we want to ask the following question:  what is the inverse curve of a line?  Recall that the inverse curve of a line is that curve obtained by taking all the individual points on a line, and then taking all of their inverse points.

Interestingly, the inverse curve turns out to be a circle — and not just any circle, but a circle which goes through the origin.  As the proof isn’t all that difficult, we’ll take a few moments to work through it.

So suppose the red circle centered at O has radius 1, and choose a point P.  Now draw the line through P such that the segment OP is perpendicular to the line, and consider another point Q on this line.  Thus, triangle OPQ has a right angle at P.

Since the point at infinity, ω, is on the line, its inverse point, ω′ = O, must lie on the inverse curve.  Thus, the inverse curve (shown in blue) must pass through the origin. Of course P and Q′, the inverse points of P and Q, must also lie on the inverse curve.

Then by the property of inverse points, $[OP]\cdot[OP']=[OQ]\cdot[OQ']=1,$ and so

$\dfrac{[OP]}{[OQ]}=\dfrac{[OQ']}{[OP']}.$

But because inverse points lie on the same ray through the origin, then $\angle POQ$ and $\angle Q'OP'$ must have the same measure, making triangles $\Delta POQ$ and $\Delta Q'OP'$ similar triangles.

What does this mean?  This implies that $\angle OQ'P'$ is also a right angle.  To summarize:  given any point Q on the line, its inverse point Q′  has the property that when joined to O and P′, a right triangle is formed with a right angle at Q′.

But because any triangle inscribed in a semicircle is a right triangle, this means that the set of all inverse points Q forms a circle with diameter OP′.  Neat!

Thinking back to ω being on the line, we see that as we begin at P and move either direction along the line toward the point at infinity, here’s what we’re doing on the inverse curve:  we’re starting at the point P′ and moving either direction around the circle toward the origin.  It really does make sound geometrical sense.

Will this work for any line?  If you think about it for a moment, you’ll find that it does…almost.  Our geometrical argument fails if the line actually goes through the origin.  But it shouldn’t be difficult to convince yourself that the inverse curve of a line going through the origin is actually the same line!  The two points where the line intersects the circle of inversion stay in the same place, but the other points switch in pairs.

Where are we going with all this?  It turns out that adding the point at infinity does, in some sense, make lines behave like circles — we can even imagine a line as a “circle with infinite radius.” And where is the center of this circle of infinite radius?  The point at infinity, of course….

As mentioned last week, the inverse curves of circles not passing through the origin are also circles not passing through the origin.  To summarize:

• Inverses of circles not passing through the origin are also circles not passing through the origin;
• Inverses of circles passing through the origin are lines not going through the origin (and vice versa);
• Inverses of lines through the origin are also lines through the origin, and each such line is its own inverse.

Now here’s the next step.  Given the close relationship between lines and circles in inversive geometry, we define a Circle in inversive geometry (capital “C”, like we did in spherical geometry) to be either a line or circle.  Then here’s the revised summary:

• Inverses of Circles are Circles.

Beautifully simple.  The ability to make simple statements like this with real geometrical meaning is one more reason why inversive geometry it so very interesting.

And with that, we’ll have to call it a week….  In the next (and final) post on inversive geometry, we’ll briefly look at the algebra of inverse curves, and finish the cardioid construction mentioned above.  Until then!

Mathematics and Digital Art: Final Update

It’s hard to believe yet another academic year is over!  I do think this second semester of Mathematics and Digital Art went a little more smoothly than the first.  This shouldn’t be too surprising, though — the first time implementing any new course is a little bumpy.  Though I must admit, there were surprisingly few bumps the first time around….

Like last semester, I had students create a movie in Processing.  The main tool I had them use was linear interpolation to create animation effects.  As before, I encouraged them to use linear interpolation with any numerical parameter in their movie — how much red there is in the background color, the position of objects on the screen, or the width of points and lines, just to name a few possibilities.

Colette created some interesting visual effects.  Some students (like her) took advantage of the fact that if you don’t set the background color in the draw function in Processing, successive calls to the draw function overlap the previous ones, giving a sense of movement.

Peyton was inspired when her friends invited her to go to the beach.  Here is a screen shot of her movie, where the moon reflects off the rippling waves of the sea at Ocean Beach in San Francisco.

Next, I’d like to share a few pieces from students’ Final Projects.  Recall that Final Projects are an important part of the course — during the second half of the semester, we spend one or two days a week working on them.  This is the opportunity for students to explore any aspect of the course in more detail.

While Lainey focused on making images which reminded her of her dreams, she began with this collage including  several motifs from our coursework throughout the semester.  She was one of the few to incorporate L-systems into her Final Project.

Karina, as many students did, experimented with image processing.  She wanted to overlay multiple images at various transparencies to create a kaleidoscopic effect.  Rotating the images required that she brush up on her trigonometry….

Karla was interested in experimenting with color.  She was interested in morphing images of the Buddha.  Karla used the RGB values of the pixels in an original image, like the one shown below on the left, to determine the RGB values of the pointillistic image shown on the right.

Also like last semester, I asked students to write a final response paper about their experience with the digital course.  The responses were similar to those of last semester, so I’ll only include a few excerpts here.

I think differently about mathematics in how it relates to art. I always thought that the two would be separate entities, but this class has proved that’s not always the case.

After having taken this course this semester I really have gained an interest in art and programming that I certainly didn’t have before, even after having taken some courses in programming. I think that actually being able to see the endless things that are able to be created using programming and math is really cool….

One student made a particularly interesting remark:

I wish that I had more knowledge on how to type my own code. There were points in the semester where the art I was creating felt a bit like a coloring page where we were given a page that was already drawn and told to fill it in and try to make it our own.

Of course this is what I want to read!  I do want to inspire students to investigate programming further — but students taking this course receive a mathematics credit.  There is certainly no doubt in your mind about how passionate I am about having students learn to write code, but I do need to emphasize the mathematics of digital art.  Maybe next semester I’ll have Nick run some extra sessions on coding for those who are interested in learning more.

I also wanted to share some work from the other course I taught this semester, Linear Algebra and Probability.  I have students work with affine transformations and iterated function systems in this course as well.  Their first project is a still image using Sage, and their second project is a fractal animation using Processing.  Here is Jay’s submission.

And finally, I want to remind you that Mathematics and Digital Art is becoming a university-wide course next year.  I am working with the Fine Arts department here at USF to encourage incoming fine arts majors to earn their mathematics credit by creating digital art!  I expect the course to be quite a bit larger this Fall, and will be connecting with the Fine Arts faculty to make sure the content meets their needs as well.

In addition, I will be giving a talk at Bridges this summer (in Waterloo, (the Canadian one, that is)) about my digital art course.  I’m expecting that I’ll receive a wide range of comments and suggestions, so the course may be a little different in the fall.  That’s one nice feature of this course — it’s not a prerequisite for any other course, so there is some flexibility as far as content is concerned.

Like this semester, I’ll provide monthly updates to let you know what changes I’ve implemented, and also to showcase student work.  So stay tuned!

On Cheese: Reprise

I haven’t repeated a post yet — but as I’m getting ready for Final Exams, I thought it appropriate.  I posted this satire over a year ago, but of course it is still relevant.  The traditional system of assigning grades as a measure of, well, anything, is woefully inadequate.  Continue reading at your own peril….

On Cheese

A new semester is about to start! Finally, those students we have worked so hard to prepare are ready to learn The Calculus!  (Note: We do not teach The Calculus, but rather facilitate its learning.)

With class Roster in hand, we make for the Cheesemonger. (Mr. Hadley has been here for decades.) “Mr. Hadley, twenty-one, if you please,” I say, handing him my Roster. That is all there is to it. The next morning, twenty-one perfectly crafted cubes of Preferred Cheese (each having a mass of precisely 100g) are in my class Cupboard — one for each student, clearly labelled. We are ready!

Of course the students’ initial enthusiasm is high, until the inevitable First Exam. Surely much of the material is review — so we use the Petite grater to shave off a small bit of cheese from a student’s Block when they make the inevitable First Mistake. (There is always the exception, naturally — the Micro is used for sign errors, as well as trivial arithmetic errors.) This is done to accurately track students’ progress.

As the semester progresses, the situation becomes more dire. More egregious errors require the use of a Usual grater, while blocks of students who neglect to turn in entire assignments surely warrant being shaved by an Ultra. After years of experience, we are able to gauge precisely how much cheese must be shaved for each particular type of error. (Truly, it is all in the wrist.)

The end draws near — and although well-acquainted with the system, students still worry about the mass of their Block. They must realize that what is done is done — and No!, it is not possible to replenish the cheese! Is there no justice? They have been warned aplenty, but it is not our fault they do not heed our omens.

We are particularly meticulous with the shaving of the Final Exam — as it is an important assessment. Certain errors now warrant more grievous penalties — the Micro is no longer relevant. Beware the sign error!

But the wonders of being Complete! As a result of our experience (and training, naturally — Mr. Hadley is quite the Cheesemonger), the mass of each student’s Block represents their understanding of The Calculus entirely! Moreover, this mass may be converted to any number of convenient units — a percentage, perhaps, or one of various letters meant to convey a State of Understanding. But the work of the Facilitator is done! We rest well, and enjoy our cuppa. (Yes, some decry the fairness of such a system. No matter. Surely it is the best possible.)

format: plain


text:
• Electromagnetics I
• Ch 3
• Loc 3.19

# Quarter-Wavelength Transmission Line

Quarter-wavelength sections of transmission line play an important role in many systems at radio and optical frequencies. The remarkable properties of open- and short-circuited quarter-wave line are presented in Section 3.16 and should be reviewed before reading further. In this section, we perform a more general analysis, considering not just open- and short-circuit terminations but any terminating impedance, and then we address some applications.

The general expression for the input impedance of a lossless transmission line is (Section 3.15):

Note that when

:

Subsequently:

Recall that (Section 3.15):

Substituting this expression and then multiplying numerator and denominator by

, one obtains

Thus,

Note that the input impedance is inversely proportional to the load impedance. For this reason, a transmission line of length

quarter-wave inverter or simply as a impedance inverter.

Quarter-wave lines play a very important role in RF engineering. As impedance inverters, they have the useful attribute of transforming small impedances into large impedances, and vice-versa – we’ll come back to this idea later in this section. First, let’s consider how quarter-wave lines are used for impedance matching. Look what happens when we solve Equation 3.19.5 for

:

This equation indicates that we may match the load

to a source impedance (represented by

) simply by making the characteristic impedance equal to the value given by the above expression and setting the length to

. The scheme is shown in Figure 3.19.1.

### Exercise

300-to-50Ω match using an quarter-wave section of line.

Design a transmission line segment that matches

to

at 10 GHz using a quarter-wave match. Assume microstrip line for which propagation occurs with wavelength 60% that of free space.

Solution

The line is completely specified given its characteristic impedance

and length

. The length should be one-quarter wavelength with respect to the signal propagating in the line. The free-space wavelength

at 10 GHz is

cm. Therefore, the wavelength of the signal in the line is

cm, and the length of the line should be

mm.

The characteristic impedance is given by Equation 3.19.6:

This value would be used to determine the width of the microstrip line, as discussed in Section 3.11.

It should be noted that for this scheme to yield a real-valued characteristic impedance, the product of the source and load impedances must be a real-valued number. In particular, this method is not suitable if

has a significant imaginary-valued component and matching to a real-valued source impedance is desired. One possible workaround in this case is the two-stage strategy shown in Figure 3.19.2. In this scheme, the load impedance is first transformed to a real-valued impedance using a length

of transmission line. This is accomplished using Equation 3.19.1 (quite simple using a numerical search) or using the Smith chart (see “Additional Reading” at the end of this section). The characteristic impedance

of this transmission line is not critical and can be selected for convenience. Normally, the smallest value of

is desired. This value will always be less than

since

is periodic in

with period

; i.e., there are two changes in the sign of the imaginary component of

as

is increased from zero to

. After eliminating the imaginary component of

in this manner, the real component of the resulting impedance may then be transformed using the quarter-wave matching technique described earlier in this section.

### Exercise

Matching a patch antenna to 50Ω.

A particular patch antenna exhibits a source impedance of

. (See “Microstrip antenna” in “Additional Reading” at the end of this section for some optional reading on patch antennas.) Interface this antenna to

using the technique described above. For the section of transmission line adjacent to the patch antenna, use characteristic impedance

. Determine the lengths

and

of the two segments of transmission line, and the characteristic impedance of the second (quarter-wave) segment.

Solution:

The length of the first section of the transmission line (adjacent to the antenna) is determined using Equation 3.19.1:

where

is the phase propagation constant for this section of transmission line and

We seek the value of smallest positive value of

for which the imaginary part of

is zero. This can determined using a Smith chart (see “Additional Reading” at the end of this section) or simply by a few iterations of trial-and-error. Either way we find

which we deem to be close enough to be acceptable. Note that

, where

is the wavelength of the signal in the transmission line. Therefore

The length of the second section of the transmission line, being a quarter-wavelength transformer, should be

. Using Equation 3.19.6, the characteristic impedance

of this section of line should be

Discussion:

The total length of the matching structure is

. A patch antenna would typically have sides of length about

, so the matching structure is nearly as big as the antenna itself. At frequencies where patch antennas are commonly used, and especially at frequencies in the UHF (300–3000 MHz) band, patch antennas are often comparable to the size of the system, so it is not attractive to have the matching structure also require a similar amount of space. Thus, we would be motivated to find a smaller matching structure.

Although quarter-wave matching techniques are generally effective and commonly used, they have one important contraindication, noted above – They often result in structures that are large. That is, any structure which employs a quarter-wave match will be at least

long, and

is typically large compared to the associated electronics. Other transmission line matching techniques – and in particular, single stub matching (Section 3.23) – typically result in structures which are significantly smaller.

The impedance inversion property of quarter-wavelength lines has applications beyond impedance matching. The following example demonstrates one such application:

### Exercise

RF/DC decoupling in transistor amplifiers.

Transistor amplifiers for RF applications often receive DC current at the same terminal which delivers the amplified RF signal, as shown in Figure 3.19.3. The power supply typically has a low output impedance. If the power supply is directly connected to the transistor, then the RF will flow predominantly in the direction of the power supply as opposed to following the desired path, which exhibits a higher impedance. This can be addressed using an inductor in series with the power supply output. This works because the inductor exhibits low impedance at DC and high impedance at RF. Unfortunately, discrete inductors are often not practical at high RF frequencies. This is because practical inductors also exhibit parallel capacitance, which tends to decrease impedance.

Solution:

A solution is to replace the inductor with a transmission line having length

as shown in Figure 3.19.4. A wavelength at DC is infinite, so the transmission line is essentially transparent to the power supply. At radio frequencies, the line transforms the low impedance of the power supply to an impedance that is very large relative to the impedance of the desired RF path. Furthermore, transmission lines on printed circuit boards are much cheaper than discrete inductors (and are always in stock!).

## Additional Reading

Ellingson, Steven W. (2018) Electromagnetics, Vol. 1. Blacksburg, VA: VT Publishing. https://doi.org/10.21061/electromagnetics-vol-1 CC BY-SA 4.0

Swipe left and right to change pages.

Get the latest tools and tutorials, fresh from the toaster.


text:
# Location where gravitational force from Moon is 1/3 of that from Earth?

1 vote
21 views

Determine the location where an object with mass m0 when placed between the moon and earth experiences a gravitational force from the moon equal to a third of the gravitational force from earth. The distance from the earth to moon is 384,400 km. The ratio of mases between moon and earth is 0.0123. The radii of moon and earth are 1738.1 km and 6378.1 km, respectively.

edited Mar 6
Have you attempted to solve this problem? What difficulty are you having with it?

Suppose the object is placed at point P on the line EM joining the centres E, M of Earth and Moon. Let distance $PM=r$. Then distance $EP=R-r$ where $R=384,400km$ is the distance $EM$.

Suppose the mass of the Earth is $m$. Then the mass of the Moon is $\mu m$ where $\mu=0.0123$. The gravitational forces on an object of mass $m_0$ at point P from the Earth and Moon are respectively $$F_E=G\frac{mm_0}{(R-r)^2}$$ $$F_M=G\frac{\mu m m_0}{r^2}$$

We need to find a distance $r$ such that $$F_M=\frac13 F_E$$ $$G\frac{mm_0}{(R-r)^2}=\frac13 G\frac{\mu m m_0}{r^2}$$ Rearranging : $$\frac{3}{\mu}r^2= (R-r)^2$$ $$kr=R-r$$ $$r=\frac{R}{k+1}$$

Here $$k=\sqrt{\frac{3}{\mu}}=\sqrt{\frac{3}{0.0123}} \approx 15.617$$ hence $$r=\frac{384,400}{16.617} km\approx 23,100 km$$

2. This calculation assumes that P lies outside of the Moon and the Earth. Inside the Moon and Earth the $1/r^2$ law does not apply; instead the gravitational force is proportional to $r$. Another method would have to be used. So check that the calculated value of $r$ is greater than the radius of the Moon. It is. Phew.


text:
# Random walk on $\mathbb{R}$ with “sticky” origin

Let $$P_i$$, $$N_i$$, and $$Z_i$$, $$i\in\mathbb{N}$$ be r.v.'s with the $$P_i$$, $$N_i$$, and $$Z_i$$ being identically distributed with known pdf's $$f_P$$, $$f_N$$, and $$f_Z$$, respectively; and with no dependence between any $$P_i$$, $$N_i$$, or $$Z_i$$. Define the following recurrent process:

$$T_0:=0$$

$$T_i:=\left\{ \begin{array}{ll} Z_i & \quad T_{i-1} = 0 \\ min(T_{i-1}+N_i, 0) & \quad T_{i-1} < 0 \\ max(T_{i-1}+P_i, 0) & \quad T_{i-1} > 0 \end{array} \right.$$

In English: a particle walks randomly on the real number line (starting from the origin) in discrete time steps, where its position cannot change sign from positive to negative or vice-versa in a single step - were it to do so, it is set back at the origin before the next step - and where its evolution depends on the sign of its current position.

What can be said about the pdf's of the $$T_i$$ in relation to $$f_P$$, $$f_N$$, and $$f_Z$$?

• If $P_i, N_i, Z_i$ are all standard normals, then $T_2$ has a pdf of $$\frac{1+\text{erf}(|x|/2)}{4\sqrt{\pi}}e^{-x^2/4}$$ plus a $1/4$ chance of being exactly 0, for a total variance of $3/2+1/\pi$. That complexity does not suggest simple asymptotics. – Matt F. Oct 21 '18 at 19:55
• Also: $T_2$ has $1/4$ chance of being exactly 0 whenever $P, N, Z$ have identical continuous distributions with symmetry about the origin. – Matt F. Oct 22 '18 at 0:31


text:
# Evaluating suitability of confined impinging jet reactor for exothermic reactions: hydrodynamics, residence time distribution, and heat transfer

 Title Evaluating suitability of confined impinging jet reactor for exothermic reactions: hydrodynamics, residence time distribution, and heat transfer Publication Type Journal Article Year of Publication 2022 Authors Khan, MS, Mane, M, Kulkarni, AA Journal AICHE Journal Volume 68 Issue 10 Pagination e17792 Date Published OCT Type of Article Article ISSN 0001-1541 Keywords confinement, exothermic reactions, heat transfer, impinging jets, residence time distribution Abstract Effect of confinement (wall proximity) of a confined impinging jet reactor (CIJR) on the flow field, residence time distribution and heat transfer are explored, through experiments and CFD simulations. Hydrodynamic characteristics are evaluated for different parameters namely confinement, impinging jet velocity, temperature gradient, and so on. For 2 mm confinement, highest values of dispersion number and overall heat transfer coefficient are observed due to interaction of turbulent eddies followed by the effect of reactor wall proximity. For the CIJR having confinements above 10 mm, jet velocity need to be greater than 3 m/s to achieve both, excellent mixing efficiency and high heat removal rate. Empirical correlations for Dispersion and Nusselt numbers as a function of Re-j and L/D are obtained, over a range of 500 <= Rej <= 3000\$\$ 500\textbackslashle {\textbackslashmathit{\textbackslashoperatorname{Re}}}_j\text backslashle 3000 \$\$ and 5 <= L/D <= 35\$\$ 5\textbackslashle L/D\textbackslashle 35 \$\$, which correspond to jet velocity of 0.5-3 m/s. The present study gives a basis for designing CIJR suitable for rapid, homogeneous, exothermic reactions. DOI 10.1002/aic.17792 Type of Journal (Indian or Foreign) foreign Impact Factor (IF) 4.167
Divison category:
Chemical Engineering & Process Development
Database:
Web of Science (WoS)


text:
# Revision history [back]

It seems to work for me:

sage: load "exp.spyx"
Compiling exp.spyx...
sage: time pollard_rho(next_prime(10**6)*previous_prime(10**7))
CPU times: user 0.23 s, sys: 0.01 s, total: 0.23 s
Wall time: 0.24 s
1000003

I'm a little puzzled, though, because the error message you show doesn't seem to correspond to the line in your source, namely that in the code you put up it says "sage.all.mod(sage.all.mod(y,n)**2+1,n)**2+1" but the error message points to a line of code reading 2+1,n)**2+1", but the error message is pointing to y = sage.all.mod(sage.mod(y,n)**2+1,n)**2+1, without an ".all." between sage and mod, so it seems to be looking in the module "sage" for the function mod.

For what it's worth, that's exactly the error message I get if I remove the ".all".

It seems to work for me:

sage: load "exp.spyx"
Compiling exp.spyx...
sage: time pollard_rho(next_prime(10**6)*previous_prime(10**7))
CPU times: user 0.23 s, sys: 0.01 s, total: 0.23 s
Wall time: 0.24 s
1000003

I'm a little puzzled, though, because the error message you show doesn't seem to correspond to the line in your source, namely that in the code you put up it says "sage.all.mod(sage.all.mod(y,n)**2+1,n)**2+1" but the error message points to a line of code reading 2+1,n)**2+1", but the error message is pointing to "y = sage.all.mod(sage.mod(y,n)**2+1,n)**2+1, ", without an ".all." between sage and mod, so it seems to be looking in the module "sage" for the function mod.

For what it's worth, that's exactly the error message I get if I remove the ".all".


text:
1k views

### Image is not showing full width and height [duplicate]

Possible Duplicate: Image from \includegraphics showing in wrong image size Image is not showing full width and height, it is showing 100% as single dot, when you zooming view this picture some ...
507k views

### Change image size

I'm trying to change the image size (make it look smaller than the original). I tried with the next code but the image still shows at its original size. \begin{figure}[h!] \centering \...
90k views

### Which package is using \includegraphics?

Which package is using \includegraphics? I have a issue in my installation package, I need to know which package is using \includegraphics. The issue is picture showing like a DOT . If we zoom (6400%...
6k views

### How to include picture in original size into document page on center?

I have a picture that I'd like to include in the center of the page. I don't want the picture to scale. So I tried this (among a lot of other variations): \begin{figure}[htb] \centering \...
43k views

### Inserting PNG file as is

I'm inserting PNG file and it's rendered enlared, somehow. Here is MWE: \documentclass{book} \usepackage{graphicx} \begin{document} \mainmatter hello, world. the following screenshot should be ...
8k views

### How to correctly clip with viewports with includegraphics and beamer columns?

I will happily accept any alternative to beamer's columns and \includegraphics that produces the intended result in a beamer slide. I'm trying to take the attached eps file and reorganize it so that ...
823 views

### How to force pdfTeX and XeTeX to produce the same measurement for the imported image?

resolution is undefined in XeTeX so the following code will produce different values when compiled with pdfTeX and XeTeX. \documentclass{article} \usepackage{graphicx} \newsavebox\IBox \savebox\IBox{...
3k views

### Problem sizing the image with \includegraphics

This question is very similar to Image from \includegraphics showing in wrong image size, but not quite the same. The size of the image that appears in my manuscript depends entirely on the dpi ...
2k views

### Scale image based on the size of another image

I'm currently writing a LaTeX document which describes a technical installation and configuration process of a piece of software. I took two screenshots I want to include as figures in my document. ...


text:
# Holding off on evaluating variables

There is a difference between performing a calculation and solving a problem.

I’ve been considering the equation of a circle, $x^2 + y^2 = r^2$. Except, you see, that’s not the entire thing. There’s a bit that we’ve dropped because it’s  zeroes (and therefore doesn’t affect our equation):

$(x-h)^2 + (y-k)^2 = r^2$.

This equation contains the full information–everything that is necessary to draw and position a circle on a cartesian graph. You see, the and k move the circle around the graph. When the circle is on the origin, they are both zero and often dropped from the formula. When figuring something quickly with a circle, the shortened form is more than adequate. However, without them, part of the story is lost.

Similarly, if we have the task of working a problem it is tempting to perform the arithmetic along the way. If we resist, however, at the end we produce a general solution that may be used for other similar problems.

Programming can work the same way. We may write a program to perform a calculation. This would involve lots of hardcoding, many assumptions making it analogous to our “arithmetic along the way”.

Alternatively, try leaving the variables in, or not doing the arithmetic along the way, and preserve the information in the equation which would otherwise be lost.


text:
# How to design this cover page

I came across this image:

I was wondering how to manage the vertical book title in pdflatex.

• Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – egreg Sep 20 '16 at 10:39
• You can do it with standard elements as described in Lamport's book on LaTeX or any other tutorial on LaTeX, most notably using the commands \scalebox, \rotatebox, \sffamily, \bfseries, \Huge and the environments minipage and titlepage. For the width of the minipage, you can either find it by trial and error, or you use \newlength and \settowidth. If you get stuck with a concrete problem or you have questions regarding how to get rid of the borders, how to change background and foreground colour, etc come back to TeX.SX. – gernot says Reinstate Monica Sep 20 '16 at 11:17

With bookcover class, you can completely design the cover with all its components: front, back, spine and flaps.

An example:

\documentclass[marklength=0mm,
bleedwidth=0mm,
spinewidth=20mm]{bookcover}
\usepackage{lmodern}

\begin{document}

\setbookcover{bgcolor}{whole}{%
color=gray!80!brown!30,
}

%back cover
\setbookcover{fgfirst}{back}{%
\vfill
\hfill
\resizebox{100mm}{!}{%
\rotatebox{-90}{\textsf{\textbf{\color{white}{\parbox{10cm}{\raggedright STOP SAYING\\ I WILL\\ START DOING}}}}}}
%\vfill
}

%front cover
\setbookcover{fgfirst}{front}{%
%\vfill
\resizebox{100mm}{!}{%
\rotatebox{-90}{\textsf{\textbf{\color{white}{\parbox{10cm}{\raggedright STOP SAYING\\ I WILL\\ START DOING}}}}}}
%\vfill
}

%spine
\setbookcover{fgfirst}{spine}{
\vfill
\centering
\resizebox{10mm}{!}{
\rotatebox[origin=c]{-90}{\textsf{\textbf{\color{white}Stop saying I will start doing}}}}
\vfill}

\makebookcover
\end{document}

Something like this?

\documentclass[12pt]{article}
\usepackage[showframe, b5paper]{geometry}%
\usepackage{classico}
\usepackage[table,  x11names]{xcolor}
\usepackage{pagecolor}

\begin{document}

\begin{titlepage}
\pagestyle{empty}\newpagecolor{Khaki4}
\rotatebox[origin=lt]{-90}{


text:
# LPS conjecture?

If there exist six natural numbers, a, b, c, d, e, and f that satisfy the equation $a^6 + b^6 + c^6 + d^6 + e^6 = f^6,$ at least how many of them are divisible by 7?

×


text:
# Expressing positive integers as the sum of different charming numbers

In a practice academic interview of mine, we discussed question six, round one, of the United Kingdom Mathematics Trust's 2015 British Mathematical Olympiad. Which states:

A positive integer is called charming if it is equal to 2 or is of the form 3i5j where i and j are non-negative integers. Prove that every positive integer can be written as a sum of different charming integers.

Having been able to successfully prove this, afterwards I then went on to implement, in Python, a program which can express any positive integer in terms of the sum of different charming numbers.

To do this I start by converting the integer into base 3 so that it is easier to find a charming number that is more than half the value of the original integer, but less than it. This value is then appended to a list, and the process is then repeated with the difference until left with either 1, 2, or 3. A list of charming numbers is then returned, which all sum to the original number.

I know this method works, simply as I used it somewhat in my proof.

def to_base_3(base_10: int) -> str:
working_number = int(base_10)
output = ''

while True:
next_digit = working_number % 3
output = str(next_digit) + output
working_number = working_number // 3

if working_number == 0:
return output

def to_base_10(base_3: str) -> int:
output = 0

for i, char in enumerate(base_3[::-1]):
output += int(char) * (3 ** i)

return output

def find_charming_components(number: int, charming_components: list = None) -> list:
if charming_components is None:
charming_components = []

base_3_value = to_base_3(number)
digit = base_3_value[0]
component = 0

if len(base_3_value) == 1:
if digit != '0':
charming_components.append(int(digit))

return charming_components

if digit == '1':
component = to_base_10('1' + '0' * (len(base_3_value) - 1))
# Find the largest power of three that is lower than the current value. I.e: 3**4
charming_components.append(component)
# Append this charming number to the list of components

elif digit == '2':
component = to_base_10('12' + '0' * (len(base_3_value) - 2))
# Find the largest power of three times five that is lower than the current value. I.e: 3**4 * 5
charming_components.append(component)
# Append this charming number to the list of components

number -= component
# Repeat process with the difference
return find_charming_components(number, charming_components)

print(find_charming_components(int(input('Number: '))))

I just feel like doing a full base 3 conversion and back again isn't the most efficient method of doing this, and would appreciate some help on generally improving the algorithm.

def to_base_3(base_10: int) -> str:

Why str? I think it's simpler to use lists of digits.

base_10 is a misleading name. It's an integer. It's actually in base 2 in just about every CPU this code will ever be run on.

def to_base_10(base_3: str) -> int:

Similarly: this is from_base_3 to integer.

    output = 0

for i, char in enumerate(base_3[::-1]):
output += int(char) * (3 ** i)

return output

It's simpler to convert from a list of digits to an integer in big-endian order:

def to_base_10(base_3: str) -> int:
output = 0

for char in base_3:
output = 3 * output + int(char)

return output

def find_charming_components(number: int, charming_components: list = None) -> list:
if charming_components is None:
charming_components = []

Frankly this is ugly. I understand that you want to use append for efficiency, but it would be cleaner with an inner recursive method.

    if digit == '1':
component = to_base_10('1' + '0' * (len(base_3_value) - 1))
# Find the largest power of three that is lower than the current value. I.e: 3**4
charming_components.append(component)
# Append this charming number to the list of components

I don't think I've ever seen comments after the code before, and it took me a while to work out what was going on.

If you have closed form expressions, why call to_base_10?

Also, surely it's "no greater than" rather than "lower than"?

    elif digit == '2':

Why not just else:?

        charming_components.append(component)

If the same code ends all the cases, it can be pulled out.

At this point I have

def find_charming_components(number: int) -> list:
charming_components = []

def helper(n):
base_3_value = to_base_3(n)
digit = base_3_value[0]

if len(base_3_value) == 1:
if digit != 0:
charming_components.append(digit)
return

component = 0
if digit == 1:
# Find the largest power of three that is no greater than the current value. E.g: 3**4
component = 3 ** (len(base_3_value) - 1)
else:
# Find the largest power of three times five that is no greater than the current value. E.g: 3**4 * 5
component = 5 * 3 ** (len(base_3_value) - 2)

charming_components.append(component)
# Repeat process with the difference
helper(n - component)

helper(number)
return charming_components

Now, helper is clearly tail-recursive, so is easy to replace with a loop:

def find_charming_components(number: int) -> list:
charming_components = []

while number > 0:
base_3_value = to_base_3(number)
digit = base_3_value[0]

if len(base_3_value) == 1:
if digit != 0:
charming_components.append(digit)
break

component = 0
if digit == 1:
# Find the largest power of three that is lower than the current value. E.g: 3**4
component = 3 ** (len(base_3_value) - 1)
else:
# Find the largest power of three times five that is lower than the current value. E.g: 3**4 * 5
component = 5 * 3 ** (len(base_3_value) - 2)

charming_components.append(component)
# Repeat process with the difference
number -= component

return charming_components

At this point, the remaining issue is the cost of the conversion to base 3. Observing the sequence of numbers, we can easily generate them and then filter:

def find_charming_components(number: int) -> list:
candidates = [1, 2, 3]
current = 3
while current < number:
candidates.extend([current // 3 * 5, current * 3])
current *= 3

charming_components = []
for candidate in reversed(candidates):
if number >= candidate:
charming_components.append(candidate)
number -= candidate

return charming_components

Your to_base_10(x) function may be easily rewritten as:

def to_base_10(base_3):
return int(base_3, 3)

However, you are only using the function to convert base 3 numbers of the forms '1' followed by n zeros, and '12' followed by n zeros. These can be directly computed as:

• to_base_10('1' + '0'*n) --> 3 ** n
• to_base_10('12' + '0'*n) --> 5 * 3**n

The output of the to_base_3(x) function is only used to produce 2 values: len(base_3_value) and digit = base_3_value[0]. These can also be directly computed.

if number > 0:
len_base_3_value = int(math.log(number, 3)) + 1
digit = number // (3 ** (len_base_3_value - 1))
else:
len_base_3_value = 1
digit = 0

Note: digit is now an int (0, 1, or 2), not a str ('0', '1', or '2')

You recursively call and then return the value of find_charming_components(number, charming_components). Python does not do tail recursion optimization, so this should be replaced with a simple loop, instead of recursion.


text:
Successful Cryptanalysis Research/Attacks on Zero-Knowledge Proofs?

A robust implementation of any cryptosystem (E.g., AES) has a comprehensive cryptanalysis research/attacks on it.

Are there any successful cryptanalysis research/attacks on zero-knowledge proofs?

1 Answer

For most symmetric cryptosystems, such as AES, the best way to study their security is to design various types of attacks, and to analyze the resistance of the primitive to these attacks. With zero-knowledge proofs, things are in general a bit different:

• Zero-knowledge proofs are, in some sense, a "higher level" primitive, which means that they can be (and are, in general) constructed from other primitives.
• Unlike symmetric cryptosystems, where the number of "standard primitives" is relatively small, there are hundreds of proposals for zero-knowledge proofs. This means that getting confidence in their security using cryptanalysis would require designing attacks for hundreds of different, non-standardized (and not much used in practice) primitives. That would be kind of a waste of effort.

For the above reasons, the usual (and best) approach to study the security of zero-knowledge proofs is through provable security. Usually, this is done by reducing the security properties of the zero-knowledge proof to the underlying lower level primitive it was built from. This way, cryptanalysts can simply focus on this underlying primitive to give us confidence in the security of the proof. Roughly, the zero-knowledge proofs we know of belong to four categories:

• Some have unconditional security. This means that we can prove that they satisfy completeness, soundness, and zero-knowledge, without making any assumption. This is the case e.g. for the standard proof for graph isomorphism, or for the famous Schnorr protocol for knowledge of a discrete logarithm (which only satisfies honest-verifier zero-knowledge). For these proofs, no cryptanalysis is needed.
• Some can be reduced to generic assumptions. For examples, the general solution to zero-knowledge proofs for NP from the seminal paper of Goldwasser, Micali, and Rackoff, can be based on any one-way function. This means, in particular, that we can build a proof for any NP statement, whose security (here, soundness is unconditional and zero-knowledge is computational, but we can also get the reverse) would reduce to the assumption that AES is secure. Hence, we can use all cryptanalytic efforts on AES (or SHA3, or any symmetric primitive you can think of) to our advantage when constructing a ZK proof.
• Some proofs reduce to specific, well known assumptions. This is usually the case for more "advanced" zero-knowledge proofs. For example, Jen Groth's sublinear zero-knowledge arguments, which allow to prove statements from linear algebra with communication $O(\sqrt{N})$ ($N$ is the size of the statement), is secure under the discrete logarithm assumption. This means that cryptanalytic efforts can focus on algorithms for solving the discrete logarithms, if we want to study the security of these protocols.
• Finally, some recent zero-knowledge proofs have more ad-hoc underlying assumptions. This is in general the case of zk-SNARKs, where we give up the reduction to standard and well-known assumptions, in exchange for extreme efficiency (i.e., the proof is non-interactive and of constant size). For these "extreme" proofs, it would make sense to have a specific cryptanalytic research, but as the area is still very young, there are not much results in this direction at the moment.


text:
# Tag Info

15

This is when the attempt at accuracy creates confusion and misunderstanding. Back in the day, growth models were not incorporating technological progress, and led to a long-run equilibrium characterized by constant per capita magnitudes. Verbally, the term "steady-state" seemed appropriate to describe such a situation. Then Romer and endogenous growth ...

10

Eq. (2.64) can be written as (at first order) $$k_{t+1} - k^* = \lambda (k_t - k^*) \tag{1a}$$ Define the quantity $\kappa_t$ as $$\kappa_t \stackrel{\rm def}{=} k_t - k^* \tag{2}$$ So that $$\kappa_{t+1} = \lambda \kappa_t \tag{1b}$$ This can be solved very easy by realizing that \begin{eqnarray} \kappa_1 &=&\lambda \kappa_0 \\ \...

9

There is quite a bit of work being done in that area. One very recent example is Straub and Werning's working paper "Positive Long Run Capital Taxation: Chamley-Juff Revisited." The point seems to be that we need to consider the rate of convergence to the steady state. Also, there is other literature that gives some competing results (e.g., "the new ...

6

Ljungqvist and Sargent (2004). Recursive macroeconomic theory 2n ed. (ch. 15) present and review the issue. In the Concluding Remarks section, they mention two environments, where the "zero-optimal-capital tax rate" does not hold: Aiyagari(1995) presents a model with heterogeneous agents, incomplete insurance markets and borrowing constraints (i.e. a "...

5

A system is explosive if its coefficients are non-stationary. Stationary is an important property to have in dynamic models as it tells us that an equilibrium value is obtainable (which is important in finding the BGP). If your system is explosive no equilibrium (and BGP) exists. In your example where you have the equality: $$k_t-k^* \simeq \lambda^t (k_0-... 5 Following the conversation with user @denesp at the comments of my previous answer, I have to clarify the following: the usual graphical device we use related to the basic Solow growth model (see for example here, figure 2) is not a phase diagram, since reasonably we call "phase diagrams" those that contain zero-change loci, identify the crossing points of ... 5 Rearranging the steady state equation$$ \overline{p}^{\alpha}=\alpha y\overline{p}^{\alpha-1}- \alpha\overline{p}^{\alpha}-\frac{a+1}{\sigma} $$we get$$ (1 + \alpha)\overline{p}^{\alpha}=\alpha y\overline{p}^{\alpha-1}- \frac{a+1}{\sigma}. $$As \alpha \in [0,1], the left hand side of the equation is increasing in \overline{p} and the right hand side ... 4 An axis is characterized not by the variable it measures, but by the unit of measurement. So an axis can measure any number of variables, as long as they are measured in the same measurement unit. In your case, the unit of measurement is "units of output", and both (n+\delta)k and sf(k) are measured in it (capital is measured in units of output, in case ... 4 Your first question (regarding constraints on the parameters) can be answered through first and second derivative analysis. In order to satisfy strictly increasing, we need u'>0 and to satisfy strictly concave, we need u''<0. What does this actually mean?$$u'(\frac{}{})=\phi p\theta c_t^{p-1}e^{\theta c_t^p}>0$$Since we know that c_t^{p-1}e^{... 4 One general issue I see is that you try to include uncertainty in a framework developed for a deterministic setup. What you do is to use expected income in the equation of motion for human capital. Let I_{a,t} denote the indicator function for attack, taking the value 1 when there is an attack, and the value 0 when there isn't. Then, properly,$$\dot{...

3

As you say the first step is to take log of both sides after that you are just applying the rules for logarithms and rearrange. For example: $$\ln (XZ)=\ln X + \ln Z$$ $$\ln X/Z= \ln X - \ln Z$$ $$\ln X^a = a \ln X$$ $$\ln 1 = 0$$ Also an important approximations that hold close to zero are applied here as well these are: $\ln(1+x) \approx x$ for $x$ ...

3

According to your calculations MPK is not increasing in $K$. The Solow model assumes $0< \alpha < 1$, thus $\alpha - 1 < 0$ and $K^{\alpha - 1}$ is decreasing in $K$.

3

If $Y = C \cdot X$ where $C$ is constant and $\frac{\dot{X}}{X} = g$ then we can solve for $\frac{\dot{Y}}{Y}$ as follows: $$\frac{d}{dt} Y = \frac{d}{dt} C \cdot X = C \cdot \frac{dX}{dt} = C \cdot \dot{X} \Rightarrow$$ $$\frac{\dot{Y}}{Y} = \frac{C \cdot \dot{X}}{ C \cdot X} = \frac{\dot{X}}{X} = g$$ Therefore, as you concluded, they both grow at rate $... 3 Your first question, if it's literally correct, is easy: The only way for$u'$to be positive for c=0 is for p=1. if p =1 then sign($\phi$)=sign($\theta$) so that the product is positive. But, since$exp()>0$and$p=1$, the first term of$u''$cancels out and the only way for u'' to be negative is for$\phi$to be negative. Therefore$\theta<0$too. ... 3 I'm not sure I follow the logic on that equation having infinitely many solutions and steady states. In any case, in what follows are some guidelines for equilibrium selection. It depends a lot on the context. Here are some criteria, in descending order of relevance Clean Ways Is any of the steady states unstable? If so, it's less likely to be the one ... 3 If the variables are constant, everything in the equation is time-invariant, while$a^t$will still grow or fall over time (unless$a=1$). This is a contradiction and no steady state exists, unless$a=1$. 3 I don't know the paper nor the notation, so I am just guessing here. I gues$N(a,t)$is the number of agents of age$a$at time period$t$. Let's follow the number of age$Baccross generations: \begin{align*} N(B,t) &= e^f N(B, t- B),\\ &= e^{2f} N(B, t - 2 B),\\ &= \ldots,\\ &= e^{f t/B} N(B,0),\\ &= e^{\eta t} N(B, 0). \end{align*} ... 2 If you have are trying to discretize the continuous time model \dot{\textbf{x}} = A\textbf{x}, $$then in discrete time you will have$$ \textbf{x}_{t+1} = B \textbf{x}_t $$but A\neq B, since A describes the change in \textbf{x} while B describes the next value of \textbf{x}, not just the change. However$$ \Delta\textbf{x}_t = \textbf{x}_{t+1} ... 2 I found the error in my derivation: I mistakenly supposet that the steady state ofp_t+1$equals$\bar{\rho}$. I did not recognize that p was different from$\rho$because of the poor quality of my printout. Reading the paper again on a screen I immediately spotted the mistake. 2 The steady-state value$k^*$must be a fixed point :$(1+g)(1+n)k^* = s(k^*)^{\alpha} +(1 - \delta) k^*$Taking the difference between this equation and the dynamic one :$(1+g)(1+n)(k_{t+1} - k^*) = s((k_{t+1})^{\alpha} - (k^*)^{\alpha}) +(1 - \delta) (k_t - k^*)$Now if you denote by$d_t = k_t - k^*$the distance to steady-state, this gives :$(1+g)(...

2

In the model with technological progress the capital per effective worker remains constant, implies that capital per worker grows at the rate of exogenous rate of technological progress. See Barro and Martin book, Chapter 1.

2

Usually the term steady state is derived from the Solow Model and its derivatives that seek to explain long-term economic growth. The steady state is a state in which the growth rate of the economy is constant (but positive!). In the Solow model, the growth rate is more or less a function of the saving rate. An economy might deviate from this because it's ...

2

Smith pointed out that as wealth was growing in any nation, the rate of profit would tend to fall and investment opportunities would diminish. Source The first half of the sentence makes it clear that this is not about steady state economies, as wealth is still growing. my question can be rephrased in a simpler way: If the economy was/became a ...

2

Let's guess that the value function is of the form $a + b \ln(k)$. Then substituting for $V(k) = a + b \ln(k)$ in the Bellman equation gives: $$a + b \ln(k) = \max_{k'}\left(\ln(k^\alpha - k') + \beta(a + b \ln(k')\right)$$ The first order condition is given by: \begin{align*} &\frac{-1}{k^\alpha - k'} + \beta b \frac{1}{k'} = 0,\\ \to & k' = \... 1 yes, the term that you showed for the ALDR non-stochastic steady state:\frac{ \beta_1 + \beta_2 }{1- \rho_1 -\rho_2}$$is long-run multiplier or sometimes also called long run equilibrium coefficient (see Verbeek 2008 Guide to Modern Econometrics 4th ed. pp 340). As far as I can understand there is not much difference between the two concepts in the ... 1 Start by writing the Lagrangian (as it sounds like you have already done):$$L=\sum_{t=0}^{\infty} \{\beta^t(\ln C_t^y + \ln C_t^o) + \lambda_t (C_t^y +\frac{C_t^o}{1+n} +k_{t+1}(n+1)-k_t-f(k_t))\}.$$First order conditions are given by$$\frac{\partial L}{\partial C_t^y} = \frac{\beta^t}{C_t^y} +\lambda_t = 0\frac{\partial L}{\partial C_t^o} = \frac{...

1

Let production function $$F(K_t,L_t)=K_t^aL_t^{1-a}$$ $$max[c^*=f(k^*)-(δ+n)k^*]$$ with respect to $k^*$ Then $MPK=a(k^*)^{a-1}$ So $k_G= (\frac{a}{(δ+n)})^{1/1-a}$ which is golden rule level of capital stock per capita. Now calculate consumption at golden rule level $$c_G=f(k_G)-(δ+n)k_G$$ $$c_G=(k_G)^a-(δ+n)k_G$$ $$c_G=(\frac{a}{(δ+n)})^{a/1-a}-(δ+... 1 To stick to the simpler deterministic case, it is perfect foresight and the Transvarsality condition (TVC)that guarantees that an optimizing agent will stay on the saddle-path, because all other paths lead to the violation of TVC (corner solutions violate the TVC). In a deterministic environment and with perfect foresight the agent knows this and so he ... 1 In general, a steady state in discrete time is that the first difference is zero at some t=t_0, and that it remains so:$$y_t-y_{t-1}=x_t-x_{t-1}=0$$for all t\geq t_0. Hence, in a steady state, y_t and x_t are constant at some values y and x. Thus, y=\beta(y+\gamma z), which implies$$y=\frac{\beta\gamma z}{1-\beta}, and $x=\rho x+y$, which ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
Sciencemadness Discussion Board » Fundamentals » Organic Chemistry » Custom Organic Synthesis Costs Select A Forum Fundamentals   » Chemistry in General   » Organic Chemistry   » Reagents and Apparatus Acquisition   » Beginnings   » Responsible Practices   » Miscellaneous   » The Wiki Special topics   » Technochemistry   » Energetic Materials   » Biochemistry   » Radiochemistry   » Computational Models and Techniques   » Prepublication Non-chemistry   » Forum Matters   » Legal and Societal Issues

Author: Subject: Custom Organic Synthesis Costs
BrainAmoeba
Harmless

Posts: 15
Registered: 12-7-2020
Location: It depends...
Member Is Offline

Mood: Poisoned

Custom Organic Synthesis Costs

Hello,

Recently, I have gained some knowledge in topics of organic building blocks design and synthesis planning. I have also discovered that there are many companies that specialize in custom synthesis.

Does anybody know the price ranges of such orders (number of steps, purity, amount and their influence on the cost)?
Sulaiman
International Hazard

Posts: 3126
Registered: 8-2-2015
Location: UK ... on extended Holiday in Malaysia
Member Is Offline

I have zero experience here but I guess that the cost would be more than buying the required equipment and materials

I think that the hard part will verifying the purity of your product, so you may need to pay for analysis (eg gc-ms)

CAUTION : Hobby Chemist, not Professional or even Amateur
Texium

Posts: 3601
Registered: 11-1-2014
Location: Salt Lake City
Member Is Offline

Mood: Triturated

I don’t know much about these companies, but I do work in an academic synthesis lab, so I have an idea of what would likely go into it. I probably spend about 4 to 5 hours of active working time on each step of a synthesis, when you include setup, workup, usually column chromatography, and analysis. Let’s say a synthesis chemist makes about $30 per hour (a lot more than I do as a grad student, but that may even be lowballing it for industry standards). So that’s$120-150 of labor per step of the synthesis. We’ll go with the lower end of that since they’re likely more efficient than I am, but they probably make more money than I estimated. So $120 per step. Reagent cost could be pricey too, depending on what it is you need. The larger amount you need should actually make the price a better deal, considering the labor is the most expensive part, and the work to make 10 grams is the same as it would take to make 0.1 gram. If you need exceptional purity, that would require more labor time, since it would need additional chromatography or other purification techniques, and it would require verification by more analytical methods too. Most research chemicals that aren’t required to be ultra high purity, I’d bet they likely get an NMR and HPLC trace, say “yep, that’s at least 97%” and call it good enough. If you need 99.9% then they’ll probably need to purify it more stringently and use high resolution MS and/or elemental analysis to verify the purity. Put a tidy profit for the company on top of that, and you’ve got yourself one expensive chemical. I don’t think that there would be any justification for an amateur to order from one of these companies. They cater to companies with big R&D budgets and university labs with lots of grant money (even then, most PIs will likely opt to have their much less expensive grad students make the compounds, even if it takes a little longer). I also don’t think it would be a very easy business to get into, mainly for the need to pay for analysis that Sulaiman mentioned. It would be difficult to make a profit and have timely turnaround on your products if you had to constantly rely on a third party that’s also trying to make a profit to verify the quality of your products. Come check out the Official Sciencemadness Wiki They're not really active right now, but here's my YouTube channel and my blog. draculic acid69 International Hazard Posts: 1256 Registered: 2-8-2018 Member Is Offline China. I don't see how it could be affordable to use such a service with non Chinese Labor unless you're one of the previously mentioned Universities or companies with r&d budgets. [Edited on 19-5-2021 by draculic acid69] Texium Administrator Posts: 3601 Registered: 11-1-2014 Location: Salt Lake City Member Is Offline Mood: Triturated If you need it in large quantity (kilos). If you need it on a gram scale, they probably won’t even acknowledge your request. Come check out the Official Sciencemadness Wiki They're not really active right now, but here's my YouTube channel and my blog. Dr.Bob International Hazard Posts: 2350 Registered: 26-1-2011 Location: USA - NC Member Is Offline Mood: No Mood More recently the price for outsourced compounds in the US is$1000 per day of labor plus materials. The $1000 covers labor, overhead, hood space, equipment costs, waste disposal, and much more. Often the cost of chemicals is nearly immaterial, unless you are doing something with pricey chemicals. But once you go to China and do a larger amount, the cost drops to more like$500 to $100 a day as you go larger scale or more compounds. AvBaeyer International Hazard Posts: 578 Registered: 25-2-2014 Location: CA Member Is Offline Mood: No Mood I agree with Dr Bob on the daily cost of a "rental chemist." Ten years ago when I was still actively consulting the typical cost of an outsource chemist was figured at$300K per year in the US. This included salary, benefits, supervision, company overhead, and anything else that could be billed. The ten year ago cost is in line with what Dr Bob is quoting for current costs. Chemicals and solvents were extra, usually with a 10% service fee attached. There were/are some contract outfits that will simply resell chemicals from previous projects at full catalog price + service fee. (One of my sons worked for such a company at one time.) Cheaper labor could be found ex-US but project management (and cost control) would be much more difficult, especially with language barriers and time differences.

Texium: The typical synthesis rental chemist (BS level) is billed out at about $150 (or more) per project hour. Contract chemists will typically be working more than one contract project at a time thereby increasing billable hours without actually working extra time. It is how the racket is run. The salary of a good BS-level contract chemist is (now) probably in the$60-75K range. Perhaps Dr Bob has better information.

AvB

[Edited on 20-5-2021 by AvBaeyer]
Texium

Posts: 3601
Registered: 11-1-2014
Location: Salt Lake City
Member Is Offline

Mood: Triturated

Well, once I finish my PhD, custom synthesis certainly sounds like it could be a satisfying and lucrative future career for me

Come check out the Official Sciencemadness Wiki
They're not really active right now, but here's my YouTube channel and my blog.
BrainAmoeba
Harmless

Posts: 15
Registered: 12-7-2020
Location: It depends...
Member Is Offline

Mood: Poisoned

I've researched the topic a bit more and it looks like a very unaffordable option (maybe bigger customers can afford to do that).
draculic acid69
International Hazard

Posts: 1256
Registered: 2-8-2018
Member Is Offline

I seen an article somewhere about someone who contracted a company to make a new compound and they agreed on a price of a few hundred dollars for about five grams or so. So I'm guessing that it's not that expensive if U shop around outside of the u.s
BromicAcid
International Hazard

Posts: 3094
Registered: 13-7-2003
Location: Wisconsin
Member Is Offline

Mood: Legitimate

It varies greatly based on the process. Having done my share of quotes, the workflow is something like this:

An experienced chemist who works at the production scale of the process in question evaluates the prep. They look at the process yield, how much material the customer has requested for the quote and determine the scale of the run. Starting material cost is determined and this number goes in the tally.

Based on the prep and the experience of the chemist they determine a rough timeline for running the process i.e., stripping 6L solvent 4 hours, filtration (looks difficult) 6 hours, protracted addition based on reaction temperature (12 hours), overnight stir, 5x solvent exchanges to get DCM content Non-Detect by NMR, etc. (Times are completely made up in the examples here). This helps to determine the timeline.

From the times above, experience comes into play to determine the "hands on" time. Obviously an overnight stir doesn't take 12 hours of a chemist standing over it but a metered addition might take someone standing there baby-sitting it the whole time. So they figure out how much time a person actually needs to spend on the process and then add in a designated buffer (10-20% or whatever) to account for unforeseen difficulties. Then they multiply by the labor rate for the chemist $XXX.XX/hr. Some places will do hood time and not hands-on time so they would just take the previous number for all the operations and multiply it by the time the hood is occupied. Some places do a mix of the two - resource time and hands-on time. For some processes other factors like waste disposal costs, analytical analysis (multiple NMRs/HPLC/etc), and writing the batch record also come into the cost. Finally the labor cost, starter cost, and misc. cost are all added up. The customer contract spells out various things, amount they want to purchase and their cost for it, if they are willing to buy surplus material and at what price, delivery due date, purity specs, etc. A lot of the time custom synthesis in our plant is carried out on small-scale as a means to an end. The process has likely been quoted to run in the 2000 or 4000 Gallon kettles and they want to get the process nailed down at the small scale. [Edited on 5/26/2021 by BromicAcid] [Edited on 5/26/2021 by BromicAcid] Shamelessly plugging my attempts at writing fiction: http://www.robvincent.org Dr.Bob International Hazard Posts: 2350 Registered: 26-1-2011 Location: USA - NC Member Is Offline Mood: No Mood Much of this depends on where you are. A friend has a custom synthesis business in the US, and he is nearly out of work now. He used to get work from many companies, pharma, biotech, and more, but many people would rather buy from Chindia and wait months rather than pay more and get it sooner. Part of the issue is that most (but not all) foreign companies lie about their abilities, delivery time, and purity, and after waiting for months, when the buyer gets less material than promised, at a lower purity and later than expected, they are already late and cannot get their money back, so they make it work. I have purified materials from overseas before only to be told how much money we saved, and then have management complain that we did not do as much as planned, while ignoring our comments on how much time it took to fix their cheap purchases. So many managers think that they will save money, but ignore the problems and delays when they happen. Much like the people I know that buy tools at Harbor Freight and then complain that they broke or were crap. Used to buy Craftsman tools, back when they were real quality, but now much harder, very few companies make anything in the US, although a few are moving manufacturing back here due to the poor results they got. But in many cases, the prices are so different (from US to overseas source) that no one here can complete. So if you are in the US, don't think you will make chemicals and earn a living, it is very hard. If you are elsewhere you might be able to do it, but the competition is brutal and mostly on cost, much like EBay or Amazon prices on stuff, cheapest wins. Praxichys International Hazard Posts: 1063 Registered: 31-7-2013 Location: Detroit, Michigan, USA Member Is Offline Mood: Coprecipitated My LLC is a custom synthesis shop and I have reactors up to 50L. I get contracts occasionally but so far it has not been sustainable. It works in my situation because it's just another building on my property so there isn't rent or anything. I really just do it as a side gig that puts maybe$10-20k in my pocket every year.

My younger sister just got a job as a research chemist at a fairly local coatings place. I'm hoping to secure some contracts through that avenue; they have to bid fairly of course but my overhead is so low I can outbid basically anyone.

A good business model today is to get the stuff from China in bulk, certify its purity and purify if necessary, then offer it locally. The margins are small but trust me when I say that I appreciate domestic reagent suppliers and seek product from them first if at all possible.

[Edited on 27-5-2021 by Praxichys]
Fyndium
International Hazard

Posts: 1133
Registered: 12-7-2020
Location: Not in USA
Member Is Offline

I have been a couple of times in a situation that I needed something RIGHT NOW, not in two months, and was willing to pay a significant premium to whoever supplies it to me as fast as possible.

Do you guys perform only tried synthesis, or do you go on "whatever can be done" basis? How much margin of error do you take on your runs?
zed
International Hazard

Posts: 2247
Registered: 6-9-2008
Location: Great State of Jefferson, City of Portland
Member Is Offline

Mood: Semi-repentant Sith Lord

Well, the first question is: Do you actually need custom synthesis?

Your desired product, or something very much like it, may already be available commercially, at a reasonable price..... Somewhere!

What are you looking for?
BrainAmoeba
Harmless

Posts: 15
Registered: 12-7-2020
Location: It depends...
Member Is Offline

Mood: Poisoned

Hello,

Sorry for being inactive for such a long time.
I am pretty sure that chemical, I was looking for, was not (and is not) available commercially.
Either way, I have solved the problem without custom synthesis which seems to be rather expensive and unreachable (I do not have a company which would help with ordering a custom synthesis itself).

Thank you.
Dr.Bob
International Hazard

Posts: 2350
Registered: 26-1-2011
Location: USA - NC
Member Is Offline

Mood: No Mood

 Quote: Originally posted by Fyndium Do you guys perform only tried synthesis, or do you go on "whatever can be done" basis? How much margin of error do you take on your runs?

I currently do contract synthesis type work. We mostly do simple remakes, based on a patent, paper, or other known route. Sometimes we have to scale it up or down some, which can add some extra time to figure out how to make that work, such as checking for exotherms on a scale-up, or how to scale down a route that is in kilos from a patent down to milligrams, as most of the crystallizations in them don't work on small scale well. In those cases we aim at the desired amount or a little higher, and provide whatever we get from the route, sometimes less sometimes a little more than planned.

There are times that someone wants analogs made of a known compound, and then we will do contract to test the route and then have phases where we will make a number of compounds, often based on time and materials, rather than a set price, either making a number with a variable price, or often making as many as we can in a set time and then deciding how many more to make in lots.

Hope that helps. Often things don't work as well as claimed in papers or patents without a few runs to figure out where they left of details, printed the best run of each step, made errors in the written method, or just lied. But often they just leave out many of the details, like how they got seed crystals, the rate of addition, or more useful data.

 Sciencemadness Discussion Board » Fundamentals » Organic Chemistry » Custom Organic Synthesis Costs Select A Forum Fundamentals   » Chemistry in General   » Organic Chemistry   » Reagents and Apparatus Acquisition   » Beginnings   » Responsible Practices   » Miscellaneous   » The Wiki Special topics   » Technochemistry   » Energetic Materials   » Biochemistry   » Radiochemistry   » Computational Models and Techniques   » Prepublication Non-chemistry   » Forum Matters   » Legal and Societal Issues