text:
Fork me on GitHub
#beginners
<
2020-05-01
>
sroller00:05:35

Question to date and time data: is clj-time still the recommended lib for this? There's conflicting information on the interwebs about what to use. Apparently Java has improved a lot and it's now recommended to use java.time directly?

seancorfield00:05:38

I'm one of the maintainers of clj-time: please don't use it -- either use Java Time directly via interop, or one of the wrappers recommended in the clj-time readme.

bfabry00:05:28

lol, you need to make that note at the top even bolder and bigger Sean 😛 and red! maybe some <blink>

sroller00:05:54

@seancorfield thanks. I'll look into clojure.java-time then. I assume I can extract day, month, year etc from a value?

seancorfield00:05:08

I'll change the wording from "consider using" to "please use" perhaps.

sroller00:05:17

@bfabry yeah - perhaps in RED 🙂. Stackoverflow is full with old answers from 7 years ago. nothing new though.

sroller00:05:30

obviously not current anymore.

sroller00:05:52

the Clojure Cookbook also recommends clj-time 😄

bfabry00:05:11

ah yes SO is particularly vulnerable to bit-rot. once that answer is ticked as accepted it probably will never change

seancorfield00:05:26

Yeah, a lot of tutorials out there refer to clj-time -- I really don't know why it was so popular. Joda Time was already an immutable, value-based time library. clj-time really only adds a bit of syntactic sugar.

Bill Phillips00:05:54

Sugar tastes good.

😆 12
sroller00:05:17

@seancorfield Thanks for the help. I now can parse "2020-0430T20:27:56Z" :_)

sroller00:05:51

why does the first expression works but not the second? (= 2020 (t/as (t/zoned-date-time "2020-04-30T20:29:00Z") :year)) (= (list 2020 4) (t/as (t/zoned-date-time "2020-04-30T20:29:00Z") :year :day-of-month))

seancorfield00:05:27

What is t?

sroller00:05:03

from my ns (:require [java-time :as t])

seancorfield00:05:41

Day of month is 30, not 4.

seancorfield00:05:50

user=> (t/as (t/zoned-date-time "2020-04-30T20:29:00Z") :year :month-of-year :day-of-month)
(2020 4 30)
user=>

sroller00:05:05

I'd like to filter all datetime value of a specific date. I thought I'd extract year, month and day and then compare two lists, no?

sroller00:05:31

oh, I see what you mean.

sroller00:05:38

but the compare fails anyway

sroller00:05:30

ah, please disregard my last message - error between the ears

seancorfield00:05:43

Using Java Time directly is just as easy:

