Maths is a little without Sets!

B = { { M , A , T , H , S } } \large\color{darkred}{B=\{ \{ M,A,T,H,S \} \}}

Find the cardinal number of the set B \color{darkred}{B} .

Note: The cardinal number of a set is equal to the number of elements contained in the set.

Bonus question given with the picture.
Join the Brilliant Classes and enjoy the excellence. Also checkout Foundation Assignment #2 for JEE.
0 5 1 6 4 None of the given choices

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Brock Brown
May 28, 2015

Python 2.7:

1
2
B = [['M','A','T','H','S']]
print "Answer:", len(B)

Python has a 'set' data type, and it does not allow a set to contain a set. For example:

1
A = set(set('M', 'A', 'T', 'H', 'S'))

Gives the error: TypeError: unhashable type: 'set'

So, be careful when assuming that data types behave the same as math entities. Usually, math notation is much more flexible!

Dan Wilhelm - 5 years, 11 months ago

Hey man!Why do you use CS for such simple problems??I mean this was a one second question!!Do you even know how to count!!??(sorry to be rude but i needed to express my anger)

Adarsh Kumar - 6 years ago

Log in to reply

You've got to stop taking things so seriously man. Stop and enjoy life for a while, you're going to give yourself a heart attack. Sniff the crap of out some roses.

Because A A is a set of 1 set, its cardinality is 1 \boxed{1} . I figured it out before I wrote the code, I just thought that the code was a good demonstration.

Also, I do know how to count:

Python 2.7:

1
2
3
count = 0
while True:
    count += 1

Brock Brown - 6 years ago

Log in to reply

Hahahahahaha nice!

Adarsh Kumar - 6 years ago
Soham Nimale
May 22, 2020

No proper solutions woul u like to be notified.....

It is a set inside a set

So no.= 1

See properly and use logic

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...