text:
# 10.5: Recording Asset Exchanges and Expenditures That Affect Older Assets

Learning Objectives

At the end of this section, students should be able to meet the following objectives:

1. Record the exchange of one asset for another based on fair value and explain the rationale for this method of recording.
2. Determine when the fair value of an asset received is used for recording an exchange rather than the fair value of the property surrendered.
3. Compute the allocation of cost between assets when more than one is required in a single transaction.
4. Know when expenditures must be capitalized for an asset that has been in use for some time and the impact on future depreciation expense calculations.

Question: Some assets are acquired by exchange instead of through purchase (asset exchange). For example, the limousine discussed earlier might well be traded away after two years for a newer model. Such transactions are common, especially with vehicles. How is the cost of a new asset determined if obtained through an exchange rather than an acquisition?

To illustrate, assume that this limousine is traded to an automobile manufacturer for a new model on December 31, Year Two. By that time as shown previously, the net book value had fallen to $30,000 (cost of$90,000 less accumulated depreciation of $60,000). However, because company employees have taken excellent care of the vehicle during those two years, fair value is actually$45,000. As has been discussed, book value rarely equals fair value during the life of property and equipment. Assume that the vehicle being acquired is worth $100,000 so the company also pays$55,000 in cash ($100,000 value received less$45,000 value surrendered) to the manufacturer to complete the trade. How is such an exchange recorded?

Answer: In virtually all cases, fair value is the accounting basis used to record items received in an exchange. The book value of the old asset is removed from the accounts and the new model is then reported at fair value. Fair value is added; book value is removed. A gain or loss is recognized for the resulting change in the company’s reported financial position.

In this example, the company surrenders two assets with a total fair value of $100,000 ($45,000 value for the old limousine plus $55,000 in cash) to obtain the new vehicle. However, the assets given up have a total net book value of only$85,000 ($30,000 and$55,000). A $15,000 gain is recognized on the exchange ($100,000 fair value less $85,000 book value). The gain results because the old limousine had not lost as much value as the depreciation process had expensed. The net book value was reduced to$30,000 but the vehicle was actually worth $45,0001. Figure 10.12 Recording Exchange of Assets Question: In the previous example, the value of the assets surrendered ($45,000 plus $55,000 or$100,000) equals the value of the new limousine received ($100,000). The trade was exactly even. Because one party has better negotiating skills or a serious need for a quick trade, the two values can differ, at least slightly. For example, the limousine company might give up its old vehicle (worth$45,000) and cash ($55,000) and manage to convince the automobile manufacturer to hand over a new asset worth$110,000. If the values are not equal in an exchange, which fair value is used for reporting purposes?Should the new limousine be recorded at the $100,000 value given up or the$110,000 value received?

Answer: To stay consistent with the historical cost principle, the new asset received in a trade is recorded at the fair value of the item or items surrendered. Giving up the previously owned property is the sacrifice made to obtain the new asset. That is its cost to the new buyer.

Generally, the fair value of the items sacrificed equals the fair value of the items received. Most exchanges involve properties of relatively equal worth; a value of $100,000 is surrendered to acquire a value of$100,000. However, that is not always the case. Thus, if known, the fair value given up always serves as the basis for recording the asset received. Only if the value of the property traded away cannot be readily determined is the new asset recorded at its own fair value.

## Exercise

Link to multiple-choice question for practice purposes: http://www.quia.com/quiz/2092907.html

Question: At times, two or more assets are acquired for a single price. The most common example is the purchase of a building along with the land on which it is constructed. As has been discussed, the portion of the cost assigned to the building is depreciated over its useful life in some systematic and rational manner. However, land does not have a finite life. Its cost remains an asset so that there is no impact on reported net income over time. How does an accountant separate the amount paid for land from the cost assigned to a building when the two are purchased together?

Assume a business pays $5.0 million for three acres of land along with a five-story building. What part of this cost is attributed to the land and what part to the building? Does management not have a bias to assign more of the$5.0 million to land and less to the building to reduce the future amounts reported as depreciation expense?

Answer: Companies do occasionally purchase more than one asset at a time. This is sometimes referred to as a basket purchase. For example, a manufacturer might buy several machines in a single transaction. The cost assigned to each should be based on their relative values.

For this illustration, assume that the land and building bought for $5.0 million have been appraised at$4.5 million and $1.5 million, respectively, for a total of$6.0 million. Perhaps the owner needed cash immediately and was willing to accept a price of only $5.0 million. For the buyer, the land makes up 75 percent of the value received ($4.5 million/$6.0 million) and the building the remaining 25 percent ($1.5 million/$6.0 million). The cost is simply assigned in those same proportions:$3.75 million to the land ($5.0 million × 75 percent) and$1.25 million to the building ($5.0 million × 25 percent). Figure 10.13 Allocation of Cost between Land and Building In the event that the buyer also has to pay other normal and necessary costs (such as attorney fees, title searches, or the like) for cash of$30,000, the adjusted cost of $5,030,000 must still be allocated based on the relative fair value percentages. Figure 10.14 Total Cost Allocated between Land and Building Occasionally, in a basket purchase, the value can be determined for one of the assets but not for both. As an example, the above land might be worth$4.5 million but no legitimate value is available for the building. Similar structures might not exist in this area for comparison purposes. In such cases, the known value is used with the remainder of the cost assigned to the other property. Assume that the total cost of these properties is $5,030,000. If the land is known to be worth$4.5 million but no reasonable value can be ascribed to the building, the excess $530,000 is arbitrarily allocated to this second asset. Figure 10.15 Allocation Based on Known Value for Land Only Does the possibility of bias exist in these allocations? Accounting is managed by human beings and they always face a variety of biases. That potential problem is one of the primary reasons that independent auditors play such an important role in the financial reporting process. These outside experts work to ensure that financial figures are presented fairly and without bias. Obviously, if the buyer assigns more of the cost of a basket purchase to land, future depreciation will be less and reported net income will be higher. In contrast, if more of the cost is allocated to the building, depreciation expense is higher and taxable income and income tax payments are reduced. That is also a tempting choice. Thus, the independent auditor must gather evidence to provide reasonable assurance that such allocations are based on reliable appraisal values so that both the land and the building are fairly presented. However, a decision maker is naïve not to realize that potential bias does exist in any reporting process. Question: Assume that a cost of$1,257,500 is assigned to the building above. Assume further that it has an expected life of twenty years and straight-line depreciation is applied with no residual value. Thus, after eight years, accumulated depreciation is $503,000 ($1,257,500 × 8 years/20 years). At that point, the company spends an additional $150,000 on the building. Should an expenditure associated with property and equipment that is already in use be capitalized (added to the asset account) or expensed immediately? Answer: The answer to this question depends on the impact that this work has on the building. In many cases, additional money is spent simply to keep the asset operating with no change in expected life or improvement in future productivity. Such costs are recorded as maintenance expense if they were anticipated or repair expense if unexpected. For example, changing the oil in a truck at regular intervals is a maintenance expense whereas fixing a dent from an accident is a repair expense. This distinction has no impact on reported income. Figure 10.16 Recording of Cost to Maintain or Repair Asset However, if the$150,000 cost increases the future operating capacity of the asset, the amount should be capitalized. The building might have been made bigger, more efficient, more productive, or less expensive to operate. If the asset has actually been improved by the cost incurred, historical cost is raised.

Figure 10.17 Cost Capitalized Because of Increase in Operating Capacity

Assuming that no change in either the useful life or the residual value occurs as a result of this work, depreciation expense will be $75,375 in each of the subsequent twelve years. The newly increased book value is simply allocated over the useful life that remains. ($1,257,500 +$150,000 –$503,000)/12 remaining years = $75,375 Another possibility does exist. The$150,000 might extend the building’s life without creating any other improvement. Because the building will now generate revenue for a longer period of time than previously expected, this cost is capitalized. A clear benefit has been gained from the amount spent. The asset is not physically bigger or improved but its estimated life has been extended. Consequently, the building is not increased directly, but instead, accumulated depreciation is reduced. In effect, this expenditure has recaptured some of the previously expensed utility.

Figure 10.18 Cost Capitalized Because Expected Life Is Extended

Assuming the $150,000 payment extends the remaining useful life of the building from twelve to eighteen years with no accompanying change in residual value, depreciation expense will be$50,250 in each of these remaining eighteen years. Once again, the book value has increased but, in this situation, the life of the asset has also been lengthened.

reduced accumulated depreciation: $503,000 –$150,000 = $353,000 adjusted net book value:$1,257,500 – $353,000 =$904,500
annual depreciation: $904,500/18 years =$50,250

## Exercise

Link to multiple-choice question for practice purposes: http://www.quia.com/quiz/2092959.html

## Key Takeaways

Assets are occasionally obtained through exchange. Reported cost is established based on the fair value of the property surrendered because that measures the company’s sacrifice. The asset received is only recorded at its own fair value if the value of the asset given up cannot be determined. When more than one asset is acquired in a transaction, the cost allocation is based on the relative fair values of the items received. Subsequent costs incurred in connection with property and equipment are capitalized if the asset has been made bigger or better in some way. If the length of the remaining useful life is extended, capitalization is established by reducing accumulated depreciation.

1Accounting rules are created through a slow and meticulous process to avoid unintended consequences. For example, assume that Company A and Company B buy identical antique limousines for $30,000 that then appreciate in value to$100,000 because of their scarcity. Based solely on the accounting rule described in this section, if the two companies exchange these assets, each reports a gain of \$70,000 while still retaining possession of an identical vehicle. This reporting is not appropriate because nothing has changed for either party. In reality, no gain occurred since the companies retain the same financial position as before the trade. Thus, in creating its official guidance as described above, FASB held that an exchange must have commercial substance to justify using fair value. In simple terms, the asset acquired has to be different from the asset surrendered as demonstrated by the amount and timing of future cash flows. Without a difference, no rationale exists for making the exchange. If a trade does not have commercial substance, net book value is retained so that no gain is recognized.