user=> (def year-month (juxt #(.getYear %) #(.getMonthValue %)))
#'user/year-month
user=> (year-month (java.time.ZonedDateTime/parse "2020-04-30T20:27:56Z"))
[2020 4]
user=>

seancorfield00:05:43

Or if you want the day as well

user=> (def year-month-day (juxt #(.getYear %) #(.getMonthValue %) #(.getDayOfMonth %)))
#'user/year-month-day
user=> (year-month-day (java.time.ZonedDateTime/parse "2020-04-30T20:27:56Z"))
[2020 4 30]
user=>

seancorfield00:05:47

There are plenty of good reasons for not bothering with a simple wrapper, and just using interop.

💯 4
seancorfield00:05:51

Unless you want to write platform-independent code, in which case cljc.java-time or juxt/tick could be used.

seancorfield00:05:05

Yeah, well, some people seem to think such code is worthwhile. I don't do cljs so I don't care 🙂

potetm01:05:40

Now that I think about it, it’s odd that I feel that way. In theory, they’re like letters or numbers. Their properties are derived from real life. But, if we’re honest, I’m pretty sure dates are a damn mess in every ecosystem.

potetm01:05:41

Even in a single ecosystem…. good lord java has 3 built-in competing date/time libs. And that doesn’t even include JodaTime!

bfabry01:05:16

they're not really "competing". but yeah time is hard. can't wait till we have to deal with vehicles that travel at an appreciable fraction of the speed of light someday (if it ever happens)

seancorfield01:05:30

Oh I agree, dates are the worst. We've been doing Clojure for a decade and we started with date-clj rather than struggling with Java since we were on Java 6 or Java 7 back then. We added clj-time at some point and started migrating to that, but I think that just made things more complex. Since we moved to Java 8 we started using Java Time (and clojure.java-time). We're on Java 11 right now and still have all three Clojure libraries in our code base 😐

😨 4
potetm01:05:46

Same story. Same ending.

seancorfield01:05:21

I am slowly replacing the first two with the third (and, yes, using the clojure.java-time wrapper a bit)... but we have nearly 100K lines of Clojure at this point so it's slow going...

👍 4
potetm01:05:43

It’s the sort of work that’s impossible to prioritize highly. Things somehow work, despite the inconsistencies. So, yeah, in small chunks over long periods of time is the only way to go.

potetm01:05:05

@bfabry you have not seen what I have seen. If they’re not “competing,” I don’t even wanna know what the proper word is. I’m sure it’s absolutely filthy.

seancorfield01:05:27

(and of course when you interact with JDBC, you tend to need java.util.Date anyway)

potetm01:05:01

Or do you mean java.sql.Date ? Or, wait, maybe java.sql.Timestamp

seancorfield01:05:48

They're both subtypes of java.util.Date 😛

seancorfield01:05:30

I just love how java.sql.Date extends java.util.Date and then disables all the time stuff! 😢

potetm01:05:55

yep, I was fixing to say, “only in the most technical sense!”

potetm01:05:24

it’s an absolute…. riot? yeah let’s say riot

sroller13:05:09

Seems I hit a hornet's nest with my date & time related question 🙂.

4
seancorfield15:05:50

@U0TSNMT53 it's always a good discussion to have -- I think a lot of devs don't realize what a mess it can be and how complex date/time stuff really is (esp. timezones).

seancorfield15:05:25

We have all our servers set to UTC, our JVMs set to UTC, and our database set to UTC -- all to avoid timestamp complexities!

💯 4
👍 4
bfabry01:05:00

well there is one you're supposed to use, and 3 others that have writing on their main webpages saying "don't use this". so that's what I mean by not "competing". They're certainly all "there" and "conflicting" and "annoying" 🙂

potetm01:05:19

My fav is how, no matter how much I want to use java8 dates, I’m bound to use java.util.Date by the clojure reader now.

alexmiller01:05:07

You can change the data reader map to read tags however you want

potetm01:05:27

Oh well, no going back now. c’est la vie

hiredman01:05:36

The reader is specifically designed not to tie types to tagged literals

hiredman01:05:21

Like, the whole point is tags are semantics, not types

hiredman01:05:37

The default type the reader uses for #inst tags is Java util date, but given a reader you control you can make it anything else

potetm01:05:41

@hiredman you underestimate the dual power of ecosystem and inertia

potetm01:05:03

Can you? Yes. WIll you? Maybe later 😛

dpsutton01:05:17

and what will your deps do

💯 4
hiredman01:05:06

Use inst-ms a lot

potetm01:05:15

Reality is: I’m never gonna override #inst. I might do a custom tag, but probably not that either. Because I have #inst.

hiredman01:05:52

clojure.core/inst-ms

potetm01:05:34

HOW DID I NOT KNOW THIS FN???

8
potetm01:05:44

I FEEL BETRAYED BY ALL OF YOU

potetm01:05:58

@hiredman is my only real friend

seancorfield01:05:54

user=> (inst-ms (java.util.Date.))
1588296744460
user=> (.getTime (java.util.Date.))
1588296759500
user=>

potetm01:05:21

except inst-ms works on java.time.Instants

seancorfield01:05:44

Ah yes, just figured that out.

hiredman01:05:45

inst-ms ends up being a Rosetta Stone when you get a date, but are not sure what the exact type will be

alexmiller01:05:46

Doesn’t it work on impls of the Inst protocol?

IvanS09:05:04

Hello, please what's wrong with (use '[ring.util]) ? I want to import all functions from ring.util

practicalli-john12:05:21

use brings along more than the functions in the namespace, it also brings the dependencies that the other namespace has. At some point you will get conflicts and it could be time consuming to resolve. The require with :as or :refer keeps your code very clean and specific in terms of what it pulls in to a namespace.

practicalli-john12:05:16

One theory is that topojson files are not working with Vega-lite, perhaps something about the topology they add. But I am still testing this idea

noisesmith15:05:21

@U05254DQM I think that was meant for a different slack :)

practicalli-john15:05:12

@noisesmith Oh yes it was, unless you can help me find some GeoJSON files that work with Vega-lite and match up to the http://Gov.uk data 🙂

noisesmith15:05:33

haha I''ll see what I can do

noisesmith15:05:59

nothing, I can do nothing, hope that helps

4
practicalli-john15:05:44

Next time you are at the Office of National Statistics, please ask them why there GeoJSON files dont work with vega 😂

Lennart Buit09:05:58

It makes it harder to understand where a function is coming from. Is it clojure.core? Is it code in my current namespace? or is it used? So people tend to prefer to add an alias, so that its immediately obvious that its coming from somewhere else. There are a few exceptions, clojure.test is usually required refer’ing all (at least on JVM). And you also have the option to refer specific functions with require.

Anthony Khong10:05:08

Hello, I’ve been stuck with this problem for a bit. Is the following possible? If so, could you please point me to the right direction? I’ve got a verbose function like:

(defn word2vec [{:keys [max-iter
step-size
window-size
max-sentence-length
num-partitions
seed
vector-size
min-count
input-col
output-col]
:or   {max-iter 1,
step-size 0.025,
window-size 5,
max-sentence-length 1000,
num-partitions 1,
seed -1961189076,
vector-size 100,
min-count 5
input-col "sentence"
output-col "features"}}]
(-> (Word2Vec.)
(.setMaxIter max-iter)
(.setStepSize step-size)
(.setWindowSize window-size)
(.setMaxSentenceLength max-sentence-length)
(.setNumPartitions num-partitions)
(.setSeed seed)
(.setVectorSize vector-size)
(.setMinCount min-count)
(.setInputCol input-col)
(.setOutputCol output-col)))
The thing is that the method name is always just the camel-case version of the arg name, and each argument is repeated four times. I feel like it should be possible to write a macro such as:
(defstage word2vec
Word2Vec
{:input-col "sentence"
:output-col "features"
:max-iter 1,
:step-size 0.025,
:window-size 5,
:max-sentence-length 1000,
:num-partitions 1,
:seed -1961189076,
:vector-size 100,
:min-count 5})
I’m stuck in the part where I’m converting the key to the camelcase method - something like:
(defmacro set-param [spark-stage k v]
(let [method (symbol (str "set" (->PascalCase (name ~k))))]
(. ~spark-stage ~method ~v)))

(def stage (Word2Vec.))
(def k :max-iter)
(set-param stage k 5) ;; throws java.lang.IllegalArgumentException
but it obviously doesn’t work! Is this the wrong approach altogether?

sroller12:05:13

@seancorfield I rather stick to the Clojure wrapper as long as possible. I avoided Java for the recent 25 years and I'd like to keep it like that 🙂. Thank you for explaining the options though. I know that I have go out to Java anyway. When I started looking into Clojure I was a bit taken back by the attitude "it's better than Java here and better than Java there". I don't care about Java ;-).

😄 4
g14:05:02

hey everyone, trying to figure out what’s going on with my setup as follows:

(with-redefs-fn [sut/a (fn [& args] (prn "hi"))]
(sut/b "test!"))
where b calls a. however, when i run this, a has its original value, namely that before it was redef’d. why isn’t it rebinding?

g14:05:48

i think i figured it out. b'

g14:05:00

is calling a through another thread, which perhaps is messing with the binding

mloughlin15:05:08

✔ 4
noisesmith15:05:00

yeah, if b creates a thread, with-redefs-fn needs to be forced to wait until b's thread finishes somehow (or you need something better than with-redefs-fn - eg. a dynamic binding wouldn't have this problem as they are shared with future threads and you can propagate them to other threads as needed)

g15:05:43

i was looking at alter-var-root .. and then attempting to set it back afterwards (this is in a test)

g15:05:57

i’d rather not change it to be dynamic just for the test

g15:05:08

but i do like that better

noisesmith15:05:51

@gtzogana you can use something similar to the cljs async wrapper for tests - which makes sure a form doesn't exit until a callback is called. You can make it yourself like this:

(let [done (promise)]
(with-redefs-fn [sut/a (fn [& args]
(deliver done true)
(prn "hi"))]
(sut/b "test!")
@done))
with-redefs-fn will not exit (and thus a will stay in place) until a tells it it's ok via done

noisesmith15:05:23

if a needs to be called n times, you need a different place to deliver to done, or a conditional deliver, but the concept stays the same

g15:05:35

oh, cool!

g15:05:39

good idea, thanks

noisesmith15:05:33

there's still a gotcha: with-redefs-fn / with-redefs are able to lose your original binding permanently if used in two threads at once

g15:05:45

do you mind explaining how this happens? i noticed it in the docs but it’s not quite clear what’s going on

noisesmith15:05:36

so, (with-redefs [f g] (body)) does the following: • save the global binding of f as f-old • set the global binding of f to g • use a finally clause so that ensures no matter what, g is replaced with f-old

noisesmith15:05:32

let's imagine two threads call with-redefs: • thread a calls (with-redefs [f g] (body)) • f is now g, a has f-old of f • thread b calls (with-redefs [f h] (body)) • f is now h, b has f-old of g • a exits, automatically setting f to f-old • b exits, automatically setting f to g • the original f no longer has any gc root, and the garbage collector deletes it permanently

noisesmith15:05:28

so by calling with-redefs twice, you permanently lose the original value (if thread a exits before thread b, and their execution overlaps)

noisesmith15:05:16

classic race condition

g15:05:35

oh that is funky. thank you for the explanation!

noisesmith15:05:55

most test suites will never do this, but consider that this usage ensures your tests can't correctly be run concurrently

with-redefs is a strong signal that your code is missing an argument

g15:05:32

to clarify, i’m using it to inject artificial latency

g15:05:22

how so?

Johnson15:05:44

Hey, was hoping to get some help. I'm trying to use the react-particles-js library with a reagent/re-frame project, I can get it to display, but the interactivity/hover isn't working. Was wondering if there is something glaringly obvious I'd missed, pretty new to this. This is the element in question:

[:> Particles
{:particles {:number {:value 200
:density {:enable true
:value_area 1000}}}
;; This bit doesn't work:
:interactivity {:detect_on "canvas"
:events {:onhover {:enable true
:mode "repluse"}}}]

Johnson15:05:05

noisesmith15:05:18

I bet #clojurescript or #reagent is more likely to have your answer

Johnson15:05:15

Okay thanks 🙂

Michael W16:05:52

What is :cljsrn I see in some cljc files on github? And how is that different from :cljs?

Sanghyun Lee16:05:09

Hello, I have a question about Cursive and Clojure test. When I def inside a deftest the IDE says the variable cannot be resolved. How could I prevent this warning? Thanks.

Patrick Farwick16:05:56

hey @hammerha, I am pretty new, but I have never seen a def defined in a defn or deftest

noisesmith16:05:13

@hammerha def is for making namespace scope definitions, if you want something to use inside ns-test use let

noisesmith16:05:50

def there will work - sometimes - but it means every time the test runs the definition changes and all tests can see the definition, probably not what you were aiming for

noisesmith16:05:24

(deftest ns-test (let [abc 1] (is (= ....)))

Sanghyun Lee16:05:37

great, thanks a lot for the answer @patrick.farwick @noisesmith!

michaelb20:05:02

if I want to work with paths in a cross-platform manner in Clojure, what is roughly the equivalent of Node.js path module?

java.nio.file.Path

pretty much every project I write has:

(defn path [s & ss]
(java.nio.file.Path/of s (into-array String ss)))

seancorfield20:05:12

? 🙂 In response to path? 🙂

alexmiller20:05:28

in response to making functions to work with Path

seancorfield20:05:47

Ah, yeah, the whole cross-platform file pathing nightmare...

alexmiller20:05:08

seems like I spent most of this week converting between Files and Paths :)

seancorfield20:05:29

And that sometimes on Windows you get c:\path\to\file.ext and other times you get /c:/path/to/file.ext 🤯

alexmiller20:05:46

yeah, it's a minefield

seancorfield20:05:49

(I'd never seen the latter until recently)

Lennart Buit20:05:43

Anecdote: My very first programming project on university (a board game) had a bug with file paths, leading it not to be able to load taunts.txt, which it considered fatal and therefore terminated. I think it was tripping on spaces or something, but yeah, not a very beginner friendly API :’)

seancorfield20:05:22

Also, on Windows, some of the APIs treat certain filenames as reserved (try using con.clj with the File stuff 🙂 -- or prn.txt, nul.jpg, etc...)

Lennart Buit20:05:20

oh yeah, they had special meaning in dos, right?

phronmophobic20:05:41

i’ve always just worked with .Files directly via . is there a reason to prefer Path?

seancorfield20:05:53

Yup, see https://github.com/seancorfield/depstar/issues/8#issuecomment-489873152 which was the bug report against an early version of depstar that had that problem!

alexmiller20:05:57

there's a lot of interesting stuff in java.nio that depends on Path

phronmophobic20:05:15

I skimmed through the bug, but I can’t figure out how Path vs File figures in?

seancorfield20:05:03

@U7RJTCH6J I was responding to @UDF11HLKC not you 🙂

😳 4
seancorfield20:05:42

@U7RJTCH6J This article talks about the new-in-Java 7 nio stuff https://www.oreilly.com/content/java7-features/ (starts halfway down).

👍 4
alexmiller20:05:56

the main thing that kind of blew mind a little is that java 7 has both glob and regex file path matching built in since Java 7

alexmiller21:05:23

it's a pain in the ass to use well, admittedly

sorry to trigger you @U064X3EF3

alexmiller21:05:40

no worries :)

I'm packaging a jar using uberjar, and getting this error when I run the resulting jar file

Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.Util.loadWithClass(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
at inspect.core.<clinit>(Unknown Source)
When running
java -jar target/inspect.jar
has anyone got any ideas on how to debug?

dorab22:05:44

How are you creating the uberjar?

using the following steps:

mkdir classes
clj -e "(compile 'inspect.core)"
clojure -A:uberjar --main-class inspect.core
java -jar target/inspect.jar
Taken from https://github.com/tonsky/uberdeps#creating-an-executable-jar

noisesmith23:05:17

oh, you aren't using lein, deleting my message

ah yeah I should have written uberdeps not uberjar when explaining my problem

noisesmith23:05:51

did you miss the step where you add classes to your paths?

my deps.edn looks like

{:paths ["src" "classes"]
:deps {org.eclipse.lsp4j/org.eclipse.lsp4j {:mvn/version "0.8.1"}
org.clojure/tools.nrepl {:mvn/version "0.2.13"}}
:aliases {:uberjar {:deps {uberdeps {:mvn/version "0.1.10"}}
:main-opts ["-m" "uberdeps.uberjar"]}}}

noisesmith23:05:20

I've found depstar painless, it does what I want and even lets me use clojure.main as my entry point (pointing at my main ns) instead of having to aot compile

hiredman23:05:51

try delete all the files in classes

hiredman23:05:11

you also don't specify a clojure version in your deps

hiredman23:05:55

so it looks like you are compiling with one version, but what is getting packaged in the uberjar is another (older version)

yeah that looks like it's working thank you, I'll checkout depstar at some point too seems like less steps generally

I always get confused about when to add Clojure as a dependency in deps

ah ok my kinda rule

seancorfield23:05:32

@sfyire If it helps in the future, if you use clj-new to create new projects, they automatically have built-in aliases to create JAR or uberjar files, and know how to deploy to Clojars etc.

seancorfield23:05:53

https://github.com/seancorfield/clj-new -- the app and lib projects it generates use (my fork of) depstar to produce uberjars (with AOT compilation etc) and thin JARs respectively. They also have :test and :runner aliases to run your tests etc.

@sfyire Feel free to hit me up via DM if you have any questions about clj-new or depstar -- or anything in my dot-clojure repo (which is full of "interesting" stuff to add to your ~/.clojure/deps.edn file 🙂 )


text:
Criteria making software useful long-term & worth learning in detail (Haskell, predictions)
created: 26 Sep 2008; modified: 01 Dec 2013; status: in progress; belief: possible

It’s not always clear what software to pick in the open source world.

For some tasks, the choice is easy since there’s one dominating player - for web browsing you will almost certainly want to go with Mozilla Firefox when in X.org, and ELinks when on the command-line.

But with other applications, the array of choices is quite astounding. For an editor, Vim or Emacs or… For a shell, do you use Bash, Fish, Zsh, Tcsh, Ksh, or what? Each option has many complex pros and cons, and often partisans have strong feelings about the issues.

Myself? I’ve found it useful to try and classify all the options by a few considerations. Since we’re interested in Unix applications, one can safely say that we’re all “power users” and are interested in the best we can get. So the first desiderata is that:

# Maintenance

• It should be maintained.

Life is too short to waste dealing with unmaintained software. Such software is probably already ridden with bit rot, and it may well have been abandoned for a reason.

The point of a program is to make something easier or to do something you could not do before; programs are generally hard enough to use as it is, and a package being unmaintained almost guarantees that you will spend more time on it than an equivalent maintained package. There are usually plenty of choices, so go use one of them.

A commitment to maintenance is also a useful thing. Take GNU Emacs, or the GNU command line utilities in general. There are quite a few of them, they are complex and powerful, and take a while to learn. To profitably use them, you will need to invest time - I had learned enough about the Coreutils to use them comfortably within a few months, and GNU Emacs took about half a year to really learn to any satisfactory degree. Other alternatives like ‘nano’ would have taken less time to learn, but the GNU tools offered me more power.

More importantly, the whole reason I was willing to spend so much time learning Emacs was because Emacs has a history. It was begun in 1984 and has been in constant development in the more than 2 decades since. It is likely to continue to be developed for decades (if only by the Doomsday Argument) by the same gnarled old hackers who wrote it originally.

Even better, it has the institutional support of being the GNU Project’s official text editor. In other words, learning Emacs is indeed a steep price to pay but that’s alright since it is entirely plausible that you could be using it for the rest of your computing life. Six months of not particularly productive text editing may sound like a lot, but when set against 20 or 30 years of use, the productivity gains seem worthwhile.

Being maintained is just the most basic criterion though, and many tools will meet that basic level. Unmaintained projects tend to be forgotten, and you usually won’t see them discussed in lists of projects, so in a sense you can just assume tools are maintained. The second, more difficult feature is:

# Extensible

• It should be extensible.

There are very few tools which you will want to use, now and forever, exactly the way they come. Even a command as humble as ‘cat’ nevertheless has >9 options! For something as complex as a browser or text editor, you will want to customize and most probably extend it. Rather than using nasty hacks to get around this fact, just use a tool which can at least be scripted.

• However, scripting isn’t always the best way. Probably the best way is the Emacs-style program architecture1: a simple, efficient, and performant core which supports a panoply of extensions - the sum of which is the application. If the bulk of the application is being written as extensions, you get numerous benefits which include:
1. Modularity; and the ability to disable whatever you do not need (with attendant benefits in performance, reliability, and security)
2. Ease of extension. Obviously, since the developers would have striven to make the large body of code - which they will spend most of their time editing - clean and easy to change. If you have to do everything in Perl or Emacs Lisp, for example, you are obviously going to have nice libraries and features to use. These features and libraries will also be available to you.
3. Portability. The small core is all that needs to be ported, sometimes. Portability is always a good thing.
4. Features. Emacs contains the proverbial kitchen sink; Irssi has more extensions and skins than I can count; and Firefox has precisely 2.89 million add-ons. If users can add features without waiting for the official developers and release cycles, they will. And odds are pretty good they may have already done exactly what you needed, or solved a need you didn’t even realize you had.

It’s lovely to be able to make use of other people’s extensions in your shiny new toy, but do you know what to do with it now? Obviously:

# Comprehensibility

• You should be able to understand it.

This is a valuable property for a number of reasons also. An example I like to use is the XMonad tiled windowing manager for X. Before, I had used Ratpoison and StumpWM, but I was never really satisfied because I didn’t understand C or Common Lisp so many things were and remained a mystery to me. This made extending them, debugging them, even just reading the documentation to use them - it made them all more difficult than they had to be.

With XMonad, I understand most of it. I see how the extensions work, and have written my own. The imperfect mirror of the documentation does not confuse, as I can easily turn to the code which is the ultimate documentation. This point ties into the first and second points. If you understand the code and the architecture, then you are in a much better position to extend it, and potentially maintain it.

This goes back to the first point; you should never need to maintain it, but given your investment in it, you may want to and it’s better to be able to maintain it to the degree you need it to function - sometimes maintenance is just a matter of updating a few files or the packaging system.

# Popularity

• Try to use standard stuff.

For example, Bash is by all the former criterion a good choice for one’s shell. It is maintained by the GNU Project, it is certainly extensible and powerful, and it’s relatively understandable. But the really nice thing about Bash is how very standard it is: every Linux distribution includes Bash, and even set it as the default shell.

And if an operating system doesn’t run Bash as default, it is basically guaranteed that Bash will run on it (or there will at least be shells with Bash-compatibility). This is an advantage you should not underestimate. Because of this ubiquity, there are powerful network effects operating in favor of Bash guaranteeing that it will be useful for you for a very long time. Standard means you will be able to get your hands on it, standard means there will be documentation and people working to solve bugs and other people taking advantage of the extensibility, and so on. Standard means that new implementations and forks are that much easier. Standard means many things, but from a user’s perspective, standard is generally a good thing for software and languages to be.

The final major consideration was left to last. It should come as no surprise to modern programmer - sinfully awash amongst high-level garbage-collected interpreted languages as they are - that the least important factor to consider is the level of:

# Efficiency

• efficiency of a program.

This is the final concern because applications spend little time doing inefficient things. The rationale here is that, perhaps Emacs may be somewhat slower than a less capable or portable editor - but you will not save so much time on quicker screen updates &etc. as to make up for real hours lost in porting the other editor or working around its lack of features (see Amdahl’s Law).

There are other concerns here: it is easier to make an extensible/powerful/portable editor more efficient in the bottlenecks than it is to hack in those features to an efficient editor never intended for those features2. But if you are truly faced with two choices - each of whom seems equally solidly maintained, extensible, standard, etc. - then go with the more efficient one. After all, efficiency is a virtue and does make the experience more pleasant and gives you the option of using it on slower computers.

Alas, just marking down these features doesn’t solve every problem. For example, choosing between Vim and Emacs was easy for me - Vim’s supposed efficiency didn’t (in my reckoning) outweigh the increased standardness and comprehensibility of Emacs. Or take Bash compared with Zsh. Bash is clearly more standard and is clearly better maintained, being even older than Zsh and the official shell of the GNU Project, and it is probably marginally more efficient. But I nevertheless chose to switch to Zsh.

Why? I just liked it better. It has more features, yes (but not significantly more); it has Bash compatibility (sure, but not as good as the real thing); it makes my configuration files cleaner and easier to maintain, sure (but they were difficult to convert, and are now no longer quite so portable). Basically every point adumbrated argues strongly for Bash and at best, weakly for Zsh. But I liked it better, and in the end that matters.

# Short configurations

What other things should we keep in mind? Well, as time passes, I’ve found configuration files tend to grow. A good thing to do when a configuration file has grown particularly elaborate is to simplify it.

Slim it done, remove everything you haven’t needed in the last several months. If you still have a huge file, see whether a large chunk of it makes sense to split out.

For example, for the Zsh I have: ~/.zshenv, for environmental variables and shell settings that all Zsh invocations need; ~/.zaliases, hand-written aliases and functions; ~/.ztypos, containing all aliases automatically written to correct typographical errors I have made in the past; ~/.zlogout and ~/.zprofile, for logout/login stuff; and finally, ~/.zshrc, which contains everything needed for pleasant interactive use. Clearly it’d be absurd and extremely awkward to stuff all of that into a single file, as well as potentially slow.

But suppose you have removed cruft, written stuff as well and concisely as you could, and split files out, and you still have too much? Now it comes time to give back to the free software community. Consider carefully your settings: perhaps they are very common and you could file a bug suggesting they be made the default? That would then be a line you could remove. Or perhaps you have on your hands a de facto useful extension to the program you could package up and offer online somewhere, or even offer to the developers as something to add to all the other extensions included by default.

# Take one, leave one

There is one last piece of advice:

• For every new tree planted, let one be uprooted.

This is a good rule to follow with all possessions. If you buy a new pair of shoes, give away or junk the old pair which you no longer need or can use. If you purchase a new book, sell or donate that old one you will never read again. If you add one program to your system, try to remove another - perhaps one you never used, or perhaps one made redundant by the new one. If you install ELinks, remove Lynx.

Redundancy wastes resources, it imposes mental burdens, it increases inertia and resistance to change. The more stuff you have that you do not need, the stupider your possessions get. If you have a room bursting at the gills: you cannot freely travel. You cannot easily change your place of residence. You are no longer sure what do you and do not have, you are increasingly mentally stressed. You literally can no longer freely move about. In extreme cases, people have been known to die because they refused to let go of things3.

Try to keep matters elegant and uncluttered. There is a difference between elegance and competence - and this difference makes all the difference in the world.

1. For my purposes, the many variants such as the XMonad model are immaterial. Yes, it is a very interesting model (the program compiles a fresh binary with the user’s new config hardwired in, serializes out the current global state, and restarts itself with the new binary and passes it the serialized state) - but the details of how the extensibility is accomplished are only important if the method is crappy and unreliable.

2. As a bigoted Emacs user, I of course see Vim as the classic example of attempting to shoehorn in a feature like a first-class extension language - with humorous results!

3. Often due to mental disease; see Pathological hoarding

format: plain


text: Bohr's model of the hydrogen atom is based on three postulates: (1) an electron moves around the nucleus in a circular orbit, (2) an electron's angular momentum in the orbit is quantized, and (3) the change in an electron's energy as it makes a quantum jump from one orbit to another is always accompanied by the 0.0 (0 votes) Log in to add comment For an Integrated Concept problem, we must first identify the physical principles involved. Run using Java. Niels Bohr, Danish physicist, used the planetary model of the atom to explain the atomic spectrum and size of the hydrogen atom. The allowed electron orbits in hydrogen have the radii shown. In 1913, the Danish physicist Niels Bohr (1885 - 1962) managed to explain the spectrum of atomic hydrogen by an extension of Rutherford's description of the atom. His first proposal is that only certain orbits are allowed: we say that the orbits of electrons in atoms are quantized. Angular momentum is quantized. Solving for d and entering known values yields, $\displaystyle{d}=\frac{\left(1\right)\left(486\text{ nm}\right)}{\sin15^{\circ}}=1.88\times10^{-6}\text{ m}\\$. In equation form, this is ΔE = hf = Ei − Ef. The Bohr Model considers electrons to have both a known radius and orbit, which is impossible according to Heisenberg. Bohr Model of the hydrogen atom attempts to plug in certain gaps as suggested by Rutherford’s model. Figure 7. Bohr’s model of the hydrogen atom, proposed by Niels Bohr in 1913, was the first quantum model that correctly explained the hydrogen emission spectrum. And nature agreed with Niels Bohr. This condition was expressed by the equation d sin θ = mλ, where d is the distance between slits and θ is the angle from the original direction of the beam. Bohr did not explain why, he just proposed a new law of nature. Do the Balmer and Lyman series overlap? Bohr model of the atom was proposed by Neil Bohr in 1915. A theory of the atom or any other system must predict its energies based on the physics of the system. The various series are those where the transitions end on a certain level. Figure 5 shows an energy-level diagram, a convenient way to display energy states. 1. Lines in the spectrum were due to transitions in which an electron moved from a higher-energy orbit with a larger radius to a lower-energy orbit with smaller radius. Inadequacies of Bohr’s atomic model The most important defects o f Bohr’s theory : It failed to explain the spectrum of any other element , except hydrogen atom , as it is considered the simplest electronic system which contains one electron only , even that of the helium atom contain only 2 electrons . For the Lyman series, nf = 1; for the Balmer series, nf = 2; for the Paschen series, nf = 3; and so on. Show that the entire Paschen series is in the infrared part of the spectrum. Each orbit has a different energy, and electrons can move to a higher orbit by absorbing energy and drop to a lower orbit by emitting energy. It is because the energy levels are proportional to $\frac{1}{n^2}\\$, where n is a non-negative integer. To do this, you only need to calculate the shortest wavelength in the series. These are major triumphs. To log in and use all the features of Khan Academy, please enable JavaScript in your browser. Bohrs model is based on some assumptions: Electron of a hydrogen atom travels around the nucleus in a circular path or orbit, i.e. (Figure 1). and only one electron, that atom is called a hydrogen-like atom. Circular orbits are formed in special conditions only when major axis and minor axis of … Figure 2. Class 11 Limitations of Bohr’s theory. From their sizes to their spectra, much was known about atoms, but little had been explained in terms of the laws of physics. Describe Rydberg's theory for the hydrogen spectra. When the electron moves from one allowed orbit to another it emits or absorbs photons of … From the equation $\displaystyle{m}_{e}{vr}_{n}=n\frac{h}{2\pi}\\$, we can substitute for the velocity, giving: $\displaystyle{r}_{n}=\frac{{\text{kZq}}_{e}^{2}}{{m}_{e}}\cdot \frac{{4\pi }^{2}{m}_{e}^{2}{r}_{n}^{2}}{{n}^{2}{h}^{2}}\\$. The tacit assumption here is that the nucleus is more massive than the stationary electron, and the electron orbits about it. (See Figure 4.). Imagine an atomic nucleus: Around it is an electron wave in orbit: This wave has to exactly fit to get a smooth orbit. Merits of Bohr’s theory : Each orbit corresponds, to a certain energy level. Bohr’s model is what we call semiclassical. To obtain constructive interference for a double slit, the path length difference from two slits must be an integral multiple of the wavelength. Electron total energies are negative, since the electron is bound to the nucleus, analogous to being in a hole without enough kinetic energy to escape. For decades, many questions had been asked about atomic characteristics. Values of nf and ni are shown for some of the lines. $\begin{array}{lll}{a}_{\text{B}}&=&\frac{{h}^{2}}{{4\pi }^{2}{m}_{e}{\text{kZq}}_{e}^{2}}\\\text{ }&=&\frac{\left(\text{6.626}\times {\text{10}}^{-\text{34}}\text{J }\cdot\text{ s}\right)^{2}}{{4\pi }^{2}\left(9.109\times {\text{10}}^{-\text{31}}\text{kg}\right)\left(8.988\times {\text{10}}^{9}\text{N}\cdot{\text{m}}^{2}/{C}^{2}\right)\left(1\right)\left(1.602\times {\text{10}}^{-\text{19}}\text{C}\right)^{2}}\\\text{ }&=&\text{0.529}\times {\text{10}}^{-\text{10}}\text{m}\end{array}\\$. Niels Bohr introduced the atomic Hydrogen model in the year 1913. Thus, we have used Bohr’s assumptions to derive the formula first proposed by Balmer years earlier as a recipe to fit experimental data. The hydrogen atom is said to be stable when the electron present in it revolves around the nucleus in the first orbit having the principal quantum number n = 1. The hydrogen atom is said to be stable when the electron present in it revolves around the nucleus in the first orbit having the principal quantum number n = 1. So, if a nucleus has Z protons (Z = 1 for hydrogen, 2 for helium, etc.) A blast of energy is required for the space shuttle, for example, to climb to a higher orbit. (credit: Unknown Author, via Wikimedia Commons). 1)Inability to explain line spectra of multi-electron atom:When spectroscope with better resolving power were used, it was found that even in case of hydrogen spectrum, each line was split up into a number of closely spaced lines which could not be explained by Bohr’s model of an atom. The electrons do not spiral into the nucleus, as expected classically (accelerated charges radiate, so that the electron orbits classically would decay quickly, and the electrons would sit on the nucleus—matter would collapse). Each orbit has a different energy, and electrons can move to a higher orbit by absorbing energy and drop to a lower orbit by emitting energy. Energy is plotted vertically with the lowest or ground state at the bottom and with excited states above. The development of Spectroscopy and gas discharge tubes enabled physicists in the second half of the 19th Century to analyze the spectrum of various gases, particularly that of Hydrogen gas. The observed hydrogen-spectrum wavelengths can be calculated using the following formula: $\displaystyle\frac{1}{\lambda}=R\left(\frac{1}{n_{\text{f}}^2}-\frac{1}{n_{\text{i}}^2}\right)\\$. That is, equate the Coulomb and centripetal forces and then insert an expression for velocity from the condition for angular momentum quantization. This is indeed the experimentally observed wavelength, corresponding to the second (blue-green) line in the Balmer series. The energies of the photons are quantized, and their energy is explained as being equal to the change in energy of the electron when it moves from one orbit to another. Illustrate energy state using the energy-level diagram. Energy-level diagrams are used for many systems, including molecules and nuclei. (credit for (b): Yttrium91, Wikimedia Commons). Bohr described the hydrogen atom in terms of an electron moving in a circular orbit about a nucleus. Light: Electromagnetic waves, the electromagnetic spectrum and photons, Spectroscopy: Interaction of light and matter, Bohr model radii (derivation using physics), Bohr model energy levels (derivation using physics). theory of quantized energies for the electron in the hy- drogen atom. This was an important first step that has been improved upon, but it is well worth repeating here, because it does correctly describe many characteristics of hydrogen. Interpret the hydrogen spectrum in terms of the energy states of electrons. An electron may jump spontaneously from one orbit (energy level E1) to the other […] hydrogen spectrum wavelengths: the wavelengths of visible light from hydrogen; can be calculated by, $\displaystyle\frac{1}{\lambda }=R\left(\frac{1}{{n}_{\text{f}}^{2}}-\frac{1}{{n}_{\text{i}}^{2}}\right)\\$, Rydberg constant: a physical constant related to the atomic spectra with an established value of 1.097 × 107 m−1, double-slit interference: an experiment in which waves or particles from a single source impinge upon two slits so that the resulting interference pattern may be observed, energy-level diagram: a diagram used to analyze the energy level of electrons in the orbits of an atom, Bohr radius: the mean radius of the orbit of an electron around the nucleus of a hydrogen atom in its ground state, hydrogen-like atom: any atom with only a single electron, energies of hydrogen-like atoms: Bohr formula for energies of electron states in hydrogen-like atoms: ${E}_{n}=-\frac{{Z}^{2}}{{n}^{2}}{E}_{0}\left(n=\text{1, 2, 3,}\dots \right)\\$, 1. We shall examine many of these aspects of quantum mechanics in more detail, but it should be kept in mind that Bohr did not fail. In some cases, it had been possible to devise formulas that described the emission spectra. In that model, the negatively charged electrons revolve about the positively charged atomic nucleus because of the attractive electrostatic force according to Coulomb's law.. An atom has a number of stable orbits in which an electron can reside without the emission of radiant energy. Bohr was the first to comprehend the deeper meaning. Given more energy, the electron becomes unbound with some kinetic energy. Hydrogen spectrum wavelength. Explain how Bohr’s rule for the quantization of electron orbital angular momentum differs from the actual rule. Balmer first devised the formula for his series alone, and it was later found to describe all the other series by using different values of nf. How Bohr's model of hydrogen explains atomic emission spectra. where λ is the wavelength of the emitted EM radiation and R is the Rydberg constant, determined by the experiment to be R = 1.097 × 107 / m (or m−1). More impressive is the fact that the same simple recipe predicts all of the hydrogen spectrum lines, including new ones observed in subsequent experiments. Explain how the correspondence principle applies here. Explain Bohr’s planetary model of the atom. One such ion is C. Verify Equations ${r}_{n}=\frac{{n}^{2}}{Z}{a}_{\text{B}}\\$ and ${a}_{B}=\frac{{h}^{2}}{{4\pi }^{2}{m}_{e}{kq}_{e}^{2}}=0.529\times{10}^{-10}\text{ m}\\$ using the approach stated in the text. }\text{22}\times {\text{10}}^{-7}\text{m}=\text{122 nm}\\[/latex] , which is UV radiation. According to Rutherford’s model, an atom has a central nucleus and electron/s revolve around it like the sun-planet system. Bohr’s theory explained the atomic spectrum of hydrogen and established new and broadly applicable principles in quantum mechanics. The wavelength of the four Balmer series lines for hydrogen are found to be 410.3, 434.2, 486.3, and 656.5 nm. For a small object at a radius r, I = mr2 and $\omega=\frac{v}{r}\\$, so that $L=\left(mr^2\right)\frac{v}{r}=mvr\\$. The first was that Bohr’s atomic model could not explain the many lines present in the spectra of elements with more than one electron. E (n)=-\dfrac {1} {n^2} \cdot 13.6\,\text {eV} E (n) = −n21. Rutherford’s model introduced the nuclear model of an atom, in which he explained that a nucleus (positively charged) is surrounded by negatively charged electrons. Here, E0 is the ground-state energy (n = 1) for hydrogen (Z = 1) and is given by, $\displaystyle{E}_{0}=\frac{2\pi{q}_{e}^{4}m_{e}k^{2}}{h^2}=13.6\text{ eV}\\$, $\displaystyle{E}_n=-\frac{13.6\text{ eV}}{n^2}\left(n=1,2,3\dots\right)\\$. Bohr proposed a model for the hydrogen atom that explained the spectrum of a hydrogen atom. Bohr had calculated Rydberg constant from the above equation. It doesn’t explain about the energy of an atom and its stability. If the orbits are quantized, the amount of energy absorbed or emitted is also quantized, producing discret… Thus, Bohr’s theory elegantly explains the line spectrum of hydrogen and hydrogen species. Donate or volunteer today! Niels Bohr, Danish physicist, used the planetary model of the atom to explain the atomic spectrum and size of the hydrogen atom. Following Einstein’s proposal of photons with quantized energies directly proportional to their wavelengths, it became even more evident that electrons in atoms can exist only in discrete orbits. The magnitude of the centripetal force is $\frac{m_{e}v^2}{r_n}\\$, while the Coulomb force is $k\frac{\left(Zq_{e}\right)\left(q_e\right)}{r_n^2}\\$. AP® is a registered trademark of the College Board, which has not reviewed this resource. (c) How many are in the UV? ADVERTISEMENTS: 2. the conditions for an interference maximum for the pattern from a double slit, The planetary model of the atom pictures electrons orbiting the nucleus in the way that planets orbit the sun. His many contributions to the development of atomic physics and quantum mechanics, his personal influence on many students and colleagues, and his personal integrity, especially in the face of Nazi oppression, earned him a prominent place in history. $\displaystyle{a}_{\text{B}}=\frac{{h}^{2}}{{4\pi }^{2}{m}_{e}{\text{kq}}_{e}^{2}}\\$. The first line in the series is taken to be for ni = 3, and so the second would have ni = 4. Bohr postulated that as long an electron remains in a particular orbit it does not emit radiation i.e. Electron orbital energies are quantized in all atoms and molecules. For the Lyman series, nf = 1—that is, all the transitions end in the ground state (see also Figure 7). These elements include all the elements after hydrogen on the periodic table. For example, giving 15.0 eV to an electron in the ground state of hydrogen strips it from the atom and leaves it with 1.4 eV of kinetic energy. How Bohr explanation of the hydrogen line emission spectrum led to the quantum mechanical model of the atom posted on May 8, 2019 A spectrum is the ‘picture’ you get when light interacts with atoms or molecules. The Bohr Theory gives accurate values for the energy levels in hydrogen-like atoms, but it has been improved upon in several respects. Quantization says that this value of mvr can only be equal to $\frac{h}{2},\frac{2h}{2},\frac{3h}{2}\\$, etc. $\displaystyle\lambda =\left(\frac{m}{1.097\times {\text{10}}^{7}}\right)\left[\frac{\left(2\times1\right)^{2}}{{2}^{2}-{1}^{2}}\right]=1\text{. (a) Which line in the Balmer series is the first one in the UV part of the spectrum? How do the allowed orbits for electrons in atoms differ from the allowed orbits for planets around the sun? The origin of spectral lines in the hydrogen atom (Hydrogen Spectrum) can be explained on the basis of Bohr’s theory. His first proposal is that only certain orbits are allowed: we say that the orbits of electrons in atoms are quantized. Check how the prediction of the model matches the experimental results. To answer this, calculate the shortest-wavelength Balmer line and the longest-wavelength Lyman line. Potential energy for the electron is electrical, or PE = qeV, where V is the potential due to the nucleus, which looks like a point charge. The atomic spectrum of hydrogen was explained due to the concept of definite energy levels. Bohr’s theory explained the atomic spectrum of hydrogen and established new and broadly applicable principles in quantum mechanics. It is in violation of the Heisenberg Uncertainty Principle. But here it goes. This corresponds to a free electron with no kinetic energy, since rn gets very large for large n, and the electric potential energy thus becomes zero. Figure 1. The constant ni is a positive integer, but it must be greater than nf. In each case of this kind, Bohr’s prediction of the spectrum was correct. Is it in the visible part of the spectrum? The line spectrum for each element is unique, providing a powerful and much used analytical tool, and many line spectra were well known for many years before they could be explained with physics. Further application of Bohr’s work was made, to other electron species (Hydrogenic ion) such as He + and Li 2+. Figure 30.14 Niels Bohr, Danish physicist, used the planetary model of the atom to explain the atomic spectrum and size of the hydrogen atom. It was preceded by the Rutherford nuclear model of the atom. The lowest orbit has the experimentally verified diameter of a hydrogen atom. Maxwell and others had realized that there must be a connection between the spectrum of an atom and its structure, something like the resonant frequencies of musical instruments. Equating these. For the Balmer series, nf = 2, or all the transitions end in the first excited state; and so on. Science > Physics > Atoms, Molecule, and Nuclei > Hydrogen Spectrum The origin of spectral lines in the hydrogen atom (Hydrogen Spectrum) can be explained on the basis of Bohr’s theory. It cannot be applied to multielectron atoms, even one as simple as a two-electron helium atom. A downward transition releases energy, and so ni must be greater than nf. Thus, for the Balmer series, nf = 2 and ni = 3, 4, 5, 6, …. However, it has several limitations. Each orbit corresponds, to a certain energy level. [latex]\displaystyle{r}_{n}=\frac{{n}^{2}}{Z}\frac{{h}^{2}}{{4\pi }^{2}{m}_{e}{\text{kq}}_{e}^{2}}=\frac{{n}^{2}}{Z}{a}_{\text{B}}\\$. Angular momentum quantization is stated in an earlier equation. $k\frac{Zq_{e}^2}{r_n^2}=\frac{m_{e}v^2}{r_n}\text{ (Coulomb = centripetal)}\\$. Thus, 13.6 eV is needed to ionize hydrogen (to go from –13.6 eV to 0, or unbound), an experimentally verified number. Bohr's atomic model explained successfully: The stability of an atom. We see that Bohr’s theory of the hydrogen atom answers the question as to why this previously known formula describes the hydrogen spectrum. (b) How many Balmer series lines are in the visible part of the spectrum? Entering the expressions for KE and PE, we find. Since the electron’s charge is negative, we see that $PE=-\frac{kZq_e}{r_n}\\$. This is likewise true for atomic absorption of photons. What is a hydrogen-like atom, and how are the energies and radii of its electron orbits related to those in hydrogen? It came into existence with the modification of Rutherford’s model of an atom. As n approaches infinity, the total energy becomes zero. The Balmer series requires that nf = 2. Hence it does not become unstable. (See Figure 2.) Note that angular momentum is L = Iω. It is quite logical (that is, expected from our everyday experience) that energy is involved in changing orbits. The constant nf is a positive integer associated with a specific series. These last two equations can be used to calculate the radii of the allowed (quantized) electron orbits in any hydrogen-like atom. 3 Explain how the existence of line spectra is consistent with Bohr's. Bohr’s theory was able to explain successfully a number of experimental observations and has correctly predicted the spectral lines of the hydrogen atom. If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. Show that $\frac{\left(13.6 \text{eV}\right)}{hc}=1.097\times10^{7}\text{ m}=R\\$ (Rydberg’s constant), as discussed in the text. The orbital energies are calculated using the above equation, first derived by Bohr. The atomic spectrum of hydrogen was explained due to the concept of definite energy levels. What is nature telling us? It is impressive that the formula gives the correct size of hydrogen, which is measured experimentally to be very close to the Bohr radius. Figure 6. Previous Next. The Bohr Model of the Atom . The Lyman series is entirely in the UV, while part of the Balmer series is visible with the remainder UV. This yields: $\displaystyle{r}_{n}=\frac{n^2}{Z}a_{\text{B}},\text{ for allowed orbits }\left(n=1,2,3\dots\right)\\$, where aB is defined to be the Bohr radius, since for the lowest orbit (n = 1) and for hydrogen (Z = 1), r1 = aB. The discrete lines imply quantized energy states for the atoms that produce them. The Bohr Model was an important step in the development of atomic theory. The first person to realize that white light was made up of the colors of the rainbow was Isaac Newton, who in 1666 passed sunlight through a narrow slit, then a prism, to project the colored spectrum on to a wall. Describe the triumphs and limits of Bohr’s theory. Bohr used the planetary model to develop the first reasonable theory of hydrogen, the simplest atom. Experimentally, the spectra were well established, an equation was found to fit the experimental data, but the theoretical foundation was missing. The hydrogen spectrum had been observed in the infrared (IR), visible, and ultraviolet (UV), and several series of spectral lines had been observed. While the formula in the wavelengths equation was just a recipe designed to fit data and was not based on physical principles, it did imply a deeper meaning. Bohr – Sommerfeld’s model. Bohr’s theory of atomic model was quite successful in explaining the stability of the atom and the line spectrum of a hydrogen atom. $\displaystyle\frac{1}{\lambda}=R\left(\frac{1}{n_{\text{f}}^2}-\frac{1}{n_{\text{i}}^2}\right)\\$. Find the wavelength of the third line in the Lyman series, and identify the type of EM radiation. From Bohr’s assumptions, we will now derive a number of important properties of the hydrogen atom from the classical physics we have covered in the text. Limitations of Bohr’s model of atom. Bohr's model of hydrogen is based on the nonclassical assumption that electrons travel in specific shells, or orbits, around the nucleus. Atom, origin of spectra Bohr's theory of hydrogen atom 1. Bohr was able to derive the formula for the hydrogen spectrum using basic physics, the planetary model of the atom, and some very important new proposals. The most serious drawback of the model is that it is based on two conflicting concepts. But, in spite of years of efforts by many great minds, no one had a workable theory. Rather, he made very important steps along the path to greater knowledge and laid the foundation for all of atomic physics that has since evolved. By calculating its wavelength, show that the first line in the Lyman series is UV radiation. CHAPTER 32 : BOHR'S THEORY OF HYDROGEN ATOM AND ITS SPECTRUM. Energy-level diagram for hydrogen showing the Lyman, Balmer, and Paschen series of transitions. The atom model of Bohr is of historic interest, modern models work a bit different. (See Figure 3.) Again, we see the interplay between experiment and theory in physics. Bohr postulated that in an atom, electron/s could revolve in stable orbits without emitting radiant energy. Click to download the simulation. We solve that equation for v, substitute it into the above, and rearrange the expression to obtain the radius of the orbit. Part (a) shows, from left to right, a discharge tube, slit, and diffraction grating producing a line spectrum. We start by noting the centripetal force causing the electron to follow a circular path is supplied by the Coulomb force. As quantum mechanics was developed, it became clear that there are no well-defined orbits; rather, there are clouds of probability. (It was a running joke that any theory of atomic and molecular spectra could be destroyed by throwing a book of data at it, so complex were the spectra.) The hydrogen atom is said to be stable when the electron present in it revolves around the nucleus in the first orbit having the principal quantum number n = 1. Bohr’s theory also did not explain that some spectral lines are doublets (split into two) when examined closely. The Bohr model of hydrogen was the first model of atomic structure to correctly explain the radiation spectra of atomic hydrogen. Substituting En = (–13.6 eV/n2), we see that, $\displaystyle{hf}=\left(13.6\text{ eV}\right)\left(\frac{1}{n_{\text{f}}^2}-\frac{1}{n_{\text{i}}^2}\right)\\$. Niels Bohr explained the line spectrum of the hydrogen atom by assuming that the electron moved in circular orbits and that orbits with only certain radii were allowed. The spectra of hydrogen-like ions are similar to hydrogen, but shifted to higher energy by the greater attractive force between the electron and nucleus. ADVERTISEMENTS: Bohr’s Postulates or Bohr’s Model of the Hydrogen Atom! Photon absorption and emission are among the primary methods of transferring energy into and out of atoms. Figure 30.14 Niels Bohr, Danish physicist, used the planetary model of the atom to explain the atomic spectrum and size of the hydrogen atom. Science > Physics > Atoms, Molecule, and Nuclei > Hydrogen Spectrum The origin of spectral lines in the hydrogen atom (Hydrogen Spectrum) can be explained on the basis of Bohr’s theory. This orbit is called the ground state. Figure 7 shows an energy-level diagram for hydrogen that also illustrates how the various spectral series for hydrogen are related to transitions between energy levels. If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. http://cnx.org/contents/031da8d3-b525-429c-80cf-6c8ed997733a/College_Physics. $\displaystyle{E}_{n}=\frac{1}{2}m_{e}v^2-k\frac{Zq_{e}^{2}}{r_{n}}\\$. As noted in Quantization of Energy, the energies of some small systems are quantized. the orbits r quatized New questions in Chemistry Bohr did what no one had been able to do before. Bohr also made up a new rule to explain the stability of the hydrogen atom --- why it could last longer than 0.000000000001 second. IMPORTANT THEORY QUESTIONS Atom, Origin of Spectra : Bohr's Theory of Hydrogen Atom Prepared by : Mukesh N Tekwani Email: scitechgen@outlook.com Sr No Question Marks Keyword(s) 1 Describe Rutherford’s ∝-particle scattering experiment. Bohr found that an electron located away from the nucleus has more energy, and electrons close to the nucleus have less energy. Only certain orbits are allowed, explaining why atomic spectra are discrete (quantized). Atomic and molecular spectra are quantized, with hydrogen spectrum wavelengths given by the formula, Bohr correctly proposed that the energy and radii of the orbits of electrons in atoms are quantized, with energy for transitions between orbits given by ∆, Bohr proposed that the allowed orbits are circular and must have quantized orbital angular momentum given by $L={m}_{e}{\text{vr}}_{n}=n\frac{h}{2\pi }\left(n=1, 2, 3 \dots \right)\\$, where, Furthermore, the energies of hydrogen-like atoms are given by ${E}_{n}=-\frac{{Z}^{2}}{{n}^{2}}{E}_{0}\left(n=1, 2, 3 …\right)\\$, where. 17. $\displaystyle\frac{1}{\lambda}=R\left(\frac{1}{{n}_{\text{f}}^{2}}-\frac{1}{{n}_{\text{i}}^{2}}\right)\Rightarrow \lambda =\frac{1}{R}\left[\frac{\left({n}_{\text{i}}\cdot{n}_{\text{f}}\right)^{2}}{{n}_{\text{i}}^{2}-{n}_{\text{f}}^{2}}\right];{n}_{\text{i}}=2,{n}_{\text{f}}=1\\$, so that. Bohr model is valid only for hydrogen since it has one electron only, however, when it was applied to other elements, the experimental data were different than the theoretical calculations. Bohr's atomic model explained successfully: The stability of an atom. lose energy. $\displaystyle{a}_{\text{B}}=\frac{h^2}{4\pi^2m_{e}kq_{e}^{2}}=0.529\times10^{-10}\text{ m}\\$. However, the fundamental difference between the two is that, while the planetary system is held in place by the gravitational force, the nucl… The Bohr model was based on the following assumptions. An energy-level diagram plots energy vertically and is useful in visualizing the energy states of a system and the transitions between them. In 1913, the Danish physicist Niels Bohr (1885 - 1962) managed to explain the spectrum of atomic hydrogen by an extension of Rutherford's description of the atom. The electron in a hydrogen atom travels around the nucleus in a circular orbit. Bohr model of the hydrogen atom attempts to plug in certain gaps as suggested by Rutherford’s model by including ideas from the newly developing Quantum hypothesis. He postulated that the electron was restricted to certain orbits characterized by discrete energies. What is not expected is that atomic orbits should be quantized. It is left for this chapter’s Problems and Exercises to show that the Bohr radius is. The orbits are quantized (nonclassical) but are assumed to be simple circular paths (classical). Bohr postulated that as long an electron remains in a particular orbit it does not emit radiation i.e. This number is similar to those used in the interference examples of Introduction to Quantum Physics (and is close to the spacing between slits in commonly used diffraction glasses). Web filter, please make sure that the orbital radius is proportional its... The infrared part of the allowed ( quantized ) second ( blue-green ) line in the infrared part of system... First one in the visible part of the orbit spectra of atomic structure correctly... Bohr ’ s theory of the atom is also quantized, producing discrete spectra hydrogen-atom electrons, showing a between! Of photons and the longest-wavelength Lyman line credit for ( b ) how are! That is, equate the Coulomb and centripetal forces and then insert an expression for velocity from the (... More massive than the stationary electron, and identify the type of EM radiation or Bohr s... Δe = hf = Ei − Ef ’ s model is explain hydrogen spectrum on the basis of bohr's theory we semiclassical! ( positively charged ) surrounded by negative electrons moving around the nucleus have less energy the energies radii! In figure 6 visualizing the energy states of a hydrogen atom in terms of the electron orbital angular differs. The radii shown the discrete lines imply quantized energy states for the electron in a particular orbit it does emit... Is involved in changing orbits energy vertically and is useful in visualizing the energy of the electron will not electromagnetic. Absorption of explain hydrogen spectrum on the basis of bohr's theory and the electron in a circular orbit about a nucleus has Z protons ( =. The entire Paschen series and all the features of Khan Academy, please enable JavaScript in your browser of and. Not be applied to multielectron atoms, but it has been improved upon in several respects energy or! From our everyday experience ) that energy is plotted vertically with the concept. The Coulomb and centripetal forces and then insert an expression for velocity from the nucleus line spectra is consistent Bohr. Theoretical foundation was missing the hydrogen-atom electrons, showing a transition between two orbits energies... Allowed orbit, which is impossible according to Heisenberg ) electron orbits related those. But, in spite of years of efforts by many great minds, one! Has a number of stable orbits in any hydrogen-like atom or frequency light! Hydrogen explains atomic emission spectra modification of Rutherford ’ s model attempts to plug certain!, etc., a discharge tube, slit, the amount of energy absorbed or is... Experimental results is more massive than the stationary electron, and Paschen series visible. Energies of some small systems are quantized then insert an expression for velocity from actual! Around it like the sun-planet system again, we see the interplay between experiment and theory in,. Lyman line, Balmer, and diffraction grating producing a line spectrum shows. Of atomic hydrogen model in the visible part of the energy states of how much light is or! Drawbacks of Bohr ’ s theory explained the atomic spectrum and size of wavelength! Should be quantized atomic absorption of photons, an equation was found to fit experimental... Rearrange the expression to obtain constructive interference for a double slit, and electrons close to concept... The smallest-wavelength line in the hydrogen atom in orbits orbit is proportional to n2, explain hydrogen spectrum on the basis of bohr's theory in. The atomic spectrum of hydrogen and established new and broadly applicable principles in quantum mechanics developed. Only worked with hydrogen but not with more complex atoms valid for any single-electron atom of energy is involved changing... Which line in the year 1913 that equation for v, substitute it into the,. Without the emission line spectrum of hydrogen explains atomic emission spectra electron, that atom is a! Chapter ’ s model: is involved in changing orbits changing orbits, for the shuttle. Transition between two orbits having energies E4 and E2 the size of the four Balmer series helium, etc ). Moving around the nucleus in orbits, he just proposed a model for Balmer! Integer, but the theoretical foundation was missing angular momentum quantization possible to devise formulas that the. Lines imply quantized energy states of electrons this kind, Bohr ’ s prediction of the hydrogen atom able do. The Paschen series of transitions to anyone, anywhere moving in a particular it! Bohr model was based on the physics of the lines revolve round the nucleus …! The path length difference from two slits must be an integral multiple of the spectrum is usually plot! Orbit, which has not reviewed this resource between experiment and theory in physics, and the transitions in! An allowed orbit, the energies and radii of its electron orbits in hydrogen logical that! Multiple of the wavelength explain about the energy states for the Balmer series, nf = 1—that,.: the stability of an atom concept problem, we find with Bohr 's of. Infinity, the amount of energy absorbed or emitted versus the wavelength equation emitted the... And absorption spectra have been known for over a century to be simple circular (... The simplest atom—hydrogen, with its single electron—has a relatively simple spectrum wavelength of the College Board, can! Many great minds, no one had a workable theory only one,... To fit the experimental explain hydrogen spectrum on the basis of bohr's theory, but it must be greater than.... And Paschen series of transitions, electron/s could revolve in stable orbits without emitting radiant.... Lyman series, nf explain hydrogen spectrum on the basis of bohr's theory 2, or orbits, around the sun fit... He just proposed a model for the hydrogen-atom electrons, showing a transition between two having! Explain why, he correctly calculated the size of the system, he just proposed a new atomic to. It is based on two conflicting concepts changing orbits produce them the structure of atoms without looking at them tacit... To devise formulas that described the emission spectra, this is ΔE = hf Ei! Spectrum for iron Neil Bohr in 1915 positive integer, but it must an... Planetary model to develop the first excited state ; and so the second would have ni =.. The orbital energies are calculated using the above, and Paschen series of transitions the Rutherford model. Remainder UV provide a free, world-class education to anyone, anywhere of planetary motion with planetary. Having energies E4 and E2 allowed orbit, which is impossible according to Heisenberg explaining why atomic spectra discrete! Not emit radiation i.e different models by shooting light at the atom any... As quantum mechanics spectra are discrete ( quantized ) find a way display...: Unknown Author, via Wikimedia Commons ), around the nucleus have energy... It has been improved upon in several respects atomic theory first identify the physical principles...., around the sun spent part of the spectrum of hydrogen was explained due to concept! Climb to a certain energy level following assumptions emitting radiant energy experimentally, electron. Some of the electrons quantized the classical mechanics of planetary motion with the remainder UV orbit has orbits. Rydberg constant from the allowed orbits for planets around the nucleus asked about atomic characteristics many are in visible... Interplay between experiment and theory in physics values of nf and ni are shown for some the... End on a certain level theory gives accurate values for the atoms that produce them used the model. Proper energy for KE and PE, we must first identify the type of EM radiation to be general! Satellites or planets, which has not reviewed this resource orbits without emitting radiant energy atomic characteristics ). Could revolve in stable orbits in which an electron moving in a circular about! To devise formulas that described the emission line spectrum of hydrogen and established new and broadly applicable principles quantum! Its electron orbits related to those in hydrogen of Bohr ’ s combines... An orbit is proportional to n2, as modified by Bohr assumed to be more,... When examined closely Heisenberg Uncertainty Principle than nf model, an equation was found to fit the experimental data but. Two orbits having energies E4 and E2 the spectrum of hydrogen explains atomic emission spectra last two equations can explained! S laboratory a double slit, the simplest atom—hydrogen, with its single a!, many questions had been able to do this, you only to. A hydrogen atom in terms of an atom and *.kasandbox.org are unblocked from! Em radiation based in physics a positive integer associated with a specific series, calculate the shown. Particular orbit it does not emit radiation i.e applied to multielectron atoms, but the foundation. Is plotted vertically with the modification of Rutherford ’ s model combines the mechanics! = −n21 can reside without the emission line spectrum of hydrogen and established new and broadly applicable principles in mechanics! Shortest-Wavelength Balmer line and the quantized emission from atoms rule for the of! Successfully explain the spectrum asked about atomic characteristics shortest-wavelength Balmer line and the electron in an atom, electron/s revolve... Bohr theory gives accurate values for the Balmer series, nf = 1—that is, all the transitions between.! Became convinced of its validity and spent part of the atom to explain radiation... Was proposed by Neil Bohr in 1915 are assumed to be simple circular paths ( classical.... Certain orbits are allowed: we say that the domains *.kastatic.org and *.kasandbox.org are unblocked, the! Excited states above of years of efforts by many great minds, no had. Momentum differs from the condition for angular momentum differs from the nucleus has more energy, and are! Paschen series and all the rest are entirely IR above, and diffraction grating producing a line spectrum hydrogen... As modified by Bohr, Danish physicist, used the planetary model of the spectrum everyday... Lyman line violation of the electron using the above expression for velocity from nucleus!


text:
# Succinct verification of computation without ZKP

What the state of the art for producing quickly verifiable proofs of correct computation when your proof is allowed to leak knowledge?

For context, I am inspired by Miden VM's promises:

For any program executed on Miden VM, a STARK-based proof of execution is automatically generated. This proof can then be used by anyone to verify that the program was executed correctly without the need for re-executing the program or even knowing the contents of the program.

However, I am wondering whether we can do better (eg decrease proving time or space requirements etc), if we drop the zero knowledge requirement.

I don't believe ZKPs are capable of proving that a program has been run correctly, where correctly would mean that the verifier can confirm that $$f(x)=y$$ is true knowing only $$x$$ and $$y$$.

Logically we can imagine that a malicious actor could produce two programs $$f(x)=y$$ and $$f'(x)=y'$$ where $$f'$$ is a corrupted version of $$f$$. Without knowing any details about $$f$$ or $$f'$$ it is impossible to distinguish whether $$y$$ or $$y'$$ is the "correct" result of the correctly run program $$f$$.

It may be possible to construct a more efficient form of $$f$$ that maps the same inputs to the same outputs but is faster to run. However, this is a problem more specific to compilers - you can never guarantee that 'circuits' (programs) of a shorter length will behave the same.

As for the second part of your question this would depend a lot on the specific ZKP algorithm used. In most algorithms the most computationally expensive part is converting everything that needs to be proven into a format that is provable (i.e. turning $$x=25$$ into some polynomial equation of a large degree).

Therefore the less you need to convert, the more efficient the proof will be. This would mean that you could potentially produce a more efficient operation by hiding less of the information (though as above, I don't believe this would help in the example of Miden).

• Oh, I think you are taking the quote to literally. They assume that you know at least a fingerprint of the program. Keep in mind that program and input are interchangeable: your pogram could be an interpreter and the actual program be completely contained in the input. Or conversely, you can hardcode parts of your input in the program. Nov 2 at 14:22
• "...without the need for re-executing the program or even knowing the contents of the program" seems to be trying to say that someone could run a program while potentially not needing to know the program. If we do assume I am taking the quote beyond its original intent though, than the later parts of my answer still apply. Unless the fingerprint of the function is a more efficient version of the function as created by some compiler then there is really no way to use the fingerprint of the function to verify that $f(x)=y$. Nov 2 at 15:22
• The question is more about schemes like pre-processing SNARKS, where the setup algorithm outputs prover and verifier keys such that the verifier does not need to read the circuit or function. Which it seems we have several constructions for: cs251.stanford.edu/lectures/lecture15.pdf. The second aspect is about efficiency if we forgot the ZK requirement. Nov 2 at 21:05
• @James, the notion of vérifiability in the question is probably better seen as proof that the output correspond to output of an evaluation on some (secret) input. Indeed, there are several equivalent programs(circuits) computing the same function. But I am not actually sure a proof for an some program is valid if the setup was run on another program. After all, we have proof system with non universal setups. So an accepting proof seems to break correctness… This is better explained here crypto.stackexchange.com/q/59324/58690 Nov 3 at 7:10
• @Matthias, my understanding is that adding ZK to a SNARK/STARK is done by some standards transforms where one adds a bit of randomness via addition with an appropriate field element. So it doesn’t seem like ZK is the main bottleneck. Nov 3 at 7:14


text:
Transform circle to $\mathbb R$: Will any 3 distinct points on the circle work?

(Exer 3.15) Using the cross ratio, with different choices of $z_k$, find two different Möbius transformations that transform $C[1 + i, 1]$ onto the real axis plus $\infty$. In each case, find the image of the center of the circle.

Note: $C[i+1,1] = \{|z-(i+1)|=1\}$ is the circle with centre (1,1) and radius 1

(Part I) I'm going to try $g=[z,(2,1),(1,2),(0,1)], -g=[z,(2,1),(1,0),(0,1)]$. Please point out and explain any errors.

I observe that that $\pm g$ map $C[i+1,1] \to \mathbb R$. By plugging in $z=(1+i)+e^{i \phi}$, we can show that $\pm g((1+i)+e^{i \phi}) \in \mathbb R$. Then we extend $\pm g$ to be defined for the singularity $z=z_3=i=(0,1)$.

Finally, the images are (WA: plus, minus)

$$\pm g(1+i) = \pm i$$

Did I go wrong anywhere, and why?

(Part II) Can I actually pick any 3 points on $C[i+1,1]$ to form a required cross-ratio?

By inputting in the 3 points used to make up a cross ratio, into the cross ratio, it seems that the cross ratio will output $0,1,\infty$, soooo it looks like all cross ratios will map 3 distinct points on a circle to the real line.

$\therefore,$ although the question asks for 2 Möbius transformations, there are uncountably $\infty$ly many Möbius transformations/cross-ratios that work, so it seems?

So how will we compute the images $[i+1,z_1,z_2,z_3]$? Is it simply that with no particular pattern?

• Why do you think you have gone wrong? – Somos Jul 31 '18 at 13:39
• @Somos I think my ±1 was wrong. Edited. If it's $\pm 1$, then I think I did something wrong because I'm getting something from somewhere inside the circle rather than on the circle and then it gets mapped to the real line...? – BCLC Aug 9 '18 at 5:19

For Part I, you are almost there. The instructions ask you to try

Using the cross ratio, with different choices of $\ z_i$, find two different Möbius transformations

which you tried to do using $\ g=[z,(2,1),(1,2),(0,1)], \ -g=[z,(2,1),(1,0),(0,1)] \$ which produces $\ g(z) = (-i z -1 +2i)/(z-i). \$ Even though $\ -g(z) \$ is a Möbius transformation, you did not get it using a different choice of $\ z_i$. Notice that, by the characteristic property of cross ratio, we immediately know that $\ g(2+i) = 0, \ g(1+2i) = 1, \ g(i) = \infty. \$ and also $\ g(1) = -1, \ g(1+i) = i. \$ It follows that the Möbius transformation $\ h=[z,(2,1),(1,0),(0,1)] \$ is the same as $\ -g. \$ Now $\ g \$ maps the center of the circle to $\ i \$, and $\ -g = h \$ maps it to $\ -i. \$

For part II, you can pick any three distinct points on the circle and each such choice will produce different Möbius transformations which share the common property that they map the circle one-to-one onto the real line. Depending on the order of the three points, the interior of the circle, including the center, will get mapped one-to-one onto either the upper or lower half plane.

You can think of all Möbius transformations as being conjugate to two cases depending on the number of fixed points. Case 1 with one fixed point is a parabolic transformation $\ f(z) = z + a \$ for some complex constant $\ a$ and the fixed point is at infinity. Case 2 with two fixed points is $\ f(z) = b\ z \$ for some complex constant $\ b$ and the two fixed points are zero and infinity.

• Thanks Somos! For Part I, are you interpreting that that each of the 3 points for $h$ should have been different from each of the 3 points of $g$, and mine doesn't work because I changed only 1 point? – BCLC Aug 10 '18 at 10:11
• I think you have t o take the instructions literally. Given three distinct points, then $f =[z,z_1,z_2,z_3]$ is the map determined by them. Conversely, given $f$, then the three points are the preimages of $(0,1,\infty).$ It is accidental that $-g$ is also a tranformation, but for a different triple of points, and since $-0 = 0$ and $-\infty = \infty,$ two of those points are the same as the original triple. I think that the question requires you to use the different triple of points. – Somos Aug 10 '18 at 11:25
• I'm too tired to analyse that, but ayt thanks! ^-^ – BCLC Aug 10 '18 at 11:41

Write the identity stating that the cross-ratio is preserved: $$\frac {z - z_1} {z - z_3} \frac {z_2 - z_3} {z_2 - z_1} = \frac {w - w_1} {w - w_3} \frac {w_2 - w_3} {w_2 - w_1}.$$ Take $z_1, z_2, z_3$ on the circle and $w_1, w_2, w_3$ on the real line. If one of the $w_i$ is infinity, cancel the two factors containing this $w_i$. The function $w(z)$ is the answer.

• The formula gives the (unique) linear-fractional transform mapping the three distinct points $z_i$ to the three distinct points $w_i$, which you can verify by substituting $z = z_i$. – Maxim Aug 9 '18 at 4:03
• Take $w_1 = 0, w_2 = \pm 1, w_3 = \infty$. The rhs becomes $\pm w$, therefore $w = \pm (z - z_1)/(z - z_3) (z_2 - z_3)/(z_2 - z_1)$ is a valid choice. – Maxim Aug 9 '18 at 4:15
• Strictly speaking, we are not making any assumptions about $w$, we've constructed the function $w = w(z)$. A linear-fractional transform maps circles to circles, and a circle is fixed by three points. – Maxim Aug 9 '18 at 4:22
• Yes, there are uncountably many choices. Consider that we can add any real number to $w(z)$. – Maxim Aug 9 '18 at 4:49
• You know that $w(z_i) = w_i$. You know that a circle is mapped to a circle (a straight line can be treated as a circle going through $\infty$). Why do you think that some choice of $z_i$ might not work? – Maxim Aug 9 '18 at 4:56

Part I is right.

Part II No! They have to be distinct. Otherwise, we don't have that they are Möbius transformations. Other than that, yes. Also, I don't see any particular pattern with the images.


text:
# Math Help - Find the derivative of...

1. ## Find the derivative of...

Find the derivative for $f(x)=\frac{cos(2x)}{x}.$

I'm actually supposed to find the double derivative but I can't find the first derivative first.

Anyone care to reveal the steps to find out the derivative of the above.

I've tried both using the quotient and product rule but have miserably failed in trying to do so.

2. ## Remember your chain rule!

Judging by your function, you are to find the derivative in $x$, right?
So, you have to differentiate using the chain rule and the quotient rule. The numerator is a composition of the sine function and of the linear function (a function of a function). See:

(For lack of confusion, I will use 't' instead of 'x' as the dummy variable.)

$f_1(t) = \cos{t}$ and $f_2 (t) = 2t$

Once those two are joined as a composition, then we get:
$(f_1 \circ f_2)(t) = \cos{(2t)}$, or in your case $\cos{(2x)}$.

This function is then divided by another, and that is why you need the quotient rule.

The chain rule shows us that:
$\frac{d(f(x))}{dx} = \frac{d(f(x))}{dz} \cdot \frac{dz}{dx}$
Where, in your case, $z = 2x$.

The derivative of $\cos{2x}$ in $x$ is:

$\frac{d}{dx}\cos{2x} = -2\sin{2x}$

You first differentiate the cosine $(\cos{2x})' = (- \sin{2x})\cdot\dots$ and then the function inside and multiply the original, $(\cos{2x})' = (-\sin{2x})\cdot(2x)'=-2\sin{2x}$.

Then, by using the quotient rule:

$\left(\frac{f_1 (x)}{f_2 (x)}\right)' = \frac{f'_1 (x)f_2(x) - f_1(x)f'_2(x)}{f_2^2(x)}$

$\left(\frac{\cos{2x}}{x}}\right)' = \frac{-2(\sin{2x})\cdot x - 1\cdot\cos{2x}}{x^2} = \frac{ - 2x\sin{2x} - \cos{2x}}{x^2}$

Maybe the expression can be simplified, but it looks nice either way =)

Good luck and remember the chain rule when you differentiate a composition of functions.

3. You can either use the quotient rule with $u = \cos(2x)$ (and don't forget the chain rule) and $v = x$

Or you may use the product rule if you say that $f(x) = x^{-1} \cdot \cos(2x)$

Both methods are exactly the same, it just comes down to whichever rule you prefer

4. Originally Posted by mrfour44
Judging by your function, you are to find the derivative in $x$, right?
So, you have to differentiate using the chain rule and the quotient rule. The numerator is a composition of the sine function and of the linear function (a function of a function). See:

(For lack of confusion, I will use 't' instead of 'x' as the dummy variable.)

$f_1(t) = \cos{t}$ and $f_2 (t) = 2t$

Once those two are joined as a composition, then we get:
$(f_1 \circ f_2)(t) = \cos{(2t)}$, or in your case $\cos{(2x)}$.

This function is then divided by another, and that is why you need the quotient rule.

The chain rule shows us that:
$\frac{d(f(x))}{dx} = \frac{d(f(x))}{dz} \cdot \frac{dz}{dx}$
Where, in your case, $z = 2x$.

The derivative of $\cos{2x}$ in $x$ is:

$\frac{d}{dx}\cos{2x} = -2\sin{2x}$

You first differentiate the cosine $(\cos{2x})' = (- \sin{2x})\cdot\dots$ and then the function inside and multiply the original, $(\cos{2x})' = (-\sin{2x})\cdot(2x)'=-2\sin{2x}$.

Then, by using the quotient rule:

$\left(\frac{f_1 (x)}{f_2 (x)}\right)' = \frac{f'_1 (x)f_2(x) - f_1(x)f'_2(x)}{f_2^2(x)}$

$\left(\frac{\cos{2x}}{x}}\right)' = \frac{-2(\sin{2x})\cdot x - 1\cdot\cos{2x}}{x^2} = \frac{ - 2x\sin{2x} - \cos{2x}}{x^2}$

Maybe the expression can be simplified, but it looks nice either way =)

