0% found this document useful (0 votes)
34 views

Practical-1 Functions in Mathematica: A) " " Is Used To Test If One Quantity Is Equal To Another

This document discusses various mathematical functions in Mathematica including using == and <= to test equality and inequality, using N to approximate numerical values, using FactorInteger to find prime factors of integers, using Factor and Expand to factor and expand polynomials, using Binomial to calculate binomial coefficients, using Prime to find prime numbers, and using Mod to compute modular arithmetic. It provides examples of using these functions and asks practice questions involving finding binomial coefficients, prime factors, prime number tables, and modular arithmetic computations.

Uploaded by

Abhimanyu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Practical-1 Functions in Mathematica: A) " " Is Used To Test If One Quantity Is Equal To Another

This document discusses various mathematical functions in Mathematica including using == and <= to test equality and inequality, using N to approximate numerical values, using FactorInteger to find prime factors of integers, using Factor and Expand to factor and expand polynomials, using Binomial to calculate binomial coefficients, using Prime to find prime numbers, and using Mod to compute modular arithmetic. It provides examples of using these functions and asks practice questions involving finding binomial coefficients, prime factors, prime number tables, and modular arithmetic computations.

Uploaded by

Abhimanyu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Practical-1

Functions in Mathematica
1. Testing Symbols

a) “==” is used to test if one quantity is


equal to another
50 653 == H50 653L1•2
True

8435 Š H8435L3•2
3

False

b) “b” is used to test if one is less than or


equal to another

50 653 b 225
False
50 653 b 226
True
2 Practical 1.nb

2. Numerical Approximation Command N


N@PiD
N@Pi, 100D
NA1520, 20E
N@E, 20D
p
3. Degree: It’s value is equal to 180

Sin@90 °D
1
Sin@90 DegreeD
1
4. Factoring Integers: the command
“FactorInteger[n]” gives the prime factors
of any integer n.
FactorInteger @324D
882, 2<, 83, 4<<
Practical 1.nb 3

FactorInteger @4 832 875D


885, 3<, 823, 1<, 841, 2<<
Note: The output tells us that 324=22 34
and 4832875=53 231 412

5.Factoring and Expanding Polynomials:


Commands are “Factor” and “Expand”
FactorAa2 - b2 E
Ha - bL Ha + bL
Expand@Ha - bL Ha + bLD
a2 - b2

6. To calculate Binomial Coefficient:


Command is “Binomial”
Binomial@7, 2D
21
4 Practical 1.nb

7. Prime Number: The function Prime[n]


gives the nth prime number.
Prime@3D
5
Practical 1.nb 5

Table@Prime@nD, 8n, 1, 100<D


82, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47,
53, 59, 61, 67, 71, 73, 79,
83, 89, 97, 101, 103, 107,
109, 113, 127, 131, 137, 139,
149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199,
211, 223, 227, 229, 233, 239,
241, 251, 257, 263, 269, 271,
277, 281, 283, 293, 307, 311,
313, 317, 331, 337, 347, 349,
353, 359, 367, 373, 379, 383,
389, 397, 401, 409, 419, 421,
431, 433, 439, 443, 449, 457,
461, 463, 467, 479, 487, 491,
499, 503, 509, 521, 523, 541<
6 Practical 1.nb

Table@Prime@nD, 8n, 5, 20<D


811, 13, 17, 19, 23, 29, 31, 37,
41, 43, 47, 53, 59, 61, 67, 71<
8. Modular Function: The function
Mod[a,b] evaluates a mod b.
Mod@21, 6D
3
Mod@21, 7D
0
9. Extracting Digits from a Number: To get list of digits the
command is “IntegerDigits”, to form a number the command is
“FromDigits”
IntegerDigits@2010D
82, 0, 1, 0<

1 + 82, 0, 1, 0<
83, 1, 2, 1<

FromDigits@82, 0, 1, 0<D
2010

Practice Questions
1. Find binomial coefficient of (97,32) and
(127,55).
2. Find Prime Factors of integers a)
3527218133309949276293 b)
Practice Questions
1. Find binomial coefficient of (97,32) and
Practical 1.nb 7

(127,55).
2. Find Prime Factors of integers a)
3527218133309949276293 b)
471945325930166281.
3. construct table for the following nth
prime number a) (3,20) b) (47,60) c)
(97,150).
4. Compute the following expression a) 36
mod 7 b) 36 mod 11 c) 720 mod 21
d) 723 mod 21.

You might also like