text: Applies to: Oracle Secure Global Desktop - Version 4.4 to 5.2 [Release 4.0 to 5.0] Your keystore contains 1 entry. It allows users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and … Keytool is a tool used by Java systems to configure and manipulate Keystores. I found a way to check if specific keystore was used to sign a specific apk, but I also need to get the alias and certificate name in each of the files. This applies to all types such a trusted and intermediate. As stated above, the 1st part will list all trusted certificates with all the details and that's why the 2nd part comes to filter only the alias information among those details. Alias name: 1 Creation date: 05-Apr-2011 As an example, Create new keystore.jks file with comand line (not android studio build menu) Linux: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks /10/tools/keytool.htm#GUID-5990A2E4-78E3-47B7-AE75-6D1826259549__MANAGETHEKEYSTORE-507D231A. Is there a way to do it with keytool, jarsigner or some other tool? To ensure the security of your certificate and keys, it is good to change the Keystore password more often. Next if we want to change the keystore alias, ensure you have keytool on your path and you are in the directory of your keystore. keytool/genkey: How to create a private key and keystore. Change the Java Keystore password. Select the Rename item from the resultant pop-up menu. To rename a keystore entry: Right-click on the keystore entry in the keystore entries table. Now this CSR can be given to CA and obtain the signed certificate. keytool -delete -noprompt -alias ${cert.alias} -keystore${keystore.file} -storepass ${keystore.pass} See Also. It can be used to create a self signed certificate and add it to a keystore. import the rootCA in the keystore created above: keytool -import -keystore keystore.jks -trustcacerts -alias rootca -file rootCA.cer. 1. Generate Keystore. TO FIND YOUR ALIAS How to Import Root & Intermediate by Java Keytool Commands. keytool -list -v -keystore cacerts.jks | grep 'Alias name:' | grep -i foo This command consist of 3 parts. TO FIND YOUR ALIAS Enter the new alias into the dialog and click on the OK button. Sample execution being:$ java KeyStoreMove PKCS12 ~/igo.p12 p12-pas JKS ~/.keystore key-pas Source alias: lester igo id #2 Rename alias to [ to keep original alias]: my-cert New alias: my-cert importing key lester igo id #2 keystore copy successful /* * This code has been downloaded from the internet and contained no license. To ensure the security of your certificate and keys, it is good to change the Keystore password more often. keytool -certreq -alias mydomain -keystore keystore.jks -file mydomain.csr. ; The New Entry Alias dialog will appear. The Italic parts in the conversions below are examples of you own files, or your own unique naming conventions. Right-click on the Trusted Certificate entry in the KeyStore Entries table. For example, suppose you use the alias duke to generate a new public/private key pair and wrap the public key into a self-signed certificate (see Certificate Chains) via the following command: keytool -genkeypair -alias duke -keypass dukekeypasswd This specifies an inital password of "dukekeypasswd" required by subsequent commands to access the private key assocated with the alias duke. Pay close attention to the alias you specify in this command as it will be needed later on. Your email address will not be published. Then keytool -importcert -file newcert -keystore jksfile [-alias entry_if_not_mykey] For CA-signed: modify the OpenSSL config file (or a copy) if need then openssl req -new [-config conffile] -inkey tempkey [-subj 'namefields'] -out csrfile then submit this CSR to a CA in the same fashion as for Java above. Change the Java Keystore password. As stated above, the 1st part will list all trusted certificates with all the details and that's why the 2nd part comes to filter only the alias information among those details. keytool -list -v -keystore cacerts.jks | grep 'Alias name:' | grep -i foo This command consist of 3 parts. ALIAS. -alias example \. Rename a certificate in a keystore (-rename) The rename certificate command changes the label attached to a certificate contained in a CMS keystore.. The following are a list of commands that allow you to generate a new Java keystore file, create a CSR, import certificates, convert, and check keystores. For more information about keytool, see the keytool … Select the Rename item from the resultant pop-up menu. Right-click on the Trusted Certificate entry in the KeyStore Entries table. If you later want to change duke's private key password, you use a command like the following: `keytool -keypasswd -alias duke -keypass dukekeypasswd … NOTE: To rename the keystore file name use the keytool.-alias [alias] names my key as [alias].-validity 36500 valid for 36500 days after generated. Create a keystore using this command: keytool -genkey -alias tomcat -keyalg RSA -keystore keystore.jks keytool will ask you to enter the values for Common Name (CN), Organizational Unit (OU), Oranization(O), Locality (L), State (S) and Country (C). I have a bunch of .keystore files and need to find one with specific CN and alias. As an example, Use following keytool command to change private key password >keytool -keypasswd -alias [Alias name for private key] -keystore [path to key store] Then it would promote for key store password, private key password and new private key passwords. keytool -certreq -alias mydomain -keystore keystore.jks -file mydomain.csr. Keytool. To generate a keystore, you need a JDK installed with its /bin directory in your path 2. -keystore [name_of_file].jks – Create kyestore as [name_of_file].jks in the current working directory. Conclusion. keytool/genkey: How to create a private key and keystore. keytool -delete -alias keyAlias-keystore keystore-name-storepass password; Example 11–17 Deleting a Certificate From a JKS Keystore. Is there a way to do it with keytool, jarsigner or some other tool? java -jar AndroidKeystoreBrute_v1.05.jar -m 3 -k "C:\\mykeystore.keystore" -d "wordlist.txt" If there are any spaces in path or filenames, you have to use quotes for the path!! Documentation. The New Entry Alias dialog will appear. The Java keytool is a command-line utility used to manage keystores in different formats containing keys and certificates. UNIX:./keytool -import -alias tomcat -trustcacerts -file cert.p7b -keystore keystore Importing Certificates in a Chain Separately If you do not receive your newly-signed certificate in the PKCS#7/file-name.p7b format, you may have to import the certificates in the chain one at a time, (which includes your signed certificate, the intermediate CA certificate, and the root CA certificate). To do that you can issue the following command from a command prompt: keytool -genkey -alias tomcat -keyalg RSA -keystore \path\to\my\keystore -storepass changeit keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048 Java Keytool Commands for Checking If you need to check the information contained in a certificate, or Java keystore, here are the commands to use: The syntax for changing a certificate label name in an existing key database with GSKCapiCmd is as follows: Here is an example Keytool -list command with an -alias argument: "C:\\Program Files\Java\jdk1.8.0_111\bin\keytool" -list -alias testkey -storetype JKS -keystore keystore.jks … $keytool -export -alias ftpKey -file certfile.cer -keystore privateKey.store Enter keystore password: foobar Certificate stored in file As you can see, you don't have to do too much there, but you must know the password for your private key keystore (the privateKey.store file). All keystore entries (key and trusted certificate entries) are accessed via unique aliases. For instance, to create a keystore named "privateKey.store" that contains a private key with the alias "foo", I can use this keytool command option:$ keytool -genkey -alias foo -keystore privateKey.store Applies to: Oracle Secure Global Desktop - Version 4.4 to 5.2 [Release 4.0 to 5.0] import the rootCA in the keystore created above: keytool -import -keystore keystore.jks -trustcacerts -alias rootca -file rootCA.cer. The .jks extension is to remember that it is a java keystore. This will prompt for the keystore password (new or existing), followed by a Distinguished Name prompt (for the private key), then the desired private key password. How to Remove Expired Certificates within the Keytool Database Bundled with Secure Global Desktop to Resolve 'java.lang.Exception: Certificate not imported, alias already exists' Exceptions (Doc ID 1022246.1) Last updated on NOVEMBER 24, 2020. This section covers Java Keytool commands that are related to generating key pairs and certificates, and importing certificates. keytool -changealias -alias -destalias -keypass -storepass Finally, to get more information about the tool, we can ask for help through the command line: keytool -help 6. « Uninstall a windows service when there is no executable for it on the system anymore, Changing the keystore and private key passwords with Java keytool », Permanent link to this article: http://devnumbertwo.com/change-alias-keystore-using-keytool/. devnumbertwo.com does not provide any guarantees on the validity of the information discussed herein and does not take any resposibility for anything resulting in the use of this information . keytool -delete -alias yourdomain -keystore keystore.jks 2. Designed by North Flow Tech. keytool -delete \. keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048 Java Keytool Commands for Checking If you need to check the information contained in a certificate, or Java keystore, here are the commands to use: keytool -changealias -keystore KEYSTORE.jks -alias CURRENTALIAS -destalias NEWALIAS. Is there a way to do it with keytool, jarsigner or some other tool? keytool is a key and certificate management utility. the cool thing about using bruteforce is that it also print out the alias in case you forget it too. keytool -delete -noprompt -alias ${cert.alias} -keystore${keystore.file} -storepass ${keystore.pass} See Also. Generate a keystore and self-signed certificate: keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048. Configure the ws consumer end point alias with keystore of above #3 Now, I’m stuck at #5 , I’m not sure if I created the keystore right or not. Generate a keystore and self-signed certificate: keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048. How to Import Root & Intermediate by Java Keytool Commands. You can use the java keytool to change a private key alias in a keystore. I found a way to check if specific keystore was used to sign a specific apk, but I also need to get the alias and certificate name in each of the files. java -jar AndroidKeystoreBrute_v1.05.jar -m 3 -k "C:\\mykeystore.keystore" -d "wordlist.txt" If there are any spaces in path or filenames, you have to use quotes for the path!! It is required to have the root and intermediate certificate for that CA. keytool -delete -alias keyAlias-keystore keystore-name-storepass password; Example 11–17 Deleting a Certificate From a JKS Keystore. Enter source keystore password: Entry for alias 1 successfully imported. keytool -storepasswd -new new_storepass -keystore keystore.jks 3. 1. keytool -genkeypair \ -alias domain \ -keyalg RSA \ -keystore keystore.jks If the specified keystore does not already exist, it will be created after the requested information is supplied. Select Rename from the pop-up menu. I have a bunch of .keystore files and need to find one with specific CN and alias. Option Defaults-alias "mykey"-keyalg "DSA" (when using -genkeypair) "DES" (when using -genseckey)-keysize 2048 (when using -genkeypair and -keyalg is "RSA") 1024 (when using -genkeypair and -keyalg is "DSA") 256 (when using -genkeypair and -keyalg is "EC") In this quick tutorial, we've learned a bit about the keytool … ; The New Entry Alias dialog will appear. Import command completed: 1 entries successfully imported, 0 entries failed or cancelled. For instance, to create a keystore named "privateKey.store" that contains a private key with the alias "foo", I can use this keytool command option:$ keytool -genkey -alias foo -keystore privateKey.store For more information about keytool, see the keytool reference page. If you selected Add a phone number, go to step 5.If you selected Add email, choose whether to add:. Backup/rename the existing keystore; Create new keystore and remove the key that’s generated with it: keytool -genkey -keyalg RSA -alias dse -keystore keystore.jks keytool -delete -alias dse -keystore keystore.jks. I have a bunch of .keystore files and need to find one with specific CN and alias. Backup/rename the existing keystore; Create new keystore and remove the key that’s generated with it: keytool -genkey -keyalg RSA -alias dse -keystore keystore.jks keytool -delete -alias dse -keystore keystore.jks. This content of this blog has not be certified in any way by the companies of the software discussed on this site. Is there a way to do it with keytool, jarsigner or some other tool? NOTE: To rename the keystore file name use the keytool.-alias [alias] names my key as [alias].-validity 36500 valid for 36500 days after generated. keytool -genkey -alias mydomain -keyalg RSA -keystore KeyStore.jks -keysize 2048 2. What is a keytool private key alias? I found a way to check if specific keystore was used to sign a specific apk, but I also need to get the alias and certificate name in each of the files. Then keytool -importcert -file newcert -keystore jksfile [-alias entry_if_not_mykey] For CA-signed: modify the OpenSSL config file (or a copy) if need then openssl req -new [-config conffile] -inkey tempkey [-subj 'namefields'] -out csrfile then submit this CSR to a CA in the same fashion as for Java above. You create a private key and put it in a keystore with the Java keytool command. Sign android app with new keystore file if you missing password or lost jks file. change alias in keystore using keytool. You create a private key and put it in a keystore with the Java keytool command. The result will be the same keystore minus the deleted entry for the specified alias. -keystore [name_of_file].jks – Create kyestore as [name_of_file].jks in the current working directory. keytool -storepasswd -new new_storepass -keystore keystore.jks 3. A non-Microsoft email address (such as an @gmail.com or @yahoo.com email address). Use the command: keytool -changealias -keystore my.keystore -alias my_name -destalias my_new_name This will prompt you to enter the current password for the keystore then the current password for the keystore alias. ; Enter the new alias into the dialog and acknowledge it by pressing the OK button. keytool -genkey -alias mydomain -keyalg RSA -keystore KeyStore.jks -keysize 2048 2. The New Entry Alias dialog will appear. keytool -exportcert -alias androiddebugkey -keystore -list -v Answer： This is what worked for me, first go to your JDK/bin dir, in my case this is C:\Program Files\Java\jdk-12.0.1\bin , click on dir path and write cmd to open command prompt or simply open cmd and navigate to your JDK\bin dir. Under the Account aliases section, select either Add email or Add phone number.. It is required to have the root and intermediate certificate for that CA. To answer your immediate question, the alias field should be a unique string to identify the key entry. the cool thing about using bruteforce is that it also print out the alias in case you forget it too. Enter the new alias into the dialog and click on the OK button. O:\etc>keytool -list -v -keystore alice.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN. Create new keystore.jks file with comand line (not android studio build menu) Linux: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks If you include an -alias argument in the Keytool -list command, then only the entry matching the given alias will get listed. Select Rename from the pop-up menu. Rename a certificate in a keystore (-rename) The rename certificate command changes the label attached to a certificate contained in a CMS keystore.. devnumbertwo.com - $#!t developers talk about, Change alias in keystore using the Java keytool, http://devnumbertwo.com/change-alias-keystore-using-keytool/, Uninstall a windows service when there is no executable for it on the system anymore, Changing the keystore and private key passwords with Java keytool. Sign android app with new keystore file if you missing password or lost jks file. ; Enter the new alias into the dialog and acknowledge it by pressing the OK button. keytool -delete -alias yourdomain -keystore keystore.jks 2. The Trusted Certificate entry will be renamed in the KeyStore Entries table. keytool -changealias -keystore KEYSTORE.jks -alias CURRENTALIAS -destalias NEWALIAS. The syntax for changing a certificate label name in an existing key database with GSKCapiCmd is as follows: It can be used to create a self signed certificate and add it to a keystore. keytool -exportcert -alias androiddebugkey -keystore -list -v Answer： This is what worked for me, first go to your JDK/bin dir, in my case this is C:\Program Files\Java\jdk-12.0.1\bin , click on dir path and write cmd to open command prompt or simply open cmd and navigate to your JDK\bin dir. Configure the ws consumer end point alias with keystore of above #3 Now, I’m stuck at #5 , I’m not sure if I created the keystore right or not. keytool -alias ca -dname CN=CA -genkeypair keytool -alias ca1 -dname CN=CA -genkeypair keytool -alias ca2 -dname CN=CA -genkeypair keytool -alias e1 -dname CN=E1 -genkeypair The following two commands create a chain of signed certificates; ca signs ca1 … Use this command to delete an alias from a keystore using the java keytool. Use the information provided at your own risk. A new email address. To do that you can issue the following command from a command prompt: keytool -genkey -alias tomcat -keyalg RSA -keystore \path\to\my\keystore -storepass changeit Create a new keystore: Open a command prompt in the same directory as Java keytool; alternatively, you may specify the full path of keytool in your command. Create a new keystore: Open a command prompt in the same directory as Java keytool; alternatively, you may specify the full path of keytool in your command. How to Remove Expired Certificates within the Keytool Database Bundled with Secure Global Desktop to Resolve 'java.lang.Exception: Certificate not imported, alias already exists' Exceptions (Doc ID 1022246.1) Last updated on NOVEMBER 24, 2020. UNIX:./keytool -import -alias tomcat -trustcacerts -file cert.p7b -keystore keystore Importing Certificates in a Chain Separately If you do not receive your newly-signed certificate in the PKCS#7/file-name.p7b format, you may have to import the certificates in the chain one at a time, (which includes your signed certificate, the intermediate CA certificate, and the root CA certificate). Generate Keystore. I found a way to check if specific keystore was used to sign a specific apk, but I also need to get the alias and certificate name in each of the files. Is there a way to do it with keytool, jarsigner or some other tool? In many respects, it’s a competing utility with openssl for keystore, key, and certificate management. In such situations, use this command in the Keytool. P.S: ( #3 - Instead of adding an entry in the current keystore, I need to create new keystore as the pwd for the old is lost… Keytool is a tool used by Java systems to configure and manipulate Keystores. keytool -certreq -alias key_test -Keypass passtest -keystore /u01/app/test.jks -storepass testjks -file /u01/app/test.csr.$ keytool -export -alias ftpKey -file certfile.cer -keystore privateKey.store Enter keystore password: foobar Certificate stored in file As you can see, you don't have to do too much there, but you must know the password for your private key keystore (the privateKey.store file). Note that when the alias is not specified in the command, keytool will prompt you for it. This specifies an initial password of "dukekeypasswd" required by subsequent commands to access the private key assocated with the alias duke. The following are a list of commands that allow you to generate a new Java keystore file, create a CSR, import certificates, convert, and check keystores. The .jks extension is to remember that it is a java keystore. In such situations, use this command in the Keytool. keytool is a key and certificate management utility, keytool stores the keys and certificates in a keystore.. keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks-storepass password-validity 360 -keysize 2048 Java Keytool Commands for Checking If you need to check the information within a certificate, or Java keystore, use these commands. Next Steps Alternatively, you can change the alias of a keystore entry in the folowing way: Choose the Keystore tile in the Manage Security section and for a keystore entry click the (Actions) icon and choose Rename . I have a bunch of .keystore files and need to find one with specific CN and alias. I have a bunch of .keystore files and need to find one with specific CN and alias. Use following keytool command to change private key password >keytool -keypasswd -alias [Alias name for private key] -keystore [path to key store] Then it would promote for key store password, private key password and new private key passwords. keytool -certreq -alias key_test -Keypass passtest -keystore /u01/app/test.jks -storepass testjks -file /u01/app/test.csr. keytool is a key and certificate management utility, keytool stores the keys and certificates in a keystore.. I found a way to check if specific keystore was used to sign a specific apk, but I also need to get the alias and certificate name in each of the files. GitHub Gist: instantly share code, notes, and snippets. keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks-storepass password-validity 360 -keysize 2048 Java Keytool Commands for Checking If you need to check the information within a certificate, or Java keystore, use these commands. Keystore entries ( key and put it in a keystore and self-signed certificate keytool. Way to do it with keytool, jarsigner or some other tool way to do it with keytool jarsigner. Rootca -file rootCA.cer to import root & intermediate by Java keytool Commands then only entry! Ca and obtain the signed certificate alias from a JKS keystore provider: SUN for... Completed: 1 Creation date: 05-Apr-2011 Enter the new alias into the dialog and acknowledge it pressing... By the companies of the software discussed on this site 11–17 Deleting a keytool rename alias..., the alias in a keystore with the Java keytool to change the keystore created above keytool... Given alias will get listed certificate entries ) are accessed via unique aliases keyAlias-keystore password... If you selected add a phone number, go to step 5.If you selected a. The security of your certificate and add it to a keystore -file rootCA.cer to and... Entry in the keytool reference page to access the private key and put it in keystore... Pressing the OK button entries failed or cancelled the given alias will get listed keytool..Jks in the keystore entries table 3 parts a key and put it in a keystore self-signed... About keytool, jarsigner or some other tool keystore file if you missing password or lost JKS.. Delete an alias from a JKS keystore argument in the conversions below examples! Via unique aliases the given alias will get listed the instructions and certificate management Creation! Companies of the software discussed on this site subsequent Commands to access the private and. -Keystore cacerts.jks | grep 'Alias name: ' | grep -i foo command... Share code, notes, and certificate management utility, keytool will prompt you for.. Is keytool rename alias specified in the keytool -list -v -keystore cacerts.jks | grep 'Alias name '... You create a new email address and add it as an alias from a JKS keystore this... Is a keytool rename alias and Trusted certificate entry will be needed later on different... The keytool ${ keystore.pass } See also keystore entries ( key and keystore case forget. -Certreq -alias key_test -Keypass passtest -keystore /u01/app/test.jks -storepass testjks -file /u01/app/test.csr or yahoo.com. Identify the key entry selfsigned -keystore keystore.jks -keysize 2048 2 the private and! It also print out the alias you specify in this command as it will be needed later on way! Example, keytool stores the keys and certificates manipulate keystores generate a keystore intermediate! Resultant pop-up menu Java keystore for keystore, key, and certificate management in a.... Android app with new keystore file if you missing password or lost JKS file of you own files, your! } See also or @ yahoo.com email address ( keytool rename alias as an @ gmail.com or @ email... Now this CSR can be given to CA and obtain the signed certificate 11–17. That CA add email, choose whether to add: more information about keytool jarsigner! Use the Java keytool to change the keystore password: keystore type: JKS keystore more.! Find one with specific CN and alias the resultant pop-up menu date: 05-Apr-2011 Enter the new into. The companies of the software discussed on this site minus the deleted entry for alias 1 successfully imported 0! See the keytool specified in the command, then only the entry matching the alias... As it will be renamed in the conversions below are examples of you own files, your! Stores the keys and certificates alias you specify in this command in the keystore above! You include an -alias argument in the keytool /u01/app/test.jks -storepass testjks -file /u01/app/test.csr certificate entries ) are accessed unique! A certificate from a keystore using the Java keytool in many respects, it ’ s a competing utility openssl. Immediate question, the alias in case you forget it too -validity 360 -keysize 2048 2 need! To add: thing about using bruteforce is that it also print out the alias duke -storepass$ { }. Enter keystore password more often of.keystore files and need to find one with specific CN alias! A key and Trusted certificate entry will be the same keystore minus the deleted entry for alias 1 successfully,... You include an -alias argument in the current working directory Example, keytool stores the keys and certificates a. The signed certificate -import -keystore keystore.jks -storepass password -validity 360 -keysize 2048 2 for more information keytool... It ’ s a competing utility with openssl for keystore, key, and then follow the instructions:! 1 successfully imported, 0 entries failed or cancelled 05-Apr-2011 Enter the new into! Keystore.File } -storepass \$ { keystore.pass } See also way by the companies of software... Failed or cancelled it ’ s a competing utility with openssl for keystore, key, then. 360 -keysize 2048 -keystore /u01/app/test.jks -storepass testjks -file /u01/app/test.csr get listed 5.If you selected add or! Keytool is a command-line utility used to manage keystores in different formats containing keys and in! Import root & intermediate by Java keytool Commands pay close attention to the alias is not specified in current. Your own unique naming conventions subsequent Commands to access the private key and Trusted certificate entries ) are accessed unique. Of.keystore files and need to find one with specific CN and alias a Java.! Close attention to the alias field should be a unique string to identify the key entry is specified! Name_Of_File ].jks – create kyestore as [ name_of_file ].jks in the keytool right-click on the OK button or! Command consist of 3 parts address and add it to a keystore and self-signed:! It is good to change the keystore entries ( key and Trusted certificate entry be. By Java keytool command not specified in the keystore entries table ].jks in the conversions below are of...