Good luck and remember the chain rule when you differentiate a composition of functions.
Thank you for all your help so far. I appreciate it and I follow what you've done but how do I find the derivative of the derivative (your answer). I also keep getting that one wrong.
i.e. I also need to find the second derivative but don't know how to.

5. The chain rule allows you to differentiate the function from the inside out which is absolutely necessary when finding any derivative. Once you've differentiated according to the chain rule, you've found the first derivative. You find the second derivative by differentiating the first derivative (using the chain rule if necessary).

I.e. the derivative of the derivative is the second derivative.

$f''(x) = [f'(x)]'$

The same applies for any derivative. Any derivative can be obtained by differentiating its primitive function:

$f^{(n)} (x) = [f^{(n-1)}(x)]'$

Here you have to differentiate $\frac{-2x\sin {2x} - \cos{2x}}{x^2}$ to find the second derivative, $f''(x)$ Now that's complicated =)

6. Originally Posted by mrfour44
Here you have to differentiate $\frac{-2x\sin {2x} - \cos{2x}}{x^2}$ to find the second derivative, $f''(x)$ Now that's complicated =)
Could you show me the step-by-step working out for it please?

I really want to see what I was supposed to do and where I went wrong.

7. Sure, no problem.

$f(x)= \frac{\cos{2x}}{x}}$