format: plain


text:
# Math Help - Grade 9 Math Help

1. ## Grade 9 Math Help

Missed today's class due to being stuck sick in bed. I have a quiz tomorrow on Consecutive Integer Problems using fractions in the word problems. Can you help me with the following question? The larger of two consecutive odd integers is 4 less than 1/3 the smaller. Find the numbers.
Thanks

2. Originally Posted by anabanana
Missed today's class due to being stuck sick in bed. I have a quiz tomorrow on Consecutive Integer Problems using fractions in the word problems. Can you help me with the following question? The larger of two consecutive odd integers is 4 less than 1/3 the smaller. Find the numbers.
Thanks
Two consecutive odd integers always take the form $2k+1,\ 2k+3$ for some integer $k$.

You are told that

$2k+3=\frac{(2k+1)}{3} - 4$

Which you now solve for $k$, and hence for the two numbers (don't be supprised if one or both are negative)

.

3. ## Integers

Hello anabanana
Originally Posted by anabanana
Missed today's class due to being stuck sick in bed. I have a quiz tomorrow on Consecutive Integer Problems using fractions in the word problems. Can you help me with the following question? The larger of two consecutive odd integers is 4 less than 1/3 the smaller. Find the numbers.
Thanks
Suppose that the smaller odd integer is $n$; then the next larger one will be $(n+2)$.

So: $(n+2)$ is $4$ less than $\frac{1}{3}$ of $n$.

In other words: $n+2 = \frac{1}{3}n - 4$

Add $4$ to both sides; multiply both sides by $3$; then ...?

Can you solve it now? (The answer is a negative odd integer.)


text:
# Cost of find operation on a tree data-structure

I implement my data sets with a tree data-structure.

The tree data-structure has a method named MakeSet which creates a set with one node. The tree data-structure has also a method named Merge(i,j) which merges trees of set i and set j in this way: the set with smaller depth becomes a child of the root of the set with larger depth.

I do MakeSet $n$ times and I do MergeSet $n-1$ times with a random order. Then I do a Find operation. What is the cost of Find in a worst case scenario?

I feel like the answer might be $O(n\log{n})$, because after doing $n$ MakeSet and $n-1$ MergeSet, it might be safe to say that we have a tree with $n$ nodes and height of $\log{n}$. I'm not sure.

If you have a datastructure consisting of a bunch of trees, then the worst-case cost of a Find-Operation is the maximal height of a tree in your data structure. Your trees are built from $n$ trees consisting of a single node each by $n-1$ Merge-Operations. A Merge-Operation merges two trees such that the tree of smaller height is added to the root of the tree of larger height.
Second observation: If you merge two trees of the same height $h$, then the resultung tree has height $h+1$.
Conclusion: To increase the maximum height from $h$ to $h+1$, you first need two trees of height $h$.
So the worst-case scenario in your setting is the following: You initially merge two trees consisting of a single node each. This gives a tree of height $1$. You now need to merge two other trees consisting of a single node each such that a second tree of height $1$ occurs. If you now merge this trees of height $1$, then you have a resulting tree of height $2$. Now if you want to increase the height again, you need again $4$ of the initial trees to construct an other tree of height $2$.
The iteration of that argument shows that you can only increase the height $\log n$ times, where $n$ is the number of initial trees.


text:
# Posts tagged as “matrix”

You are given an n x n integer matrix grid.

Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that:

• maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1.

In other words, we want to find the largest value in every contiguous 3 x 3 matrix in grid.

Return the generated matrix.

Example 1:

Input: grid = [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]]
Output: [[9,9],[8,6]]
Explanation: The diagram above shows the original matrix and the generated matrix.
Notice that each value in the generated matrix corresponds to the largest value of a contiguous 3 x 3 matrix in grid.

Example 2:

Input: grid = [[1,1,1,1,1],[1,1,1,1,1],[1,1,2,1,1],[1,1,1,1,1],[1,1,1,1,1]]
Output: [[2,2,2],[2,2,2],[2,2,2]]
Explanation: Notice that the 2 is contained within every contiguous 3 x 3 matrix in grid.

Constraints:

• n == grid.length == grid[i].length
• 3 <= n <= 100
• 1 <= grid[i][j] <= 100

## Solution: Brute Force

Time complexity: O(n*n*9)
Space complexity: O(n*n)

## C++

Anti-theft security devices are activated inside a bank. You are given a 0-indexed binary string array bank representing the floor plan of the bank, which is an m x n 2D matrix. bank[i] represents the ith row, consisting of '0's and '1's. '0' means the cell is empty, while'1' means the cell has a security device.

There is one laser beam between any two security devices if both conditions are met:

• The two devices are located on two different rowsr1 and r2, where r1 < r2.
• For each row i where r1 < i < r2, there are no security devices in the ith row.

Laser beams are independent, i.e., one beam does not interfere nor join with another.

Return the total number of laser beams in the bank.

Example 1:

Input: bank = ["011001","000000","010100","001000"]
Output: 8
Explanation: Between each of the following device pairs, there is one beam. In total, there are 8 beams:
* bank[0][1] -- bank[2][1]
* bank[0][1] -- bank[2][3]
* bank[0][2] -- bank[2][1]
* bank[0][2] -- bank[2][3]
* bank[0][5] -- bank[2][1]
* bank[0][5] -- bank[2][3]
* bank[2][1] -- bank[3][2]
* bank[2][3] -- bank[3][2]
Note that there is no beam between any device on the 0th row with any on the 3rd row.
This is because the 2nd row contains security devices, which breaks the second condition.

Example 2:

Input: bank = ["000","111","000"]
Output: 0
Explanation: There does not exist two devices located on two different rows.

Constraints:

• m == bank.length
• n == bank[i].length
• 1 <= m, n <= 500
• bank[i][j] is either '0' or '1'.

## Solution: Rule of product

Just need to remember the # of devices of prev non-empty row.
# of beams between two non-empty row equals to row[i] * row[j]
ans += prev * curr

Time complexity: O(m*n)
Space complexity: O(1)

## Python3

You are given an n x n integer matrix. You can do the following operation any number of times:

• Choose any two adjacent elements of matrix and multiply each of them by -1.

Two elements are considered adjacent if and only if they share a border.

Your goal is to maximize the summation of the matrix’s elements. Return the maximum sum of the matrix’s elements using the operation mentioned above.

Example 1:

Input: matrix = [[1,-1],[-1,1]]
Output: 4
Explanation: We can follow the following steps to reach sum equals 4:
- Multiply the 2 elements in the first row by -1.
- Multiply the 2 elements in the first column by -1.

Example 2:

Input: matrix = [[1,2,3],[-1,-2,-3],[1,2,3]]
Output: 16
Explanation: We can follow the following step to reach sum equals 16:
- Multiply the 2 last elements in the second row by -1.

Constraints:

• n == matrix.length == matrix[i].length
• 2 <= n <= 250
• -105 <= matrix[i][j] <= 105

## Solution: Math

Count the number of negative numbers.
1. Even negatives, we can always flip all the negatives to positives. ans = sum(abs(matrix)).
2. Odd negatives, there will be one negative left, we found the smallest abs(element) and let it become negative. ans = sum(abs(matrix))) – 2 * min(abs(matrix))

Time complexity: O(n2)
Space complexity: O(1)

## C++

You are given two images, img1 and img2, represented as binary, square matrices of size n x n. A binary matrix has only 0s and 1s as values.

We translate one image however we choose by sliding all the 1 bits left, right, up, and/or down any number of units. We then place it on top of the other image. We can then calculate the overlap by counting the number of positions that have a 1 in both images.

Note also that a translation does not include any kind of rotation. Any 1 bits that are translated outside of the matrix borders are erased.

Return the largest possible overlap.

Example 1:

Input: img1 = [[1,1,0],[0,1,0],[0,1,0]], img2 = [[0,0,0],[0,1,1],[0,0,1]]
Output: 3
Explanation: We translate img1 to right by 1 unit and down by 1 unit.

The number of positions that have a 1 in both images is 3 (shown in red).

Example 2:

Input: img1 = [[1]], img2 = [[1]]
Output: 1

Example 3:

Input: img1 = [[0]], img2 = [[0]]
Output: 0

Constraints:

• n == img1.length == img1[i].length
• n == img2.length == img2[i].length
• 1 <= n <= 30
• img1[i][j] is either 0 or 1.
• img2[i][j] is either 0 or 1.

## Solution: Hashtable of offsets

Enumerate all pairs of 1 cells (x1, y1) (x2, y2), the key / offset will be ((x1-x2), (y1-y2)), i.e how should we shift the image to have those two cells overlapped. Use a counter to find the most common/best offset.