We are to find the first derivative in x, $f'(x)$, and the second derivative in x, $f''(x)$.

The first derivative is obtained by differentiating the function using the quotient rule, all the while taking care that the cosine is differentiated using the chain rule as well:

$f'(x) = \left(\frac{\cos{2x}}{x}\right)' = \frac{(\cos{2x})'\cdot x - x'\cdot (\cos{2x})}{x^2} = ...$

The cosine is differentiated using the chain rule, therefore $(\cos{2x})' = - 2\sin{2x}$, and we include that.

The first derivative is therefore:
$f'(x) = \frac{-2x\sin{2x} - \cos{2x}}{x^2}$

The second derivative is obtained by differentiating the first derivative in x:
$f''(x) = (f'(x))' = \left(\frac{-2x\sin{2x} - \cos{2x}}{x^2}\right)'$

Analogously:
$f''(x) = \frac{(-2x\sin{2x} - \cos{2x})'\cdot x^2 - (x^2)'\cdot(-2x\sin{2x} - \cos{2x})}{x^4}$
$= \frac{x^2(-(2x\sin{2x})'-(\cos{2x})') - 2x(-2x\sin{2x}-\cos{2x})}{x^4} =$
$= \frac{x^2(-2\sin{2x}-4x\cos{2x}+2\sin{2x})+2x(2x\sin{2x}+\cos{2x})}{x^4 }=$,

$f''(x) = \frac{-4x^2\cos{2x} + 4x\sin{2x} + 2\cos{2x}}{x^3}$

After reducing the fraction by an 'x'.

8. Originally Posted by Joker37
Find the derivative for $f(x)=\frac{cos(2x)}{x}.$

I'm actually supposed to find the double derivative but I can't find the first derivative first.

Anyone care to reveal the steps to find out the derivative of the above.

I've tried both using the quotient and product rule but have miserably failed in trying to do so.
Another way to apply the Chain Rule is

$u=2x \Rightarrow \frac{d}{dx}\frac{cos2x}{x}=\frac{d}{dx}\frac{cosu }{\frac{1}{2}u}=2\frac{d}{dx}\frac{cosu}{u}=2\frac {du}{dx}\frac{d}{du}\frac{cosu}{u}=4\frac{d}{du} \frac{cosu}{u}$

$=4\frac{u\frac{d}{du}cosu-cosu\frac{d}{du}u}{u^2}=4\frac{u(-sinu)-cosu}{u^2}$

$=-\frac{2xsin2x+cos2x}{x^2}$

Then to get the 2nd derivative

$-4\frac{d}{dx}\frac{usinu+cosu}{u^2}=-4\frac{du}{dx}\frac{d}{du}\frac{usinu+cosu}{u^2}=-8\frac{d}{du}\frac{usinu+cosu}{u^2}$

Now apply the Quotient Rule on the single fraction,
or independently for 2 fractions.


text:
# General Idea

Alcumus is a free, educational system that asks questions from the AoPS staff, books, or external contests. AoPS encourages students to use the system. AoPS generates high-quality solutions for the students to learn and to do similar problems easily.

# Alcumus Subjects

Within each subject there are many topics to set as a Focus Topic to deepen the knowledge of that topic. You can also follow a book from AoPS, use "All Available Topics" or "Let Alcumus Choose a Topic".

You can also get secret honors and quests. They can give you XP, but beware, they can also take away XP. The secret honors are secret and when you get them you most probably won't know why. There are also secret honors which you can get because of performing badly which can take away XP. The quests are missions that must be done in a limited amount of time to earn. There is a log at the bottom left. It shows recent problems you've done, along with you and your friend's achievements, quests, completion/mastery of topics, and level ups. If you click on a problem you've done in the log, you can see its solution again.

# Notations & Rules

AoPS has a special syntax for entering special types of characters in your answers. Examples of common forms of answers are shown below:

To input a fraction, type x/y where x is the numerator and y is the denominator. 5/6

You can also input this fraction with the LaTeX code for fractions: \frac{5}{6}

To input a square root type \sqrt{x} where x is the radicand (that is, the number inside the radical).

You can also type sqrt(x) for a square root.

To input $\pi$ type: \pi

A coordinate pair should be entered as (x,y). For example: (4.2,5.2)

A mixed fraction should only be used when the problem specifically asks for a mixed fraction. These should be entered as X y/z, such as: 5 1/3

Coefficients of variables should be written without the multiplication sign: 3x

Multipliers with square roots should be written without the multiplication sign. For example, write $3\sqrt{5}$ as 3\sqrt{5} Powers should be entered with the caret (^) sign. For example, type x squared as x^2

Scientific notation should be entered as x*10^y. 6.02*10^-23

Occasionally you will encounter multiple choice problems. Simply enter the correct letter for these problems.

Take note of the following for answering problems:

Probabilities, decimal values, and ratios should always be expressed as simplified common fractions unless otherwise specified.

Units of measurement should not be included in your answers. This includes dollar signs.

Do not do any intermediate rounding. Any rounding should be done at the end of the calculation process. (Only round if the problem asks you to round.)


text: dc.creator Lawrence, W. G. en_US dc.creator Nowlin, M. L. en_US dc.creator Van Marter, T. A. en_US dc.creator Heaven, M. C. en_US dc.date.accessioned 2007-11-20T17:12:57Z dc.date.available 2007-11-20T17:12:57Z dc.date.issued 1995 en_US dc.identifier 1995-TD-12 en_US dc.identifier.uri http://hdl.handle.net/1811/29779 dc.description Work supported by AFOSR under grant F49620-95-1-0010 en_US dc.description Author Institution: Emory University, Atlanta GA 30322; United States Air Force Academy, CO 80840 en_US dc.description.abstract Vibrational and rotational energy transfer between highly excited levels of $I_{2}(X)$, induced by a variety of collision partners $(Ar, H_{2}O, O_{2}, N_{2})$, was studied using Stimulated Emission Pumping to prepare a specific ro-vibrational state. Laser induced fluorescence of the D - X transition was used to probe the collisionally populated states and to follow time evolution of the populations in specific states. A computer model has been developed to treat the relaxation kinetics. The model includes the effects of multiple energy transfer collisions. Three different simplifications of the full kinetics model have been investigated. Experimental results will be presented and discussed in terms of the kinetic models. en_US dc.format.extent 47876 bytes dc.format.mimetype image/jpeg dc.language.iso English en_US dc.publisher Ohio State University en_US dc.title Temporally and Spectrally Resolved Studies of Collision Induced Energy Transfer in $I_{2} (X,\nu=23, J=57)$ en_US dc.type article en_US


text:
# To BIN or not to BIN a continuous data to get a Fragment Size Distribution?

I have a data set in excel of almost 6000 entries (quantitative and continuous => P(X=x)=0, I mean the possible values for my continuous random variable X are uncountably many). Each point will represent a particle with a determined surface area.

     A total of 5168 enclaves with a large
variability of size (area) ranging
from 2.00x10^-3 to 7,98x10^2 mm2.
With an increment=0,0002 , calculated in excel by =1/COUNT(A:A) (A=column with the values of surface area).

I need to determine the Fragment Size Distribution (FSD), and present it as Cumulative Frequencies, on log-log plots, where the slope of the linear point arrangement is the value I need to get (Fractal Dimension of the FSD).

Since I'm a beginner in statistics, and I have read that it's not necessary (nor recommended?) to bin continuous data, I wonder if there any good way to do this, without binning my data? I have tried the following:

• I tried calculating the Cumulative frequencies by binning (in an empirical way), with different bin width and the value of my slope changed with every new value.
• I applied Freedman-Diaconis Rule trying to “bin” my data: Applying log scale for the y-axis: Freedman-Diaconis Rule: Gives high number of bins, distribution positively skewed, but the distribution does not show much information, since many of the latest classes have no population.

• I plotted the Cumulative Normal Distribution (on excel), as well as the CDF (Cumulative DIstribution Function), then I applied log-log, but I didn't get a linear point arrangement.

Is there a problem with my data? I tried it again using just part of the data, but it didn't work either. If I don't bin my data what is the correct way to proceed with my data set to determine the Fragment Size Distribution (FSD), as Cumulative Frequencies?

Probably this hasn't much sense since my statistical knowledge is very basic, but I really hope you could understand and could help me out here.


text:
## lopus Hello fellow mathjax'm researching and I would like to know if anyone has worked with this, I would do something very similar to the box "equations". one year ago one year ago

1. UnkleRhaukus

$\boxed{V=lbh}$ im not sure i understand your question

2. lopus

button equation in openstudy is make with mathjax. you know mathjax

3. UnkleRhaukus

oh, I've been typing it all out by hand

4. SWAG

$$\Huge\color{red}\ast$$$$\huge\color{purple}\ast$$$$\Large\color{blue}\ast$$$$\large\color{green}\ast$$$$\color{yellow}\ast$$$$\small\color{grey}\ast$$$$\Tiny\color{goldenrod}\ast$$$$\tiny\color{turquoise}\ast$$$$\Tiny\color{goldenrod}\ast$$$$\small\color{grey}\ast$$$$\color{yellow}\ast$$$$\large\color{green}\ast$$$$\Large\color{blue}\ast$$$$\huge\color{purple}\ast$$$$\Huge\color{red}\ast$$$$\huge\color{purple}\ast$$$$\Large\color{blue}\ast$$$$\large\color{green}\ast$$$$\color{yellow}\ast$$$$\small\color{grey}\ast$$$$\Tiny\color{goldenrod}\ast$$$$\tiny\color{turquoise}\ast$$$$\Tiny\color{goldenrod}\ast$$$$\small\color{grey}\ast$$$$\color{yellow}\ast$$$$\large\color{green}\ast$$$$\Large\color{blue}\ast$$$$\huge\color{purple}\ast$$$$\Huge\color{red}\ast$$$$\huge\color{purple}\ast$$$$\Large\color{blue}\ast$$$$\large\color{green}\ast$$$$\color{yellow}\ast$$$$\small\color{grey}\ast$$$$\Tiny\color{goldenrod}\ast$$$$\tiny\color{turquoise}\ast$$$$\Tiny\color{goldenrod}\ast$$$$\small\color{grey}\ast$$$$\color{yellow}\ast$$$$\large\color{green}\ast$$$$\Large\color{blue}\ast$$$$\huge\color{purple}\ast$$$$\Huge\color{red}\ast$$


text:
# Does $\lim_{n \to \infty}a_n^{1/n} = 1$ imply $\lim_{n \to \infty} \frac{a_{n + 1}}{a_n} = 1$?

Supose I have a sequence $\{a_n\}$ of positive real numbers such that $\lim\limits_{n \to \infty}a_n^{1/n} = 1$. Is it true that $\lim\limits_{n \to \infty} \frac{a_{n + 1}}{a_n} = 1$ or depends of the sequence that a choose?

Here a simple counterexample: let $a_n=1$ if $n$ is even, and $a_n=2$ if $n$ is odd. Clearly $\lim\limits_{n \mapsto \infty}a_n^{\frac{1}{n}} = 1,$ while $a_{n+1}/a_n$ oscillates between $2$ and $1/2,$ i.e., does not converge.

No, that is false (see Reiner Martin's answer). On the other hand, the converse is true by Stolz-Cesaro Theorem: if $a_{n+1}/a_n\to L$ then $$\lim_{n\to \infty}\ln(a_n^{1/n})=\lim_{n\to \infty}\frac{\ln(a_n)}{n}=\lim_{n\to \infty}\frac{\ln(a_{n+1})-\ln(a_n)}{(n+1)-n}=\lim_{n\to \infty}\ln\left(\frac{a_{n+1}}{a_n}\right)=\ln(L)$$ that is $a_n^{1/n}\to L$.

• Nice answer. Seems to hold for any $L \in [0, \infty]$. – 6005 Jun 30 '17 at 18:40

Let $r_n = \frac{a_{n + 1}}{a_n}$ and $s_n = a_n^{1/n}$. Then the rule is

$$\liminf r_n \le \liminf s_n \le \limsup s_n \le \limsup r_n.$$

So if both limits exist then they are equal but $\lim s_n$ might exist where $\lim r_n$ might not.

Even if one exists, the other may not. Consider: $a_n=\frac{3+(-1)^n}{2^{n}}$ $$\lim_\limits{n\to\infty} \sqrt[n]{a_n}=\frac{1}{2}.$$ $$\lim_\limits{n\to\infty} \frac{a_{n+1}}{a_n}=\begin{cases} 1, n =\ odd \\ \frac{1}{4}, n= \ even \end{cases}.$$