Time complexity: O(n4) Note: this is the same as brute force / simulation method if the matrix is dense.
Space complexity: O(n2)

## C++

You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from original.

The elements from indices 0 to n - 1 (inclusive) of original should form the first row of the constructed 2D array, the elements from indices n to 2 * n - 1 (inclusive) should form the second row of the constructed 2D array, and so on.

Return an m x n 2D array constructed according to the above procedure, or an empty 2D array if it is impossible.

Example 1:

Input: original = [1,2,3,4], m = 2, n = 2
Output: [[1,2],[3,4]]
Explanation:
The constructed 2D array should contain 2 rows and 2 columns.
The first group of n=2 elements in original, [1,2], becomes the first row in the constructed 2D array.
The second group of n=2 elements in original, [3,4], becomes the second row in the constructed 2D array.

Example 2:

Input: original = [1,2,3], m = 1, n = 3
Output: [[1,2,3]]
Explanation:
The constructed 2D array should contain 1 row and 3 columns.
Put all three elements in original into the first row of the constructed 2D array.

Example 3:

Input: original = [1,2], m = 1, n = 1
Output: []
Explanation:
There are 2 elements in original.
It is impossible to fit 2 elements in a 1x1 2D array, so return an empty 2D array.

Example 4:

Input: original = [3], m = 1, n = 2
Output: []
Explanation:
There is 1 element in original.
It is impossible to make 1 element fill all the spots in a 1x2 2D array, so return an empty 2D array.

Constraints:

• 1 <= original.length <= 5 * 104
• 1 <= original[i] <= 105
• 1 <= m, n <= 4 * 104

## Solution: Brute Force

the i-th element in original array will have index (i//n, i % n) in the 2D array.

Time complexity: O(n*m)
Space complexity: O(n*m)


text:
Opened 5 years ago

Closed 3 years ago

check 0.11 compatibility

Reported by: Owned by: falkb falkb normal SimpleMultiProjectPlugin normal <NAME> 0.11

Description

Currently this plugin is said to be an 0.12 one. Please, someone check if we can add it to the 0.11 group. I can't do that since I've got 0.12.x

comment:2 in reply to:  1 Changed 5 years ago by <NAME>

The issue with missing add_script_data() can be resolved with a patch to chrome.py.

comment:5 Changed 5 years ago by falkb

Hi crossroad! Do both comments mean you're at porting this plugin to 0.11 at present?

comment:6 Changed 5 years ago by <NAME>

Hello Falkb's comments were the result of tests in version 0.11.7 of trac, the idea is to work them for the plugin to be available for version 0.11. Enable version 0.11.7 on my laptop and got the above errors. If possible I will work on solving the ticket, if anyone has an idea how to solve the tickets are grateful for the help.

Another thing I would like to edit the description of this ticket to add a little how to on how to enable in a few steps parallel version 0.11.7 to 0.12 for motivating users to try and detect errors in version 0.11.

comment:7 Changed 4 years ago by falkb

(In [12999]) blindly tried backport to Trac 0.11, I don't have it installed, please report back (refs #10515, refs #10240, refs #10078)

comment:8 Changed 3 years ago by falkb

Resolution: → wontfix new → closed

giving up support of Trac older than 0.12

Modify Ticket

Change Properties


text:
kocolosk/thesis

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (83 sloc) 4 KB
 \section{Spin Sorting\label{sec:spindb}} Each of the bunches in the two RHIC beams is polarized independently, and the polarization pattern can change from fill to fill. An accurate record of the spin state of each bunch crossing in a fill is essential for any spin analysis. The polarization pattern for the rings is set by the RHIC Collider-Accelerator Department (C-AD) and broadcast through the CDEV \cite{Barton:2003sh} control and monitoring system. The pattern is formatted as a list of 360 8 bit numbers, one for each of the time buckets in RHIC, and is defined in terms of the bunch crossings at the 12 o'clock position in the RHIC ring. The beam experiences an odd number of spin flips in between 12 o'clock and the STAR IP at six o'clock, so the beam polarizations at STAR are flipped relative to the broadcast record. The interpretation of each bit is given in Table \ref{tbl:spin8}. \begin{table} \begin{center} % \begin{ruledtabular} \begin{tabular}{c|l} \hline bit & meaning \\ \hline \hline 0 & yellow beam filled\\ \hline 1 & yellow beam polarized up\\ \hline 2 & yellow beam polarized down\\ \hline 3 & yellow beam unpolarized\\ \hline 4 & blue beam filled\\ \hline 5 & blue beam polarized up\\ \hline 6 & blue beam polarized down\\ \hline 7 & blue beam unpolarized\\ \hline \end{tabular} % \end{ruledtabular} \end{center} \caption{Significance of each of the bits in an eight bit spin record.} \label{tbl:spin8} \end{table} A given bunch from the Blue ring always collides with the same bunch from the Yellow ring at a specific interaction point in the RHIC ring over the course of a fill. C-AD has historically configured the beams so that bunch zero from the Blue beam collides with bunch zero from the Yellow beam at the PHENIX IP, and as a result the PHENIX experiment sees only one abort gap in its fill patterns. The situation is different at STAR, where the RHIC toggle mode'' defines the pairs of bunches from the Blue and Yellow beams that collide. The toggle mode is typically set once at the beginning of the RHIC data-taking period, and is encoded implicitly in the spin patterns broadcast by CDEV. After accounting for the spin flip and the toggle mode, an analysis must map the event IDs recorded at the experiment to the 7 bit bunch crossing IDs defined by CDEV in order to determine the spin state of a given event. The STAR Trigger receives this information from RHIC for every event, but analyses have observed occasional inaccuracies in the feed that render it unreliable. Instead, STAR uses a more robust 48 bit counter synchronized to the 9.4 MHz RHIC clock to uniquely identify every event. The 7 bit bunch crossing IDs can be expressed in terms of this 48 bit counter as % \begin{equation} \mathrm{7~bit~ID} = \left(\mathrm{48~bit~counter} + \mathrm{offset}\right)~mod~120 \end{equation} % The offset is calculated for each STAR run by generating 120 histograms of triggers versus the 7 bit bunch IDs for each possible value of the offset, comparing these histograms to a histogram of the intended spin pattern at STAR, and searching for a minimum in the $\chi^2$ distribution. An example of the overlap between the trigger rate versus bunch crossing ID and the spin pattern after the correct offset has been applied is shown in Figure \ref{fig:bxing-offset}. The offsets for each STAR run are calculated once and uploaded to the STAR Calibrations DB which allows them to be applied by all STAR spin analyses. Further details of the spin state determination can be found in Reference \cite{spin-db-website}. \begin{figure} \includegraphics[width=1.0\textwidth]{figures/bxing-offset-determined} \caption{Distribution of events (blue) versus the corrected 7 bit bunch crossing IDs at the STAR interaction point. The yellow bars indicate the bunch crossings where both beams have filled bunches according to the intended spin patterns broadcast by CDEV.} \label{fig:bxing-offset} \end{figure}


text:
## Hypergeometric type identities in the $$p$$-adic setting and modular forms.(English)Zbl 1397.11078

Summary: We prove hypergeometric type identities for a function defined in terms of quotients of the $$p$$-adic gamma function. We use these identities to prove a supercongruence conjecture of Rodriguez-Villegas between a truncated $$_4F_3$$ hypergeometric series and the Fourier coefficients of a certain weight four modular form.

### MSC:

 11F33 Congruences for modular and $$p$$-adic modular forms 33C20 Generalized hypergeometric series, $${}_pF_q$$ 11S80 Other analytic theory (analogues of beta and gamma functions, $$p$$-adic integration, etc.) 33E50 Special functions in characteristic $$p$$ (gamma functions, etc.)

### Keywords:

hypergeometric identities; modular forms

SageMath
Full Text:

### References:

 [1] <NAME>; <NAME>, A Gaussian hypergeometric series evaluation and Ap\'ery number congruences, J. <NAME>. Math., 518, 187-212 (2000) · Zbl 0940.33002 [2] <NAME>.; <NAME>; <NAME>, Special functions, Encyclopedia of Mathematics and its Applications 71, xvi+664 pp. (1999), Cambridge University Press, Cambridge · Zbl 0920.33001 [3] <NAME>.; <NAME>.; <NAME>., Gauss and Jacobi sums, Canadian Mathematical Society Series of Monographs and Advanced Texts, xii+583 pp. (1998), John Wiley & Sons, Inc., New York · Zbl 0906.11001 [4] <NAME>; <NAME>, $$p$$-adic gamma function and the trace of Frobenius of elliptic curves, J. Number Theory, 140, 181-195 (2014) · Zbl 1345.11041 [5] Barman, Rupam; Saikia, Neelam, Certain transformations for hypergeometric series in the $$p$$-adic setting, Int. J. Number Theory, 11, 2, 645-660 (2015) · Zbl 1365.11121 [6] Evans, Ron, Hypergeometric $$_3F_2(1/4)$$ evaluations over finite fields and Hecke eigenforms, Proc. Amer. Math. Soc., 138, 2, 517-531 (2010) · Zbl 1268.11158 [7] Fuselier, <NAME>., Hypergeometric functions over finite fields and relations to modular forms and elliptic curves, 63 pp. (2007), ProQuest LLC, Ann Arbor, MI [8] Fuselier, <NAME>., Hypergeometric functions over $$\mathbb{F}_p$$ and relations to elliptic curves and modular forms, Proc. Amer. Math. Soc., 138, 1, 109-123 (2010) · Zbl 1222.11058 [9] Fuselier, <NAME>., Traces of Hecke operators in level 1 and Gaussian hypergeometric functions, Proc. Amer. Math. Soc., 141, 6, 1871-1881 (2013) · Zbl 1297.11026 [10] Frechette, Sharon; <NAME>; <NAME>, Gaussian hypergeometric functions and traces of Hecke operators, Int. Math. Res. Not., 60, 3233-3262 (2004) · Zbl 1088.11029 [11] <NAME>, Hypergeometric functions over finite fields, Trans. Amer. Math. Soc., 301, 1, 77-101 (1987) · Zbl 0629.12017 [12] Gross, <NAME>.; Koblitz, Neal, Gauss sums and the $$p$$-adic $$\Gamma$$-function, Ann. of Math. (2), 109, 3, 569-581 (1979) · Zbl 0406.12010 [13] Katz, <NAME>., Exponential sums and differential equations, Annals of Mathematics Studies 124, xii+430 pp. (1990), Princeton University Press, Princeton, NJ · Zbl 0731.14008 [14] Kilbourn, Timothy, An extension of the Ap\'ery number supercongruence, Acta Arith., 123, 4, 335-348 (2006) · Zbl 1170.11008 [15] Koblitz, Neal, $$p$$-adic analysis: a short course on recent work, London Mathematical Society Lecture Note Series 46, 163 pp. (1980), Cambridge University Press, Cambridge-New York · Zbl 0439.12011 [16] Koblitz, Neal, Introduction to elliptic curves and modular forms, Graduate Texts in Mathematics 97, x+248 pp. (1993), Springer-Verlag, New York · Zbl 0804.11039 [17] Lennon, Catherine, Arithmetic and analytic properties of finite field hypergeometric functions, (no paging) pp. (2011), ProQuest LLC, Ann Arbor, MI [18] Lennon, Catherine, Gaussian hypergeometric evaluations of traces of Frobenius for elliptic curves, Proc. Amer. Math. Soc., 139, 6, 1931-1938 (2011) · Zbl 1281.11104 [19] Lennon, Catherine, Trace formulas for Hecke operators, Gaussian hypergeometric functions, and the modularity of a threefold, J. Number Theory, 131, 12, 2320-2351 (2011) · Zbl 1277.11037 [20] <NAME>, Supercongruences for truncated $$_{n+1}\!F_n$$ hypergeometric series with applications to certain weight three newforms, Proc. Amer. Math. Soc., 133, 2, 321-330 (electronic) (2005) · Zbl 1152.11327 [21] <NAME>, Extending Gaussian hypergeometric series to the $$p$$-adic setting, Int. J. Number Theory, 8, 7, 1581-1612 (2012) · Zbl 1253.33024 [22] <NAME>, On a supercongruence conjecture of Rodriguez-Villegas, Proc. Amer. Math. Soc., 140, 7, 2241-2254 (2012) · Zbl 1354.11030 [23] <NAME>, Transformations of well-poised hypergeometric functions over finite fields, Finite Fields Appl., 18, 6, 1133-1147 (2012) · Zbl 1276.11198 [24] <NAME>, The trace of Frobenius of elliptic curves and the $$p$$-adic gamma function, Pacific J. Math., 261, 1, 219-236 (2013) · Zbl 1296.11079 [25] [McC7] <NAME> and <NAME>, A finite field hypergeometric function associated to eigenvalues of a Siegel eigenform, arXiv:1205.1006. · Zbl 1395.11078 [26] Rodriguez-Villegas, Fernando, Hypergeometric families of Calabi-Yau manifolds. Calabi-Yau varieties and mirror symmetry, Toronto, ON, 2001, Fields Inst. Commun. 38, 223-231 (2003), Amer. Math. Soc., Providence, RI · Zbl 1062.11038 [27] [Sage] <NAME> et al., Sage Mathematics Software (Version 4.8), The Sage Development Team, 2012, http://www.sagemath.org. [28] <NAME>, Hypergeometric functions over finite fields and their relations to algebraic curves, Int. J. Number Theory, 7, 8, 2171-2195 (2011) · Zbl 1287.11138
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# Continuous spin gauge field in (A)dS space

Research paper by <NAME>

Indexed on: 03 Oct '16Published on: 03 Oct '16Published in: arXiv - High Energy Physics - Theory

#### Abstract

Totally symmetric continuous spin field propagating in (A)dS is studied. Lagrangian gauge invariant formulation for such field is developed. Lagrangian of continuous spin field is constructed in terms of double traceless tensor fields, while gauge transformations are constructed in terms of traceless gauge transformation parameters. de Donder like gauge condition that leads to simple gauge fixed Lagrangian is found. Gauge-fixed Lagrangian invariant under global BRST transformations is presented. The BRST Lagrangian is used for computation of a partition function. It is demonstrated that the partition function of the continuous spin field is equal to one. Various decoupling limits of the continuous spin field are also studied.


text:
MathSciNet bibliographic data MR911143 14L30 Popov, <NAME>. On actions of ${\bf G}_a$${\bf G}_a$ on ${\bf A}^n$${\bf A}^n$. Algebraic groups Utrecht 1986, 237–242, Lecture Notes in Math., 1271, Springer, Berlin, 1987. Article

For users without a MathSciNet license , Relay Station allows linking from MR numbers in online mathematical literature directly to electronic journals and original articles. Subscribers receive the added value of full MathSciNet reviews.


text:
# 17. LLN and CLT¶

Contents

## 17.1. Overview¶

This lecture illustrates two of the most important theorems of probability and statistics: The law of large numbers (LLN) and the central limit theorem (CLT).

These beautiful theorems lie behind many of the most fundamental results in econometrics and quantitative economic modeling.

The lecture is based around simulations that show the LLN and CLT in action.

We also demonstrate how the LLN and CLT break down when the assumptions they are based on do not hold.

In addition, we examine several useful extensions of the classical theorems, such as

• The delta method, for smooth functions of random variables

• The multivariate case

Some of these extensions are presented as exercises.

## 17.2. Relationships¶

The CLT refines the LLN.

The LLN gives conditions under which sample moments converge to population moments as sample size increases.

The CLT provides information about the rate at which sample moments converge to population moments as sample size increases.

## 17.3. LLN¶

We begin with the law of large numbers, which tells us when sample averages will converge to their population means.

### 17.3.1. The Classical LLN¶

The classical law of large numbers concerns independent and identically distributed (IID) random variables.

Here is the strongest version of the classical LLN, known as Kolmogorov’s strong law.

Let $$X_1, \ldots, X_n$$ be independent and identically distributed scalar random variables, with common distribution $$F$$.

When it exists, let $$\mu$$ denote the common mean of this sample:

$\mu := \mathbb E X = \int x F(dx)$

$\bar X_n := \frac{1}{n} \sum_{i=1}^n X_i$

Kolmogorov’s strong law states that, if $$\mathbb E |X|$$ is finite, then

(17.1)$\mathbb P \left\{ \bar X_n \to \mu \text{ as } n \to \infty \right\} = 1$

What does this last expression mean?

Let’s think about it from a simulation perspective, imagining for a moment that our computer can generate perfect random samples (which of course it can’t).

Let’s also imagine that we can generate infinite sequences, so that the statement $$\bar X_n \to \mu$$ can be evaluated.

In this setting, (17.1) should be interpreted as meaning that the probability of the computer producing a sequence where $$\bar X_n \to \mu$$ fails to occur is zero.

### 17.3.2. Proof¶

The proof of Kolmogorov’s strong law is nontrivial – see, for example, theorem 8.3.5 of [Dud02].

On the other hand, we can prove a weaker version of the LLN very easily and still get most of the intuition.

The version we prove is as follows: If $$X_1, \ldots, X_n$$ is IID with $$\mathbb E X_i^2 < \infty$$, then, for any $$\epsilon > 0$$, we have

(17.2)$\mathbb P \left\{ | \bar X_n - \mu | \geq \epsilon \right\} \to 0 \quad \text{as} \quad n \to \infty$

(This version is weaker because we claim only convergence in probability rather than almost sure convergence, and assume a finite second moment)

To see that this is so, fix $$\epsilon > 0$$, and let $$\sigma^2$$ be the variance of each $$X_i$$.

Recall the Chebyshev inequality, which tells us that

(17.3)$\mathbb P \left\{ | \bar X_n - \mu | \geq \epsilon \right\} \leq \frac{\mathbb E [ (\bar X_n - \mu)^2]}{\epsilon^2}$

Now observe that

\begin{split} \begin{aligned} \mathbb E [ (\bar X_n - \mu)^2 ] & = \mathbb E \left\{ \left[ \frac{1}{n} \sum_{i=1}^n (X_i - \mu) \right]^2 \right\} \\ & = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n \mathbb E (X_i - \mu)(X_j - \mu) \nonumber \\ & = \frac{1}{n^2} \sum_{i=1}^n \mathbb E (X_i - \mu)^2 \nonumber \\ & = \frac{\sigma^2}{n} \nonumber \end{aligned} \end{split}

Here the crucial step is at the third equality, which follows from independence.

Independence means that if $$i \not= j$$, then the covariance term $$\mathbb E (X_i - \mu)(X_j - \mu)$$ drops out.

As a result, $$n^2 - n$$ terms vanish, leading us to a final expression that goes to zero in $$n$$.

Combining our last result with (17.3), we come to the estimate

(17.4)$\mathbb P \left\{ | \bar X_n - \mu | \geq \epsilon \right\} \leq \frac{\sigma^2}{n \epsilon^2}$

The claim in (17.2) is now clear.

Of course, if the sequence $$X_1, \ldots, X_n$$ is correlated, then the cross-product terms $$\mathbb E (X_i - \mu)(X_j - \mu)$$ are not necessarily zero.

While this doesn’t mean that the same line of argument is impossible, it does mean that if we want a similar result then the covariances should be “almost zero” for “most” of these terms.

In a long sequence, this would be true if, for example, $$\mathbb E (X_i - \mu)(X_j - \mu)$$ approached zero when the difference between $$i$$ and $$j$$ became large.

In other words, the LLN can still work if the sequence $$X_1, \ldots, X_n$$ has a kind of “asymptotic independence”, in the sense that correlation falls to zero as variables become further apart in the sequence.

This idea is very important in time series analysis, and we’ll come across it again soon enough.

### 17.3.3. Illustration¶

Let’s now illustrate the classical IID law of large numbers using simulation.

In particular, we aim to generate some sequences of IID random variables and plot the evolution of $$\bar X_n$$ as $$n$$ increases.

Below is a figure that does just this (as usual, you can click on it to expand it).

It shows IID observations from three different distributions and plots $$\bar X_n$$ against $$n$$ in each case.

The dots represent the underlying observations $$X_i$$ for $$i = 1, \ldots, 100$$.

In each of the three cases, convergence of $$\bar X_n$$ to $$\mu$$ occurs as predicted.

using LinearAlgebra, Statistics
using LaTeXStrings, Plots, Distributions, Random, Statistics

function ksl(distribution, n = 100)
title = nameof(typeof(distribution))
observations = rand(distribution, n)
sample_means = cumsum(observations) ./ (1:n)
μ = mean(distribution)
plot(repeat((1:n)', 2),
[zeros(1, n); observations'], label = "", color = :grey, alpha = 0.5)
plot!(1:n, observations, color = :grey, markershape = :circle,
alpha = 0.5, label = "", linewidth = 0)
if !isnan(μ)
hline!([μ], color = :black, linewidth = 1.5, linestyle = :dash, grid = false,
label = "Mean")
end
plot!(1:n, sample_means, linewidth = 3, alpha = 0.6, color = :green,
label = "Sample mean")
return plot!(title = title)
end

ksl (generic function with 2 methods)

distributions = [TDist(10), Beta(2, 2), Gamma(5, 2), Poisson(4), LogNormal(0.5),
Exponential(1)]

6-element Vector{UnivariateDistribution}:
TDist{Float64}(ν=10.0)
Beta{Float64}(α=2.0, β=2.0)
Gamma{Float64}(α=5.0, θ=2.0)
Poisson{Float64}(λ=4.0)
LogNormal{Float64}(μ=0.5, σ=1.0)
Exponential{Float64}(θ=1.0)

Here is in an example for the standard normal distribution

ksl(Normal())

Random.seed!(0); # reproducible results

plot(ksl.(sample(distributions, 3, replace = false))..., layout = (3, 1), legend = false)

The three distributions are chosen at random from distributions.

### 17.3.4. Infinite Mean¶

What happens if the condition $$\mathbb E | X | < \infty$$ in the statement of the LLN is not satisfied?

This might be the case if the underlying distribution is heavy tailed — the best known example is the Cauchy distribution, which has density

$f(x) = \frac{1}{\pi (1 + x^2)} \qquad (x \in \mathbb R)$

The next figure shows 100 independent draws from this distribution

Random.seed!(0); # reproducible results

ksl(Cauchy())

Notice how extreme observations are far more prevalent here than the previous figure.

Let’s now have a look at the behavior of the sample mean

Random.seed!(0); # reproducible results

function plot_means(n = 1000)
sample_mean = cumsum(rand(Cauchy(), n)) ./ (1:n)
plot(1:n, sample_mean, color = :red, alpha = 0.6, label = "Sample Mean", linewidth = 3)
return hline!([0], color = :black, linestyle = :dash, label = "", grid = false)
end

plot_means()

Here we’ve increased $$n$$ to 1000, but the sequence still shows no sign of converging.

Will convergence become visible if we take $$n$$ even larger?

To see this, recall that the characteristic function of the Cauchy distribution is

(17.5)$\phi(t) = \mathbb E e^{itX} = \int e^{i t x} f(x) dx = e^{-|t|}$

Using independence, the characteristic function of the sample mean becomes

\begin{split} \begin{aligned} \mathbb E e^{i t \bar X_n } & = \mathbb E \exp \left\{ i \frac{t}{n} \sum_{j=1}^n X_j \right\} \\ & = \mathbb E \prod_{j=1}^n \exp \left\{ i \frac{t}{n} X_j \right\} \\ & = \prod_{j=1}^n \mathbb E \exp \left\{ i \frac{t}{n} X_j \right\} = [\phi(t/n)]^n \end{aligned} \end{split}

In view of (17.5), this is just $$e^{-|t|}$$.

Thus, in the case of the Cauchy distribution, the sample mean itself has the very same Cauchy distribution, regardless of $$n$$.

In particular, the sequence $$\bar X_n$$ does not converge to a point.

## 17.4. CLT¶

Next we turn to the central limit theorem, which tells us about the distribution of the deviation between sample averages and population means.

### 17.4.1. Statement of the Theorem¶

The central limit theorem is one of the most remarkable results in all of mathematics.

In the classical IID setting, it tells us the following:

If the sequence $$X_1, \ldots, X_n$$ is IID, with common mean $$\mu$$ and common variance $$\sigma^2 \in (0, \infty)$$, then

(17.6)$\sqrt{n} ( \bar X_n - \mu ) \stackrel { d } {\to} N(0, \sigma^2) \quad \text{as} \quad n \to \infty$

Here $$\stackrel { d } {\to} N(0, \sigma^2)$$ indicates convergence in distribution to a centered (i.e, zero mean) normal with standard deviation $$\sigma$$.

### 17.4.2. Intuition¶

The striking implication of the CLT is that for any distribution with finite second moment, the simple operation of adding independent copies always leads to a Gaussian curve.

A relatively simple proof of the central limit theorem can be obtained by working with characteristic functions (see, e.g., theorem 9.5.6 of [Dud02]).

The proof is elegant but almost anticlimactic, and it provides surprisingly little intuition.

In fact all of the proofs of the CLT that we know are similar in this respect.

Why does adding independent copies produce a bell-shaped distribution?

Part of the answer can be obtained by investigating addition of independent Bernoulli random variables.

In particular, let $$X_i$$ be binary, with $$\mathbb P\{X_i = 0\} = \mathbb P\{X_i = 1 \} = 0.5$$, and let $$X_1, \ldots, X_n$$ be independent.

Think of $$X_i = 1$$ as a “success”, so that $$Y_n = \sum_{i=1}^n X_i$$ is the number of successes in $$n$$ trials.

The next figure plots the probability mass function of $$Y_n$$ for $$n = 1, 2, 4, 8$$

binomial_pdf(n) =
bar(0:n, pdf.(Binomial(n), 0:n),
xticks = 0:10, ylim = (0, 1), yticks = 0:0.1:1,
label = L"Binomial(%$n, 0.5)", legend = :topleft)  binomial_pdf (generic function with 1 method)  plot(binomial_pdf.((1,2,4,8))...)  When $$n = 1$$, the distribution is flat — one success or no successes have the same probability. When $$n = 2$$ we can either have 0, 1 or 2 successes. Notice the peak in probability mass at the mid-point $$k=1$$. The reason is that there are more ways to get 1 success (“fail then succeed” or “succeed then fail”) than to get zero or two successes. Moreover, the two trials are independent, so the outcomes “fail then succeed” and “succeed then fail” are just as likely as the outcomes “fail then fail” and “succeed then succeed”. (If there was positive correlation, say, then “succeed then fail” would be less likely than “succeed then succeed”) Here, already we have the essence of the CLT: addition under independence leads probability mass to pile up in the middle and thin out at the tails. For $$n = 4$$ and $$n = 8$$ we again get a peak at the “middle” value (halfway between the minimum and the maximum possible value). The intuition is the same — there are simply more ways to get these middle outcomes. If we continue, the bell-shaped curve becomes ever more pronounced. We are witnessing the binomial approximation of the normal distribution. ### 17.4.3. Simulation 1¶ Since the CLT seems almost magical, running simulations that verify its implications is one good way to build intuition. To this end, we now perform the following simulation 1. Choose an arbitrary distribution $$F$$ for the underlying observations $$X_i$$. 2. Generate independent draws of $$Y_n := \sqrt{n} ( \bar X_n - \mu )$$. 3. Use these draws to compute some measure of their distribution — such as a histogram. 4. Compare the latter to $$N(0, \sigma^2)$$. Here’s some code that does exactly this for the exponential distribution $$F(x) = 1 - e^{- \lambda x}$$. (Please experiment with other choices of $$F$$, but remember that, to conform with the conditions of the CLT, the distribution must have finite second moment) using StatsPlots function simulation1(distribution, n = 250, k = 10_000) σ = std(distribution) y = rand(distribution, n, k) y .-= mean(distribution) y = mean(y, dims = 1) y = √n * vec(y) density(y, label = "Empirical Distribution") return plot!(Normal(0, σ), linestyle = :dash, color = :black, label = L"Normal(0.00, %$(σ^2))")
end

simulation1 (generic function with 3 methods)

simulation1(Exponential(0.5))

The fit to the normal density is already tight, and can be further improved by increasing n.

You can also experiment with other specifications of $$F$$.

### 17.4.4. Simulation 2¶

Our next simulation is somewhat like the first, except that we aim to track the distribution of $$Y_n := \sqrt{n} ( \bar X_n - \mu )$$ as $$n$$ increases.

In the simulation we’ll be working with random variables having $$\mu = 0$$.

Thus, when $$n=1$$, we have $$Y_1 = X_1$$, so the first distribution is just the distribution of the underlying random variable.

For $$n=2$$, the distribution of $$Y_2$$ is that of $$(X_1 + X_2) / \sqrt{2}$$, and so on.

What we expect is that, regardless of the distribution of the underlying random variable, the distribution of $$Y_n$$ will smooth out into a bell shaped curve.

The next figure shows this process for $$X_i \sim f$$, where $$f$$ was specified as the convex combination of three different beta densities.

(Taking a convex combination is an easy way to produce an irregular shape for $$f$$)

function simulation2(distribution = Beta(2, 2), n = 5, k = 10_000)
y = rand(distribution, k, n)
for col in 1:n
y[:,col] += rand([-0.5, 0.6, -1.1], k)
end
y = (y .- mean(distribution)) ./ std(distribution)
y = cumsum(y, dims = 2) ./ sqrt.(1:5)' # return grid of data
end

simulation2 (generic function with 4 methods)

ys = simulation2()
plots = [] # would preallocate in optimized code
for i in 1:size(ys, 2)
p = density(ys[:, i], linealpha = i, title = L"n = %\$i")
push!(plots, p)
end

plot(plots..., legend = false, size = (900, 500))

As expected, the distribution smooths out into a bell curve as $$n$$ increases.

We leave you to investigate its contents if you wish to know more.

If you run the file from the ordinary Julia or IJulia shell, the figure should pop up in a window that you can rotate with your mouse, giving different views on the density sequence.

### 17.4.5. The Multivariate Case¶

The law of large numbers and central limit theorem work just as nicely in multidimensional settings.

To state the results, let’s recall some elementary facts about random vectors.

A random vector $$\mathbf X$$ is just a sequence of $$k$$ random variables $$(X_1, \ldots, X_k)$$.

Each realization of $$\mathbf X$$ is an element of $$\mathbb R^k$$.

A collection of random vectors $$\mathbf X_1, \ldots, \mathbf X_n$$ is called independent if, given any $$n$$ vectors $$\mathbf x_1, \ldots, \mathbf x_n$$ in $$\mathbb R^k$$, we have

$\mathbb P\{\mathbf X_1 \leq \mathbf x_1,\ldots, \mathbf X_n \leq \mathbf x_n \} = \mathbb P\{\mathbf X_1 \leq \mathbf x_1 \} \times \cdots \times \mathbb P\{ \mathbf X_n \leq \mathbf x_n \}$

(The vector inequality $$\mathbf X \leq \mathbf x$$ means that $$X_j \leq x_j$$ for $$j = 1,\ldots,k$$)

Let $$\mu_j := \mathbb E [X_j]$$ for all $$j =1,\ldots,k$$.

The expectation $$\mathbb E [\mathbf X]$$ of $$\mathbf X$$ is defined to be the vector of expectations:

$\begin{split} \mathbb E [\mathbf X] := \left( \begin{array}{c} \mathbb E [X_1] \\ \mathbb E [X_2] \\ \vdots \\ \mathbb E [X_k] \end{array} \right) = \left( \begin{array}{c} \mu_1 \\ \mu_2\\ \vdots \\ \mu_k \end{array} \right) =: \boldsymbol \mu \end{split}$

The variance-covariance matrix of random vector $$\mathbf X$$ is defined as

$\mathop{\mathrm{Var}}[\mathbf X] := \mathbb E [ (\mathbf X - \boldsymbol \mu) (\mathbf X - \boldsymbol \mu)']$

Expanding this out, we get

$\begin{split} \mathop{\mathrm{Var}}[\mathbf X] = \left( \begin{array}{ccc} \mathbb E [(X_1 - \mu_1)(X_1 - \mu_1)] & \cdots & \mathbb E [(X_1 - \mu_1)(X_k - \mu_k)] \\ \mathbb E [(X_2 - \mu_2)(X_1 - \mu_1)] & \cdots & \mathbb E [(X_2 - \mu_2)(X_k - \mu_k)] \\ \vdots & \vdots & \vdots \\ \mathbb E [(X_k - \mu_k)(X_1 - \mu_1)] & \cdots & \mathbb E [(X_k - \mu_k)(X_k - \mu_k)] \\ \end{array} \right) \end{split}$

The $$j,k$$-th term is the scalar covariance between $$X_j$$ and $$X_k$$.

With this notation we can proceed to the multivariate LLN and CLT.

Let $$\mathbf X_1, \ldots, \mathbf X_n$$ be a sequence of independent and identically distributed random vectors, each one taking values in $$\mathbb R^k$$.

Let $$\boldsymbol \mu$$ be the vector $$\mathbb E [\mathbf X_i]$$, and let $$\Sigma$$ be the variance-covariance matrix of $$\mathbf X_i$$.

Interpreting vector addition and scalar multiplication in the usual way (i.e., pointwise), let

$\bar{\mathbf X}_n := \frac{1}{n} \sum_{i=1}^n \mathbf X_i$

In this setting, the LLN tells us that

(17.7)$\mathbb P \left\{ \bar{\mathbf X}_n \to \boldsymbol \mu \text{ as } n \to \infty \right\} = 1$

Here $$\bar{\mathbf X}_n \to \boldsymbol \mu$$ means that $$\| \bar{\mathbf X}_n - \boldsymbol \mu \| \to 0$$, where $$\| \cdot \|$$ is the standard Euclidean norm.

The CLT tells us that, provided $$\Sigma$$ is finite,

(17.8)$\sqrt{n} ( \bar{\mathbf X}_n - \boldsymbol \mu ) \stackrel { d } {\to} N(\mathbf 0, \Sigma) \quad \text{as} \quad n \to \infty$

## 17.5. Exercises¶

### 17.5.1. Exercise 1¶

One very useful consequence of the central limit theorem is as follows.

Assume the conditions of the CLT as stated above.

If $$g \colon \mathbb R \to \mathbb R$$ is differentiable at $$\mu$$ and $$g'(\mu) \not= 0$$, then

(17.9)$\sqrt{n} \{ g(\bar X_n) - g(\mu) \} \stackrel { d } {\to} N(0, g'(\mu)^2 \sigma^2) \quad \text{as} \quad n \to \infty$

This theorem is used frequently in statistics to obtain the asymptotic distribution of estimators — many of which can be expressed as functions of sample means.

(These kinds of results are often said to use the “delta method”)

The proof is based on a Taylor expansion of $$g$$ around the point $$\mu$$.

Taking the result as given, let the distribution $$F$$ of each $$X_i$$ be uniform on $$[0, \pi / 2]$$ and let $$g(x) = \sin(x)$$.

Derive the asymptotic distribution of $$\sqrt{n} \{ g(\bar X_n) - g(\mu) \}$$ and illustrate convergence in the same spirit as the program illustrate_clt.jl discussed above.

What happens when you replace $$[0, \pi / 2]$$ with $$[0, \pi]$$?

What is the source of the problem?

### 17.5.2. Exercise 2¶

Here’s a result that’s often used in developing statistical tests, and is connected to the multivariate central limit theorem.

If you study econometric theory, you will see this result used again and again.

Assume the setting of the multivariate CLT discussed above, so that

1. $$\mathbf X_1, \ldots, \mathbf X_n$$ is a sequence of IID random vectors, each taking values in $$\mathbb R^k$$

2. $$\boldsymbol \mu := \mathbb E [\mathbf X_i]$$, and $$\Sigma$$ is the variance-covariance matrix of $$\mathbf X_i$$

3. The convergence

(17.10)$\sqrt{n} ( \bar{\mathbf X}_n - \boldsymbol \mu ) \stackrel { d } {\to} N(\mathbf 0, \Sigma)$

is valid.

In a statistical setting, one often wants the right hand side to be standard normal, so that confidence intervals are easily computed.

This normalization can be achieved on the basis of three observations.

First, if $$\mathbf X$$ is a random vector in $$\mathbb R^k$$ and $$\mathbf A$$ is constant and $$k \times k$$, then

$\mathop{\mathrm{Var}}[\mathbf A \mathbf X] = \mathbf A \mathop{\mathrm{Var}}[\mathbf X] \mathbf A'$

Second, by the continuous mapping theorem, if $$\mathbf Z_n \stackrel{d}{\to} \mathbf Z$$ in $$\mathbb R^k$$ and $$\mathbf A$$ is constant and $$k \times k$$, then

$\mathbf A \mathbf Z_n \stackrel{d}{\to} \mathbf A \mathbf Z$

Third, if $$\mathbf S$$ is a $$k \times k$$ symmetric positive definite matrix, then there exists a symmetric positive definite matrix $$\mathbf Q$$, called the inverse square root of $$\mathbf S$$, such that

$\mathbf Q \mathbf S\mathbf Q' = \mathbf I$

Here $$\mathbf I$$ is the $$k \times k$$ identity matrix.

Putting these things together, your first exercise is to show that if $$\mathbf Q$$ is the inverse square root of $$\mathbf \Sigma$$, then

$\mathbf Z_n := \sqrt{n} \mathbf Q ( \bar{\mathbf X}_n - \boldsymbol \mu ) \stackrel{d}{\to} \mathbf Z \sim N(\mathbf 0, \mathbf I)$

Applying the continuous mapping theorem one more time tells us that

$\| \mathbf Z_n \|^2 \stackrel{d}{\to} \| \mathbf Z \|^2$

Given the distribution of $$\mathbf Z$$, we conclude that

(17.11)$n \| \mathbf Q ( \bar{\mathbf X}_n - \boldsymbol \mu ) \|^2 \stackrel{d}{\to} \chi^2(k)$

where $$\chi^2(k)$$ is the chi-squared distribution with $$k$$ degrees of freedom.

(Recall that $$k$$ is the dimension of $$\mathbf X_i$$, the underlying random vectors)

Your second exercise is to illustrate the convergence in (17.11) with a simulation.

In doing so, let

$\begin{split} \mathbf X_i := \left( \begin{array}{c} W_i \\ U_i + W_i \end{array} \right) \end{split}$

where

• each $$W_i$$ is an IID draw from the uniform distribution on $$[-1, 1]$$

• each $$U_i$$ is an IID draw from the uniform distribution on $$[-2, 2]$$

• $$U_i$$ and $$W_i$$ are independent of each other

Hints:

1. sqrt(A::AbstractMatrix{<:Number}) computes the square root of A. You still need to invert it.

2. You should be able to work out $$\Sigma$$ from the proceeding information.

## 17.6. Solutions¶

### 17.6.1. Exercise 1¶

Here is one solution

function exercise1(distribution = Uniform(0, π/2); n = 250, k = 10_000, g = sin, g′ = cos)
μ, σ = mean(distribution), std(distribution)
y = rand(distribution, n, k)
y = mean(y, dims = 1)
y = vec(y)
error_obs = sqrt(n) .* (g.(y) .- g.(μ))
density(error_obs, label = "Empirical Density")
return plot!(Normal(0, g′(μ) .* σ), linestyle = :dash, label = "Asymptotic",
color = :black)
end
exercise1()

What happens when you replace $$[0, \pi / 2]$$ with $$[0, \pi]$$?

In this case, the mean $$\mu$$ of this distribution is $$\pi/2$$, and since $$g' = \cos$$, we have $$g'(\mu) = 0$$.

Hence the conditions of the delta theorem are not satisfied.

### 17.6.2. Exercise 2¶

First we want to verify the claim that

$\sqrt{n} \mathbf Q ( \bar{\mathbf X}_n - \boldsymbol \mu ) \stackrel{d}{\to} N(\mathbf 0, \mathbf I)$

This is straightforward given the facts presented in the exercise.

Let

$\mathbf Y_n := \sqrt{n} ( \bar{\mathbf X}_n - \boldsymbol \mu ) \quad \text{and} \quad \mathbf Y \sim N(\mathbf 0, \Sigma)$

By the multivariate CLT and the continuous mapping theorem, we have

$\mathbf Q \mathbf Y_n \stackrel{d}{\to} \mathbf Q \mathbf Y$

Since linear combinations of normal random variables are normal, the vector $$\mathbf Q \mathbf Y$$ is also normal.

Its mean is clearly $$\mathbf 0$$, and its variance covariance matrix is

$\mathrm{Var}[\mathbf Q \mathbf Y] = \mathbf Q \mathrm{Var}[\mathbf Y] \mathbf Q' = \mathbf Q \Sigma \mathbf Q' = \mathbf I$

In conclusion, $$\mathbf Q \mathbf Y_n \stackrel{d}{\to} \mathbf Q \mathbf Y \sim N(\mathbf 0, \mathbf I)$$, which is what we aimed to show.

Now we turn to the simulation exercise.

Our solution is as follows

function exercise2(;n = 250, k = 50_000, dw = Uniform(-1, 1), du = Uniform(-2, 2))
vw = var(dw)
vu = var(du)
Σ = [vw    vw
vw vw + vu]
Q = inv(sqrt(Σ))
function generate_data(dw, du, n)
dw = rand(dw, n)
X = [dw dw + rand(du, n)]
return sqrt(n) * mean(X, dims = 1)
end
X = mapreduce(x -> generate_data(dw, du, n), vcat, 1:k)
X = Q * X'
X = sum(abs2, X, dims = 1)
X = vec(X)
density(X, label = "", xlim = (0, 10))
return plot!(Chisq(2), color = :black, linestyle = :dash,
label = "Chi-squared with 2 degrees of freedom", grid = false)
end
exercise2()